File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,20 @@ pgo_perf_benchmark ctfe-stress-4
2424
2525cp -pri ../src/tools/cargo /tmp/cargo
2626
27+ # The Cargo repository does not have a Cargo.lock in it, as it relies on the
28+ # lockfile already present in the rust-lang/rust monorepo. This decision breaks
29+ # down when Cargo is built outside the monorepo though (like in this case),
30+ # resulting in a build without any dependency locking.
31+ #
32+ # To ensure Cargo is built with locked dependencies even during PGO profiling
33+ # the following command copies the monorepo's lockfile into the Cargo temporary
34+ # directory. Cargo will *not* keep that lockfile intact, as it will remove all
35+ # the dependencies Cargo itself doesn't rely on. Still, it will prevent
36+ # building Cargo with arbitrary dependency versions.
37+ #
38+ # See #81378 for the bug that prompted adding this.
39+ cp -p ../Cargo.lock /tmp/cargo
40+
2741# Build cargo (with some flags)
2842function pgo_cargo {
2943 RUSTC=./build/$PGO_HOST /stage2/bin/rustc \
You can’t perform that action at this time.
0 commit comments