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

rustpkg: Make checked-out source files read-only, and overhaul where temporary files are stored #9732

Closed

Conversation

catamorphism
Copy link
Contributor

r? @metajack rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the PkgSrc type to keep track of separate source and destination
workspaces, as well as to have a build_workspace method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes #6480

@brson
Copy link
Contributor

brson commented Oct 8, 2013

How does rustpkg allow sources of dependencies to be updated? What happens when they are read only and need to be updated?

@catamorphism
Copy link
Contributor Author

@brson That's a good question, and I should add a test for that situation. I would rather land this PR first, though.

What I think will happen right now is that rustpkg will never update sources once they're checked out. That's obviously not the desired behavior.

What I think should happen is that rustpkg should always check for upstream changes unless a specific revision was requested [1]. If there are new changes, it should fetch them into a temporary directory, then force-rm the old checked-out sources [2] and move the temporary directory into the existing directory if everything succeeded.

This is hard to test for the same reason that we don't have tests for anything that makes network requests from a git server.

An alternative is to add a "rustpkg freshen" (or something) command that updates any git sources that are known about. Or, a --update flag that goes with build and install. Personally I'd rather not add more flags, though.

[1] However, if there's no network connection available, it should continue gracefully, perhaps printing a warning.
[2] To protect people against data loss if they accidentally made the files writable and made their own changes, perhaps it could also error out at this point if the existing files that are supposed to be read-only aren't?

…temporary files are stored

rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the `PkgSrc` type to keep track of separate source and destination
workspaces, as well as to have a `build_workspace` method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes rust-lang#6480
bors added a commit that referenced this pull request Oct 11, 2013
r? @metajack rustpkg now makes source files that it checks out automatically read-only, and stores
them under build/.

Also, refactored the `PkgSrc` type to keep track of separate source and destination
workspaces, as well as to have a `build_workspace` method that returns the workspace
to put temporary files in (usually the source, sometimes the destination -- see
comments for more details).

Closes #6480
@bors bors closed this Oct 11, 2013
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.

rustpkg should make locally cached files read-only
3 participants