Skip to content

build: prepare for FHS, where GISBASE is not the absolute truth OSGeo/grass#5630 EXTRA FIXES - #731

Open
echoix wants to merge 20 commits into
mainfrom
claude/wonderful-shannon-g87w2g
Open

echoix wants to merge 20 commits into
mainfrom
claude/wonderful-shannon-g87w2g

Conversation

@echoix

@echoix echoix commented Oct 10, 2026

Copy link
Copy Markdown
Owner

Extra fixes for OSGeo#5630

nilason and others added 20 commits July 28, 2025 16:06
…e by a single dict object at the class level. Use dynamic attributes to avoid repeating the access code. Separate env modification from path retrieval as in OSGeo#6469.
# Conflicts:
#	CMakeLists.txt
#	cmake/modules/GRASSInstallDirs.cmake
#	gui/wxpython/gui_core/ghelp.py
#	gui/wxpython/lmgr/frame.py
#	gui/wxpython/main_window/frame.py
#	python/grass/app/resource_paths.py
#	python/grass/script/utils.py
#	scripts/g.search.modules/g.search.modules.py
G_locale_dir() calls G_fatal_error() when GRASS_LOCALEDIR is not set,
and G_fatal_error() translates its message, which re-enters
G_init_locale() and recurses until the stack overflows. Read the
variable directly and skip bindtextdomain() when it is not set,
matching the pre-existing behavior for GISBASE. Likely the cause of
the g.proj stack overflow (0xC00000FD) seen on Windows CI in the FHS
preparation PR. Found and fixed with Claude Code.
# Conflicts:
#	general/CMakeLists.txt
runtime_env_is_active() treated GISBASE on PATH as an active runtime,
so ensure_runtime_env() skipped the setup when a wrapper script (such
as the OSGeo4W env.bat) set only GISBASE. The GRASS_*DIR variables
were then missing and tools failed with "Incomplete GRASS session:
Variable 'GRASS_ETCDIR' not set", e.g., in create_project().

Require all resource directory variables for an active runtime, and
derive them from an existing GISBASE instead of the build-time prefix,
which points elsewhere for a relocated installation.

Investigated and written with the help of Claude Code.
Tools run directly by a program which sets only GISBASE and GISRC
failed with "Incomplete GRASS session: Variable 'GRASS_ETCDIR' not set"
because G_etc_dir() and the other resource directory getters required
their GRASS_*DIR variable.

When the variable is not set, use GISBASE with a path relative to it.
CMake computes the relative paths from the install layout, so they also
work with FHS. The defaults are the legacy layout, which is the only one
Autotools produces. G_init_locale() gets the same fallback so that
translations keep working.

Investigated and written with the help of Claude Code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants