-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to generate rustc --remap-path-prefix
This is needed for reproducible builds. The script gets the file paths to the user's Cargo and Rustup home dirs, as well as the path to the Mullvad app source dir. These paths are then remapped to fixed values which is needed to make the build reproducible.
- Loading branch information
Showing
3 changed files
with
38 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Returns the rustc `--remap-path-prefix` flags needed to replace file paths | ||
# that gets put in the build artifacts with fixed values in order to make | ||
# the build reproducible across different machines. | ||
|
||
set -eu | ||
|
||
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" | ||
CARGO_HOME_PATH=${CARGO_HOME:-$HOME/.cargo} | ||
RUSTUP_HOME_PATH=${RUSTUP_HOME:-$HOME/.rustup} | ||
|
||
echo "--remap-path-prefix $CARGO_HOME_PATH=/CARGO_HOME \ | ||
--remap-path-prefix $RUSTUP_HOME_PATH=/RUSTUP_HOME \ | ||
--remap-path-prefix $SOURCE_DIR=/SOURCE_DIR" |