Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: race condition between install-schemas and compile-schemas #2219

Open
jayaddison opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@jayaddison
Copy link

Describe the bug

The Makefile contains an install-system target that depends on both install-schemas and compile-shemas (sic).

Hoever: the compile-shemas target reads files from paths that are created by the install-schemas target, and they can both run in parallel when make's parallelism is enabled (-j).

Expected behavior

The .gschema.xml files required for the compile-shemas target should always exist before the compile-shemas target is run.

Actual behavior

When make parallelism is enabled a gschemas.compiled file may or may not be created, depending on the runtime behaviour of the race condition.

To Reproduce

The sample below uses make -j12 install-system to approximate the behaviour:

$ PREFIX=/.../bugreport/ make -j12 install-system
install -dm755                                       "//.../bugreport//share/applications"
if [ 1 = 1 ]; then glib-compile-schemas //.../bugreport//share/glib-2.0/schemas; fi
for f in $(find po -iname "*.mo"); do \
        l="${f%%.*}"; \
        lb=$(basename $l); \
        install -Dm644 "$f" "//.../bugreport//share/locale/$lb/LC_MESSAGES/guake.mo"; \
done;
install -Dm644 "/.../guake/data/guake.desktop"       "//.../bugreport//share/applications/"
# you probably want to execute this target with sudo:
Error opening directory “//.../bugreport//share/glib-2.0/schemas”: No such file or directory
make: *** [Makefile:147: compile-shemas] Error 1

Note: sometimes the output differs, due to the race condition; for example if the directory has been created but does not yet contain .gschema.xml files then a message No schema files found: doing nothing. appears instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant