Opened 12 years ago

Closed 11 years ago

#1553 closed defect (fixed)

osgeo4w and qgis builds: path settings to msys on wingrass find wrong 'sort'

Reported by: sbl Owned by: grass-dev@…
Priority: major Milestone: 6.4.3
Component: Packaging Version: 6.4.2 RCs
Keywords: wingrass, osgeo4w, qgis Cc:
CPU: Unspecified Platform: MSWindows XP

Description

Commandline environment is behaving strange on wingrass (likely because of path setings):

e.g. sort command ("sort -n -t ','") exits with error message: "Input file specified two times"

It seems to be a problem of path-settings. See: http://www.question-defense.com/2010/08/25/windows-7-cygwin-sort-input-file-specified-two-times

Error occures both when installing GRASS through OSGeo4W-installer and though QGIS-standalone installer (and with different GRASS versions (6.4.1 and 6.4.2)).

Probably, the path to msys/MINGW is hidden by some Windows settings...

Change History (17)

comment:1 by hamish, 12 years ago

Component: DefaultPackaging
Keywords: wingrass osgeo4w qgis added
Priority: normalmajor
Summary: path settings to msys on wingrassosgeo4w and qgis builds: path settings to msys on wingrass find wrong 'sort'
Version: unspecified6.4.2 RCs

probably related to #1139. (v.report uses sort)

these scripts all use sort, and so may also have problems: d.polar, d.vect.thematic, g.mlist, i.oif, i.spectral, r.in.wms, r.univar.sh, v.colors, v.db.univar, v.in.e00, v.in.garmin, v.in.gpsbabel, v.out.gpsbabel, v.univar.sh

what does "echo $PATH" say from the osgeo4w msys prompt?

Hamish

comment:2 by sbl, 12 years ago

Here is the output from "echo $PATH"

.:/usr/local/bin:/mingw/bin:/bin:/c/PROGRA~1/QUANTU~2/bin:/c/PROGRA~1/GTK/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/Program Files/Intel/DMIX:/c/Program Files/NTRU Cryptosystems/NTRU TCG Software Stack/bin/:/c/Program Files/Wave Systems Corp/Gemalto/Access Client/v5/:/c/Program Files/Intel/WiFi/bin/:/c/Program Files/Common Files/Roxio Shared/DLLShared/:/c/Program Files/Common Files/Roxio Shared/10.0/DLLShared/:/c/Program Files/Windows Imaging/:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/WINDOWS/system32/WindowsPowerShell/v1.0:/c/Program Files/TortoiseSVN/bin:/c/Program Files/R/R-2.11.1/bin:/c/Program Files/PostgreSQL/8.4/bin:/c/Program Files/Quantum GIS Wroclaw/bin:/c/Program Files/SSH Communications Security/SSH Secure Shell:/bin

BTW: I also experienced issues regarding single and double quotation marks. They are not allways recognised as usual/expected in the GRASS windows-cmd. I post this here because I suspect it has the same background. Hope thats O.K.:

echo "double > quotation marks" results in "double > quotation marks", while echo 'single > quotation marks' results in "" (an empty line)

v.db.select --verbose map=grid columns=cat where="cat>10" results in Error:

"DBMI-DBF driver error: SQL parser error: syntax error, unexpected $end processing in statement: SELECT cat FROM grid WHERE cat Error in db_open_select_cursor() ERROR: Unable to open select cursor"

comment:3 by hamish, 12 years ago

In #1139 [comment 16 hellik] wrote:

tested above with a completely fresh downloaded osgeo4-stack (the old osgeo4-stack ,which my earlier tests above were based upon, was more than 2 years old). now also v.report invoked from the wx-gui is working.

so for the original bug-reporter, please test again with a completely fresh osgeo4w-stack/osgeo4w-wingrass.

comment:4 by sbl, 12 years ago

I can confirm that: v.db.select --verbose map=grid columns=cat where="cat>10" works on a fresh installation of OSGeo4W, though, v.report and sort do not.

in reply to:  4 ; comment:5 by hamish, 12 years ago

Replying to sbl:

I can confirm that: v.db.select --verbose map=grid columns=cat where="cat>10" works on a fresh installation of OSGeo4W, though, v.report and sort do not.

what does which sort say? how about which echo?

do /bin/sort.exe and /bin/echo.exe exist?

are you running the commands from a MSys rxvt terminal prompt, a cmd.exe DOS box, or the wxGUI command-line entry box?

In your $PATH /bin comes before /c/WINDOWS/system32, so I'm not sure why it wouldn't pick up /bin/sort.exe if it was there.

thanks, Hamish

in reply to:  5 ; comment:6 by sbl, 12 years ago

Replying to hamish:

Replying to sbl:

I can confirm that: v.db.select --verbose map=grid columns=cat where="cat>10" works on a fresh installation of OSGeo4W, though, v.report and sort do not.

what does which sort say? how about which echo?

which sort says: 'which' is not recognized as an internal or external command, operable program or batch file. Both, from the GRASS Text GUI, and the WX-GUI commandline interface Invoked from Msys it says: /bin/sort.exe

