grass icon indicating copy to clipboard operation
grass copied to clipboard

[Bug] Error on running ./mswindows/osgeo4w/package.sh after `Make distclean` on Windows

Open girishnand opened this issue 2 years ago • 1 comments

Describe the bug

(Caveat: I am not sure if this is a bug or just inadequate documentation.)

I am able to setup and compile GRASS GIS on windows (mostly) following the recommended procedure here - https://trac.osgeo.org/grass/wiki/CompileOnWindows

When I attempt to recompile following make distclean (from the main grass directory), using the following sequence of bash commands (in the MINGW64 bash shell) -

$ make distclean Followed by this script (named girish_env.sh) -

#!/usr/bin/bash
export OSGEO4W_ROOT_MSYS=/c/osgeo4w
export VCPATH="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64"
./mswindows/osgeo4w/package.sh

I get the following error -

$ ./girish_env.sh OSGEO4W_ROOT_MSYS:/c/osgeo4w OSGEO4W_ROOT: Wed Jan 31 18:46:58 IST 2024: STARTING make include/Make/Vars.make:1: include/Make/Platform.make: No such file or directory make: *** No rule to make target 'include/Make/Platform.make'. include/Make/Vars.make:1: Failed to remake makefile 'include/Make/Platform.make'. cat: error.log: No such file or directory

I was able to trace the issue to the following lines of - ./mswindows/osgeo4w/package.sh

if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
	if [ -e include/Make/Platform.make ] ; then
	    log make distclean
	    make distclean
	fi

https://github.com/OSGeo/grass/blob/cd494bdc075daa5d78ddfb5991d7fce295e2e921/mswindows/osgeo4w/package.sh#L138C1-L143C4

If I delete the file ./mswindows/osgeo4w/configure-stamp, the script runs successfully.

Not sure if this should be classified as a bug or if calling make distclean from the bash command line violates recommended practice when using .mswindows/osgeo4w/package.sh

To Reproduce

As above.

System description (please complete the following information):

I am running the following commit -

$ git log commit 8d6269279e364a20c741f343a8157ba527223b32 (HEAD -> r.horizon-rewrite, petrasovaa-grass/r.horizon-rewrite) Author: Anna Petrasova [email protected] Date: Mon Jan 8 14:28:39 2024 -0500

shorten function call

While this specific commit is from @petrasovaa's r.horizon-rewrite branch, I have gotten identical results with the (then) current main branch of the OSGeo/grass repo for the last several months.

I am on a Win 11 machine with the OSGeo4w and msys2 configuration recommended here - https://trac.osgeo.org/grass/wiki/CompileOnWindows

girishnand avatar Jan 31 '24 14:01 girishnand

Does @hellik have a suggestion here?

neteler avatar Feb 03 '24 10:02 neteler