-
-
Notifications
You must be signed in to change notification settings - Fork 365
Description
Describe the bug
I noticed a failure in a grass-addons build of grass, where it failed at the grass/app/resource_paths.py file.
The error was about a non-existent directory. A couple lines above in the CI logs, the folder seems to be created. It isn't specific to grass-addons, but was noticed there
This sounds like a concurrency issue because of using make in parallel. OR, that a rule's recipe makes a change to a file (that has a requirement somewhere), and then it gets launched by another make job before finishing the recipe is finished.
To reproduce
Just a normal grass-addons build in CI, probably hard to reproduce.
See the CI logs of the failing job around the specific line selected here: https://github.com/echoix/grass-addons/actions/runs/17359531450/job/49277610940#step:11:2411
Expected behavior
Builds not failing
Screenshots
if [ "" != "" -a -f "".html ] ; then make html ; fi
make[3]: Leaving directory '/home/runner/work/grass-addons/grass-addons/grass/lib/calc'
make[2]: Leaving directory '/home/runner/work/grass-addons/grass-addons/grass/lib'
make[2]: Entering directory '/home/runner/work/grass-addons/grass-addons/grass/python'
make[3]: Entering directory '/home/runner/work/grass-addons/grass-addons/grass/python/grass'
mkdir -p /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass
/usr/bin/install -c -m 644 __init__.py /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/__init__.py
make subdirs
make[4]: Entering directory '/home/runner/work/grass-addons/grass-addons/grass/python/grass'
make[5]: Entering directory '/home/runner/work/grass-addons/grass-addons/grass/python/grass/app'
mkdir -p /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/app
rm -f /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/app/resource_paths.py
cp resource_paths.py /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/resource_paths.py
sed \
-e 's#@CONFIG_PROJSHARE@#/usr/share/proj#' \
-e 's#@GISBASE_INSTALL_PATH@##' \
-e 's#@GRASS_PREFIX@#/home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu#' \
-e 's#@GRASS_VERSION_GIT@#d272f2f#' \
-e 's#@GRASS_VERSION_MAJOR@#8#' \
-e 's#@GRASS_VERSION_MINOR@#5#' \
-e 's#@GRASS_VERSION_NUMBER@#8.5.0dev#' \
-e 's#@LD_LIBRARY_PATH_VAR@#LD_LIBRARY_PATH#' \
-e 's#@START_UP@#grass#' \
resource_paths.py > /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/app/resource_paths.py
/bin/sh: 1: cannot create /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/app/resource_paths.py: Directory nonexistent
make[5]: *** [Makefile:23: /home/runner/work/grass-addons/grass-addons/grass/dist.x86_64-pc-linux-gnu/etc/python/grass/app/resource_paths.py] Error 2
make[5]: *** Waiting for unfinished jobs....
make[5]: Leaving directory '/home/runner/work/grass-addons/grass-addons/grass/python/grass/app'
make[5]: Entering directory '/home/runner/work/grass-addons/grass-addons/grass/python/grass/benchmark'

System description
-
Operating System: Ubuntu 22.04.5 LTS in GitHub actions
-
GRASS version: 8.5.0 at commit d272f2f
-
details about further software components
- run
g.version -rge
in a GRASS terminal session or check in
the GUI menu "Help > About" - run
python3 -c "import sys, wx; print(sys.version); print(wx.version())"
to print the Python and wxPython version numbers
- run
Additional context
The files with potential rules missing order-only requirements and a closer look should be taken at are:
grass/include/Make/Install.make
Lines 98 to 147 in d272f2f
RESOURCE_PATHS = etc/python/grass/app/resource_paths.py | |
real-install: | $(DESTDIR) $(DESTDIR)$(INST_DIR) $(DESTDIR)$(UNIX_BIN) | |
-tar cBCf $(GISBASE) - . | tar xBCf $(DESTDIR)$(INST_DIR) - 2>/dev/null | |
-rm $(DESTDIR)$(INST_DIR)/$(GRASS_NAME).tmp | |
-rm $(DESTDIR)$(INST_DIR)/$(RESOURCE_PATHS) | |
$(MAKE) $(STARTUP) | |
-rm $(DESTDIR)$(INST_DIR)/resource_paths.py | |
-rm $(DESTDIR)$(INST_DIR)/$(RESOURCE_PATHS) | |
$(MAKE) $(DESTDIR)$(INST_DIR)/$(RESOURCE_PATHS) | |
-rm $(DESTDIR)$(INST_DIR)/$(FONTCAP) | |
$(MAKE) $(DESTDIR)$(INST_DIR)/$(FONTCAP) | |
-rm $(DESTDIR)$(INST_DIR)/$(TMPGISRC) | |
$(MAKE) $(DESTDIR)$(INST_DIR)/$(TMPGISRC) | |
-rm $(DESTDIR)$(INST_DIR)/$(PLATMAKE) | |
$(MAKE) $(DESTDIR)$(INST_DIR)/$(PLATMAKE) | |
-rm $(DESTDIR)$(INST_DIR)/$(GRASSMAKE) | |
$(MAKE) $(DESTDIR)$(INST_DIR)/$(GRASSMAKE) | |
-$(CHMOD) -R a+rX $(DESTDIR)$(INST_DIR) 2>/dev/null | |
$(DESTDIR): | |
$(MAKE_DIR_CMD) -p $@ | |
$(DESTDIR)$(INST_DIR) $(DESTDIR)$(UNIX_BIN): | |
$(MAKE_DIR_CMD) $@ | |
$(STARTUP): $(ARCH_DISTDIR)/$(GRASS_NAME).tmp | |
sed -e 's#'@GRASS_PYDIR@'#'$(INST_DIR)/etc/python'#g' \ | |
$< > $@ | |
-$(CHMOD) a+x $@ | |
$(DESTDIR)$(INST_DIR)/$(RESOURCE_PATHS): $(ARCH_DISTDIR)/resource_paths.py | |
sed \ | |
-e 's#'@CONFIG_PROJSHARE@'#$(PROJSHARE)#' \ | |
-e 's#'@GISBASE_INSTALL_PATH@'##' \ | |
-e 's#'@GRASS_PREFIX@'#$(INST_DIR)#' \ | |
-e 's#'@GRASS_VERSION_GIT@'#$(GRASS_VERSION_GIT)#' \ | |
-e 's#'@GRASS_VERSION_MAJOR@'#$(GRASS_VERSION_MAJOR)#' \ | |
-e 's#'@GRASS_VERSION_MINOR@'#$(GRASS_VERSION_MINOR)#' \ | |
-e 's#'@GRASS_VERSION_NUMBER@'#$(GRASS_VERSION_NUMBER)#' \ | |
-e 's#'@LD_LIBRARY_PATH_VAR@'#$(LD_LIBRARY_PATH_VAR)#' \ | |
-e 's#'@START_UP@'#$(GRASS_NAME)#' \ | |
$< > $@ | |
grass/python/grass/app/Makefile
Lines 6 to 42 in d272f2f
DSTDIR = $(ETC)/python/grass/app | |
MODULES = \ | |
__main__ \ | |
cli \ | |
data \ | |
runtime | |
PYFILES := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__) | |
PYCFILES := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES) __init__) | |
PYFILES := $(filter-out resource_paths.py,$(PYFILES)) | |
default: $(PYFILES) $(PYCFILES) $(DSTDIR)/resource_paths.py $(ARCH_DISTDIR)/resource_paths.py | |
$(DSTDIR)/resource_paths.py: resource_paths.py | |
rm -f $@ | |
sed \ | |
-e 's#@CONFIG_PROJSHARE@#$(PROJSHARE)#' \ | |
-e 's#@GISBASE_INSTALL_PATH@##' \ | |
-e 's#@GRASS_PREFIX@#$(RUN_GISBASE)#' \ | |
-e 's#@GRASS_VERSION_GIT@#$(GRASS_VERSION_GIT)#' \ | |
-e 's#@GRASS_VERSION_MAJOR@#$(GRASS_VERSION_MAJOR)#' \ | |
-e 's#@GRASS_VERSION_MINOR@#$(GRASS_VERSION_MINOR)#' \ | |
-e 's#@GRASS_VERSION_NUMBER@#$(GRASS_VERSION_NUMBER)#' \ | |
-e 's#@LD_LIBRARY_PATH_VAR@#$(LD_LIBRARY_PATH_VAR)#' \ | |
-e 's#@START_UP@#$(GRASS_NAME)#' \ | |
$< > $@ | |
$(ARCH_DISTDIR)/resource_paths.py: | |
cp resource_paths.py $@ | |
$(DSTDIR): | |
$(MKDIR) $@ | |
$(DSTDIR)/%: % | $(DSTDIR) | |
$(INSTALL_DATA) $< $@ |
The equivalent CMakeLists.txt:
grass/python/grass/CMakeLists.txt
Lines 27 to 36 in d272f2f
set(PYDIR_GRASS ${GRASS_INSTALL_PYDIR}/grass) | |
foreach(pydir ${PYDIRS}) | |
copy_python_files_in_subdir(${pydir} ${PYDIR_GRASS}) | |
endforeach() | |
copy_python_files_in_subdir(app ${PYDIR_GRASS} EXCLUDE resource_paths.py) | |
configure_file(__init__.py ${OUTDIR}/${PYDIR_GRASS}/ COPYONLY) | |
configure_file(script/setup.py ${OUTDIR}/${PYDIR_GRASS}/script/setup.py | |
COPYONLY) |
and (same file)
grass/python/grass/CMakeLists.txt
Lines 54 to 80 in d272f2f
# configure and install resource_paths.py | |
set(GRASS_PREFIX ${OUTDIR}) | |
set(GISBASE_INSTALL_PATH ${GISBASE_DIR}) | |
set(START_UP ${PROJECT_NAME_LOWER}) | |
configure_file(app/resource_paths.py ${OUTDIR}/${PYDIR_GRASS}/app/resource_paths.py @ONLY) | |
set(GRASS_PREFIX ${CMAKE_INSTALL_PREFIX}) | |
configure_file(app/resource_paths.py ${CMAKE_CURRENT_BINARY_DIR}/resource_paths.py @ONLY) | |
unset(GISBASE_INSTALL_PATH) | |
unset(GRASS_PREFIX) | |
unset(START_UP) | |
set(pydir_targets ${PYDIRS} app) | |
list(TRANSFORM pydir_targets REPLACE "/" "_") | |
list(TRANSFORM pydir_targets PREPEND "python_") | |
add_custom_target( | |
LIB_PYTHON | |
VERBATIM | |
DEPENDS ${pydir_targets}) | |
set_target_properties(LIB_PYTHON PROPERTIES FOLDER lib) | |
install(DIRECTORY ${OUTDIR}/${PYDIR_GRASS} DESTINATION ${GRASS_INSTALL_PYDIR} | |
PATTERN "*/resource_paths.py" EXCLUDE) | |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resource_paths.py | |
DESTINATION ${GRASS_INSTALL_PYDIR}/grass/app) |