do /bin/sort.exe and /bin/echo.exe exist?

Not in C:\OSGeo4W\bin, but in C:\OSGeo4W\apps\msys\bin

are you running the commands from a MSys rxvt terminal prompt, a cmd.exe DOS box, or the wxGUI command-line entry box?

I tried the DOS box (GRASS Text GUI), the Wx-GUIs commandline, and Msys. The commands work only on Msys.

In your $PATH /bin comes before /c/WINDOWS/system32, so I'm not sure why it wouldn't pick up /bin/sort.exe if it was there.

Really strange, but when I write C:\OSGeo4W\apps\msys\bin\sort in GRASS CMD it works also from there.

thanks, Hamish

in reply to:  6 ; comment:7 by martinl, 12 years ago

Replying to sbl:

I tried the DOS box (GRASS Text GUI), the Wx-GUIs commandline, and Msys. The commands work only on Msys.

right, extra unix-like tools have been recently moved from extrabin to msys/bin (standalone installer). This was not reflected in PATH. Speaking about GRASS OSGeo4W package I am not sure if the original msys package from OSGeo4W framework contains all required unix-like tools.

Ideally standalone installer should contain original msys package from OSGeo4W framework with all required tools, not locally extended msys installation, see here.

It requires to collect list of required unix-line tools for GRASS and add grass-msys or update msys package in OSGeo4W framework.

in reply to:  7 comment:8 by martinl, 12 years ago

Replying to martinl:

(standalone installer). This was not reflected in PATH. Speaking about GRASS OSGeo4W package

not right, seems to be OK for standalone and osgeo4w installer. Anyway for OSGeo4W msys/bin is the last item in PATH.

in reply to:  7 ; comment:9 by jef, 12 years ago

Replying to martinl:

It requires to collect list of required unix-line tools for GRASS and add grass-msys or update msys package in OSGeo4W framework.

GRASS is the only dependant on msys. So msys should either be extended or replaced by grass-msys.

in reply to:  9 ; comment:10 by martinl, 12 years ago

Replying to jef:

Replying to martinl:

It requires to collect list of required unix-line tools for GRASS and add grass-msys or update msys package in OSGeo4W framework.

GRASS is the only dependant on msys. So msys should either be extended or replaced by grass-msys.

right, also long-term bug (1.) could be fixed. Any volunteer for collecting list of required unix-like tools (see bash scripts in GRASS 6)?

in reply to:  10 comment:11 by hamish, 12 years ago

Replying to martinl:

Any volunteer for collecting list of required unix-like tools (see bash scripts in GRASS 6)?

as long as we are shipping a msys environment (grass6) all supplied SUS unix power tools should be included, whether used in grass scripts (currently/yet) or not. their usefulness to size ratio is incredible, and we must consider the countless end-user scripts we know nothing about, and will never see.

if there are a few problematic or huge executables in there of course they should be reviewed on a case by case basis, but the default collection needs to be there in full.

Hamish

comment:12 by hamish, 12 years ago

(since we are a supplier of basic building blocks, we must be very careful in everything we do not to let a failure of imagination on our part artificially limit the end-users' or some future developers' ability to invent and expand in ways we never thought of.)

thanks, Hamish

comment:13 by hamish, 12 years ago

is this now fixed with the latest osgeo4w pkg updates?

in reply to:  13 comment:14 by sbl, 12 years ago

No, unfortunately not. I tested both on Windows XP and a Windows 7 (wher no OSGeo was installed earlier)... The 'sort' command does not show up in the list of osgeo-shell-commands in the startup either...

These are the path-setttings on my Windows XP computer (having the path to msys at last position...): C:\OSGeo4W\bin;C:\PROGRA~1\GTK\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;C:\Program Files\NTRU Cryptosystems\NTRUTCG Software Stack\bin\;C:\Program Files\Wave Systems Corp\Gemalto\Access Client\v5\;C:\Program Files\Intel\WiFi\bin\;c:\Program Files\Common Files\Roxio Shared\DLLShared\;c:\Program Files\Common Files\Roxio Shared\10.0DLLShared\;C:\Program Files\Windows Imaging\;C:\WINDOWS\system32WindowsPowerShell\v1.0;C:\WINDOWS\system32WindowsPowerShell\v1.0;C:\Program Files\TortoiseSVN\bin;C:\Program Files\R\R-2.11.1\bin;C:\Program iles\PostgreSQL\8.4\bin;C:\Program Files\Quantum GIS Wroclaw\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\OSGeo4W\apps\msys\bin

comment:15 by neteler, 11 years ago

It seems to be there now:

GRASS 6.4.3svn (nc_spm_08)> sort --version
sort (GNU coreutils) 5.97

Can you confirm?

comment:16 by neteler, 11 years ago

Milestone: 6.4.26.4.3

Tested ok once more on Win8 with winGRASS standalone.

Does it persist in the GRASS-OSGeo4W-installer?

comment:17 by sbl, 11 years ago

Resolution: fixed
Status: newclosed

Tested ok on Win7 with GRASS 6.4.3svnthrough OSGeo4w-installer...

Note: See TracTickets for help on using tickets.