From 59b5728c0c182e1df99bd62fdf9fc43151dce8b8 Mon Sep 17 00:00:00 2001 From: Tiziano Santoro Date: Tue, 9 Jun 2020 10:45:24 +0100 Subject: [PATCH] Pass `--remap-path-prefix` to cargo This is meant to reduce nondeterminism across machines or docker vs host, but it does not seem to fully solve the problem yet (it does remove some paths from the resulting binary, so I think it is necessary, but not sufficient). Ref #865 --- scripts/common | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/common b/scripts/common index 47bcbbc7383..4b2ac12a3aa 100644 --- a/scripts/common +++ b/scripts/common @@ -10,6 +10,9 @@ set -o pipefail # https://docs.rs/env_logger export RUST_LOG="${RUST_LOG:-info}" +# Reduce build nondeterminism by remapping paths so that they don't include local segments. +export RUSTFLAGS="--remap-path-prefix=$PWD=/" + # See https://pantheon.corp.google.com/gcr/images/oak-ci/GLOBAL/oak readonly DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak' readonly SERVER_DOCKER_IMAGE_NAME='gcr.io/oak-ci/oak-server'