Commit 4268674a authored by Mike Hommey's avatar Mike Hommey
Browse files

Bug 1823598 - Run configure before running a mach cargo command....

Bug 1823598 - Run configure before running a mach cargo command. r=firefox-build-system-reviewers,ahochheiden

When there is no configured environment, mach cargo commands always need
one. `BuildDriver.build` does create one, but for commands that don't
need that, we do need configure. Ideally, we wouldn't, but that requires
moving all the cargo invocation logic out of rust.mk, which would be
more work.

Differential Revision: https://phabricator.services.mozilla.com/D173109
parent f346c8ce
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -236,11 +236,11 @@ def cargo(
    if cargo_extra_flags is not None:
        cargo_extra_flags = " ".join(cargo_extra_flags)

    if cargo_build_flags:
    try:
        command_context.config_environment
    except BuildEnvironmentNotFoundException:
        build = command_context._spawn(BuildDriver)
        if cargo_build_flags:
            ret = build.build(
                command_context.metrics,
                what=["pre-export", "export"],
@@ -248,6 +248,11 @@ def cargo(
                verbose=verbose,
                mach_context=command_context._mach_context,
            )
        else:
            ret = build.configure(
                command_context.metrics,
                buildstatus_messages=False,
            )
        if ret != 0:
            return ret