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

Ignore --arch switch if it doesn't affect the build #2962

Merged
merged 1 commit into from
Sep 23, 2024

Commits on Sep 23, 2024

  1. Ignore --arch switch if it doesn't affect the build

    This change has two consequences, one it can improve caching as
    specifying `--arch=<default_arch>` will lead to the same build id as
    not specifying it at all but, more importantly, it improves the
    usability of external tools that rely on dub generated files.
    
    Take as an example the meson build system. It supports for a project
    to depend on a dub build library. The internal code calls `dub
    describe --build=... --compiler=... --arch=...` and gathers the cache
    artifact file from that. Because of always specifying `--arch` the
    package will always need to be rebuilt when used by meson. This is
    not intuitive to someone who doesn't know how the --arch switch is
    used internally in dub.
    
    This has come up as an issue in meson's CI system. The CI system is
    setup to build test images to be used in a container, periodically,
    which include all the needed dependencies and common files that are
    shared across test runs to improve test times. For dub this implies
    that dub packages that are needed during the tests are fetched + built
    during the building of the CI images, not when running tests.
    
    However, the packages were built with `dub build --compiler=... <pkg>`
    which would log to stdout that it built <pkg> debug configuration with
    <comp> on x86_64. During the tests meson would fail to find the built
    packages because of the `--arch` switch it used internally and it
    recommended that the package should be built with `--compiler=<comp>
    --build=debug --arch=x86_64` witch is exactly what dub reported the
    package was built with. This has lead to frustrating debugging and the
    install scripts calling dub like `dub run --yes dub-build-deep --
    <pkg> --arch=x86_64 --compiler=<comp> --build=debug` because nobody
    can figure out what flags are actually needed.
    
    Signed-off-by: Andrei Horodniceanu <[email protected]>
    the-horo committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    af5687e View commit details
    Browse the repository at this point in the history