Travis permissions error: failed to write Cargo.lock
Let's monitor this error, and see if it happens again.
From https://trac.torproject.org/projects/tor/ticket/23576?replyto=24#comment:24
{{{ error: failed to write /home/travis/build/torproject/tor/tor-0.4.0.1-alpha-dev/src/rust/Cargo.lock
Caused by: failed to open: /home/travis/build/torproject/tor/tor-0.4.0.1-alpha-dev/src/rust/Cargo.lock
Caused by: Permission denied (os error 13) }}} https://travis-ci.org/torproject/tor/jobs/486721901#L3634
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- teor changed milestone to %Tor: 0.3.3.x-final in legacy/trac
changed milestone to %Tor: 0.3.3.x-final in legacy/trac
- teor added 033-backport in Legacy / Trac 034-backport in Legacy / Trac 035-backport in Legacy / Trac 040-backport in Legacy / Trac 041-proposed in Legacy / Trac actualpoints::.2 in Legacy / Trac component::core tor/tor in Legacy / Trac milestone::Tor: 0.3.3.x-final in Legacy / Trac owner::nickm in Legacy / Trac points::0.5 in Legacy / Trac priority::high in Legacy / Trac regression in Legacy / Trac resolution::fixed in Legacy / Trac severity::major in Legacy / Trac status::closed in Legacy / Trac tor-ci in Legacy / Trac type::defect in Legacy / Trac labels
added 033-backport in Legacy / Trac 034-backport in Legacy / Trac 035-backport in Legacy / Trac 040-backport in Legacy / Trac 041-proposed in Legacy / Trac actualpoints::.2 in Legacy / Trac component::core tor/tor in Legacy / Trac milestone::Tor: 0.3.3.x-final in Legacy / Trac owner::nickm in Legacy / Trac points::0.5 in Legacy / Trac priority::high in Legacy / Trac regression in Legacy / Trac resolution::fixed in Legacy / Trac severity::major in Legacy / Trac status::closed in Legacy / Trac tor-ci in Legacy / Trac type::defect in Legacy / Trac labels
This issue appears to be reproducible: https://travis-ci.org/torproject/tor/jobs/486795693#L3638
This appears to be a build environment issue, because the same commit succeeded 4 days ago, but failed 2 days ago: https://travis-ci.org/torproject/tor/builds/485707435 https://travis-ci.org/torproject/tor/builds/484917361
It is probably related to Rust 1.32.0, which was released 14 days ago.
- Owner
Trac:
Keywords: N/A deleted, 040-backport 035-backport 034-backport 033-backport? added Replying to teor:
This appears to be a build environment issue, because the same commit succeeded 4 days ago, but failed 2 days ago: https://travis-ci.org/torproject/tor/builds/485707435 https://travis-ci.org/torproject/tor/builds/484917361
It is probably related to Rust 1.32.0, which was released 14 days ago. Did cargo start trying to write to Cargo.lock, even in frozen mode? I think this is happening in the distcheck jobs because maybe it tries to make the source tree read-only.
- Owner
It's also possible that we stopped using frozen mode somewhere by mistake.
- Owner
It might be related to rust nightly, since it seems we're using that:
$ if [[ "$RUST_OPTIONS" != "" ]]; then rustc --version; fi rustc 1.34.0-nightly (d8a0dd7ae 2019-01-28)
Cargo recently started adding a comment to the start of the file: https://github.com/rust-lang/cargo/commit/3de188f1399da693c57054ed425bc0289752edd1
But cargo checks for frozen before writing. We are getting the write failed error, not the frozen error. https://github.com/rust-lang/cargo/blob/3de188f1399da693c57054ed425bc0289752edd1/src/cargo/ops/lockfile.rs#L105
- Owner
Trac:
Milestone: Tor: 0.4.1.x-final to Tor: 0.4.0.x-final
Owner: N/A to nickm
Status: new to accepted - Owner
Aha, here is the bug.
When we say
--enable-cargo-online-mode
, we do not provide the "--frozen
" flag as part of$CARGO_ONLINE
.This flag both gives cargo permission to download (which we want, since we're doing distcheck with
--enable-cargo-online-mode
) and gives it permission to update cargo.lock (which we don't, in this case). - Owner
Trac:
Keywords: 040-backport 035-backport 034-backport 033-backport? deleted, 040-backport 035-backport 034-backport 033-backport added - Owner
https://github.com/torproject/tor/pull/676 is a PR to fix this; the branch is
ticket29244_033
Trac:
Status: accepted to needs_review
Actualpoints: N/A to .2 - Owner
There is a case to be made that we should be using cargo's "--locked" option in this case, but I am going to suggest that we don't: It's not a great idea IMO to do things differently in a distcheck build.
- Owner
This looks like a reasonable fix for me. I did not try to build it with nightly locally.
Trac:
Status: needs_review to merge_ready - Reporter
Replying to teor:
Cargo recently started adding a comment to the start of the file: https://github.com/rust-lang/cargo/commit/3de188f1399da693c57054ed425bc0289752edd1
But cargo checks for frozen before writing. We are getting the write failed error, not the frozen error. https://github.com/rust-lang/cargo/blob/3de188f1399da693c57054ed425bc0289752edd1/src/cargo/ops/lockfile.rs#L105
For posterity, the above comments are where the fix comes from.
<ahf> armadev: the problem is that the place where tor.git is located is read/only, when we run distcheck it runs cargo which modifies the file by adding those two comments <ahf> but because it's read-only it will fail <ahf> but if those two lines of comment is there cargo wont touch the file
- Reporter
it is merged into maint-0.3.3 and later
Trac:
Status: merge_ready to closed
Milestone: Tor: 0.4.0.x-final to Tor: 0.3.3.x-final
Resolution: N/A to fixed - Trac closed
closed
- Trac changed time estimate to 4h
changed time estimate to 4h
- Trac added 1h 36m of time spent
added 1h 36m of time spent
- Trac moved from legacy/trac#29244 (moved)
moved from legacy/trac#29244 (moved)
- Trac added CI Regression labels and removed 1 deleted label
added CI Regression labels and removed 1 deleted label