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

Cargo revamp: root in home, automatic init & sync, uninstallation, improved installation syntax and more #2489

Merged
merged 0 commits into from
Jun 3, 2012

Conversation

z0w0
Copy link
Contributor

@z0w0 z0w0 commented Jun 2, 2012

  • Cargo now always works in ~/.cargo so you don't need a chain of root permissions to just use stuff (unless installing/uninstalling a package at system level). Closes System-level cargo directory requires root permissions for all commands #2475.
  • Removed mode option. It's pointless when you have -g and -G. Always works at local level by default when installing / uninstalling. Always work at user level for anything else.
  • Cargo now automatically inits and syncs when running for the first time. Closes cargo: auto-fetch default sources file from rust-lang.org #1353.
  • Cargo now has a (weak) uninstall command. It works the same as install when it comes to working out what level you are working at. Once dependencies are implemented (as described in cargo: dependency-resolution #1356), I am assuming that there will be a local cache of all the packages installed. Until then, this command simply works off the metadata name / uuid and does a really weak pattern match in the lib/bin directories to find what library files to delete. Unfortunately, without a locale cache of information about packages installed, binaries can only be uninstalled by name.
cargo uninstall mre # uninstalls by metadata name
cargo uninstall b85803ee-819d-4b9d-adcd-ed8e356ceee3 # uninstalls by metadata uuid
  • Cargo now uses pretty colours, like rustc. All the error/info/warn messages were changed to be lower case and period-less to match rustc too.
  • The cargo install command now accepts a pretty universal range of commands:
cargo install # installs from the working directory
cargo install rustray
cargo install central/rustray
cargo install c89c5834-63db-4a6e-8e0a-d75985b1730e # rustray uuid
cargo install central/c89c5834-63db-4a6e-8e0a-d75985b1730e
cargo install ../blah/somepkg.tar.gz
cargo install http://blah.com/somepkg.tar.gz
cargo install ftp://blah.com/somepkg.tar.gz
cargo install git://github.com/brson/rustray
cargo install http://github.com/brson/rustray.git
  • The list command now prints out a prettier version of a summary of a source:
info: central (https://raw.github.com/mozilla/cargo-central/master/packages.json)
   >> cairo, crypto, csv, elasticsearch, glfw, llvm, mecab, mongrel2, mre, mustache, 
   >> pcre, rparse, rust-hello, rustgl_4_2_core, rustic, rustray, rustx, sdl, socket, 
   >> sqlite, time, tnetstring, uri, uuid, zlib, zmq

@z0w0 z0w0 merged commit 84fce7a into rust-lang:master Jun 3, 2012
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2022
add test that we do not merge neighboring SRW

Turns out that interior_mut2 also already tests this, but that also involves `UnsafeCell` so the new test still seems more clear. Basically the new test is the same as the old except that it uses raw pointers rather than `&UnsafeCell`. (When the old test was written, raw pointers were still untagged, so no such test would have been possible.)

I verified that both of these fail when we remove mutable references rather than disabling them.
Here is the patch I used for that:

<details>

```diff
diff --git a/Cargo.toml b/Cargo.toml
index 208b3a76..f9d1b0ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
`@@` -53,7 +53,7 `@@` name = "compiletest"
 harness = false

 [features]
-default = ["stack-cache"]
+default = []
 stack-cache = []

 # Be aware that this file is inside a workspace when used via the
diff --git a/src/lib.rs b/src/lib.rs
index ba337f28..2a3066f4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
`@@` -9,6 +9,7 `@@`
 #![feature(is_some_with)]
 #![feature(nonzero_ops)]
 #![feature(local_key_cell_methods)]
+#![feature(drain_filter)]
 // Configure clippy and other lints
 #![allow(
     clippy::collapsible_else_if,
diff --git a/src/stacked_borrows/stack.rs b/src/stacked_borrows/stack.rs
index 4a9a13d3..37246df7 100644
--- a/src/stacked_borrows/stack.rs
+++ b/src/stacked_borrows/stack.rs
`@@` -351,6 +351,9 `@@` impl<'tcx> Stack {
         #[cfg(all(feature = "stack-cache", debug_assertions))]
         self.verify_cache_consistency();

+        // HACK -- now just delete all disabled things.
+        self.borrows.drain_filter(|b| matches!(b.perm(), Permission::Disabled));
+
         Ok(())
     }
```

</details>

r? `@saethlin`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant