Distributive-Network / PythonMonkey

A Mozilla SpiderMonkey JavaScript engine embedded into the Python VM, using the Python engine to provide the JS host environment.
https://pythonmonkey.io
Other
854 stars 40 forks source link

Fix Windows build for finding the `cargo` executable #409

Closed Xmader closed 3 months ago

Xmader commented 3 months ago

PR https://github.com/Distributive-Network/PythonMonkey/pull/386 tried to make the cargo executable immediately available in the current shell by sourcing $HOME/.cargo/env.

console messages when cargo is installed by rustup on *nix


Rust is installed now. Great!

To get started you may need to restart your current shell. This would reload your PATH environment variable to include Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, you need to source the corresponding env file under $HOME/.cargo.

This is usually done by running one of the following (note the leading DOT): . "$HOME/.cargo/env" # For sh/bash/zsh/ash/dash/pdksh source "$HOME/.cargo/env.fish" # For fish


However, this method does not work in Windows, and thus breaks our Windows build CI.

> console messages when cargo is installed by `rustup` on Windows
```console
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload its PATH environment variable to include
Cargo's bin directory (%USERPROFILE%\.cargo\bin).

Error

 ./setup.sh: line 37: /c/Users/runneradmin/.cargo/env: No such file or directory

This PR fixes this error by executing cargo by its absolute path.


Closes https://github.com/Distributive-Network/PythonMonkey/issues/408