Skip to content
Snippets Groups Projects
Commit 20cd6255 authored by Daniel's avatar Daniel
Browse files

ci: allow overriding run-docker.sh CARGO_HOME.

The `ci/run-docker.sh` utility script adds a `--volume` argument to the
`docker` command to mount the Cargo home directory of the host machine
into the container at `/cargo`.

Prior to this patch the host's Cargo home directory is assumed to be the
`dirname` of the `dirname` of the `cargo` command's path. That works in
most cases where the host machine installed rust with vanilla
`rustup`. It may fail if the host machine used a different method.

For example if the host machine used the Archlinux rustup package[0]
then `cargo` is installed to `/usr/bin/cargo` and the `run-docker.sh`
script incorrectly mounts `/usr/` to the `/cargo` directory of the test
container.

This patch allows specifying an explicit `CARGO_HOME` to the
`ci/run-docker.sh` script so that users with a non-standard cargo dir
can use the utility without modification. By default if no `CARGO_HOME`
is set then the legacy behaviour is used and `CARGO_HOME` defaults to
the `dirname` of the `dirname` of the `cargo` command is used.

[0]: https://wiki.archlinux.org/index.php/rust#Arch_Linux_package
parent d2963c22
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment