Skip to content

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

Description

@jayaddison

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions