Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow writing Cargo.toml in project directory. #348

Merged
merged 1 commit into from
Nov 21, 2019

Conversation

reitermarkus
Copy link
Member

The project directory was previously deliberately mounted as read-only since “well behaved crates should only ever write to $OUT_DIR and never modify $CARGO_MANIFEST_DIR”. That however, breaks the --locked flag and is not worth the additional complexity.

Fixes #346.

@reitermarkus
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Nov 15, 2019
@bors
Copy link
Contributor

bors bot commented Nov 15, 2019

try

Build succeeded

  • rust-embedded.cross

@Emilgardis
Copy link
Member

Would it be possible to instead mount the Cargo.toml file in docker as rw as an alternative?

@reitermarkus
Copy link
Member Author

No, since it's a file. You can only mount directories as a volume.

Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big fan of this change, it's a bit of a capitulation.

But if you think it's the only way I'll approve it.

@reitermarkus
Copy link
Member Author

reitermarkus commented Nov 16, 2019

if you think it's the only way

I mean there could be another way, but I'm pretty sure it wouldn't be worth the additional complexity for virtually no gain. If this really was a big enough problem, cargo itself should be responsible for preventing self-modifying crates.

@Emilgardis
Copy link
Member

No, since it's a file. You can only mount directories as a volume.

I'm pretty certain it's possible in docker.

@reitermarkus
Copy link
Member Author

I'm pretty certain it's possible in docker.

You're right, seems like it is indeed possible.

Still, this wouldn't work in the case when Cargo.lock doesn't exist yet.

@reitermarkus reitermarkus requested review from therealprof and a team November 19, 2019 17:11
@therealprof
Copy link
Contributor

bors r+

bors bot added a commit that referenced this pull request Nov 21, 2019
348: Allow writing `Cargo.toml` in project directory. r=therealprof a=reitermarkus

The project directory was previously deliberately mounted as read-only since “well behaved crates should only ever write to `$OUT_DIR` and never modify `$CARGO_MANIFEST_DIR`”.  That however, breaks the `--locked` flag and is not worth the additional complexity.

Fixes #346.

Co-authored-by: Markus Reiter <[email protected]>
@bors
Copy link
Contributor

bors bot commented Nov 21, 2019

Build succeeded

@bors bors bot merged commit 83778cb into cross-rs:master Nov 21, 2019
@reitermarkus reitermarkus deleted the project-writable branch November 21, 2019 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"--locked" flag ignored in "cross build"
3 participants