Closed Bug 1675498 Opened 5 years ago Closed 5 years ago

`./mach vendor rust` fails with "Could not find 'cargo' on your $PATH." on Windows (MozBuild)

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(firefox84 fixed)

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: Dexter, Assigned: rstewart)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Running the ./mach vendor rust fails on Windows 10 (MozillaBuild), while the ./mach cargo check works just fine. The vendoring command fails with the following error:

./mach vendor rust
Error running mach:

    ['vendor', 'rust']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file vendor| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

FileNotFoundError: [Errno 2] Could not find 'cargo' on your $PATH.

  File "d:\mozilla-unified\python/mozbuild/mozbuild/vendor/mach_commands.py", line 145, in vendor_rust
    vendor_command.vendor(**kwargs)
  File "d:\mozilla-unified\python/mozbuild\mozbuild\vendor\vendor_rust.py", line 464, in vendor
    cargo = self._ensure_cargo()
  File "d:\mozilla-unified\python/mozbuild\mozbuild\vendor\vendor_rust.py", line 193, in _ensure_cargo
    cargo = self.get_cargo_path()
  File "d:\mozilla-unified\python/mozbuild\mozbuild\vendor\vendor_rust.py", line 76, in get_cargo_path
    raise OSError(errno.ENOENT, "Could not find 'cargo' on your $PATH.")
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit

You need to have a build environment for mach vendor rust to work/to be able to find your configured CARGO. After you've configured/built (mach configure/mach build), do you still get the mach vendor rust error?

Flags: needinfo?(alessio.placitelli)

(In reply to Ricky Stewart from comment #1)

You need to have a build environment for mach vendor rust to work/to be able to find your configured CARGO. After you've configured/built (mach configure/mach build), do you still get the mach vendor rust error?

Oh! Yes, that makes it work. I wish there was a clearer error message about that :-) But at least now I'm unblocked, thank you Ricky!

Flags: needinfo?(alessio.placitelli)
Assignee: nobody → rstewart
Status: NEW → ASSIGNED
Pushed by rstewart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5d687def2d8a Add more informative error message if a build environment is not found when running `mach vendor rust` r=firefox-build-system-reviewers,mhentges
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: