-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Warn/error when cargo installing the cwd in 2015/2018 #5333
Conversation
r? @matklad (rust_highfive has picked a reviewer for you, use r? to override) |
my test is failing (on AppVeyor) on nightly. I thought something was wrong with my local setup. is nightly Rust meant to be edition 2018? |
No, you have to opt-in to an edition, even on nightly. See unstable docs, |
I see! thanks @ehuss that seems to have fixed the test for me locally. |
I had tried another encoding to preserve the knowledge that the package source was from the cwd, so I'd be interested to know if there's a better approach that what I went with. |
Oh no, I was sure that one can just handle this at the argument parsing level, but of course one needs to load a manifest to figure out which edition we are in.... I think a slightly better approach to thread the cwd information, instead of adding a specialized field to the SourceId, which is a core data-structure and is used everywhere, is to add an argument to the |
of course! I like it. |
LGTM! Anyone, and @rust-lang/cargo specifically, if you have any objections, please speak up! We've discussed this change at yesterday's meeting, but not everyone was present, and this change could potentially upset some people, so I'd rather double-check with you all :) The TL;DR here is that we deprecate @bors r+ |
📌 Commit d678605 has been approved by |
⌛ Testing commit d678605 with merge 552afa0342ea53caa0a5741d7e4060be6c1e0d5e... |
👍 the https://en.wikipedia.org/wiki/Pareto_principle (iiuc) |
I'm a bit confused by this. A warning isn't a breaking change, why is this gated on 2018? I would expect this to warn in 2015 and stop working in 2018 if we were doing anything connected to the edition change. |
@bors r- |
It could work either way, we can start warning in this edition, and remove in 2018, or we can start warning in 2018, and remove in the next edition. If we start to warn today, that risks causing a few warnings, if someone uses The letter seems slightly less invasive, but now that I think of it, I slightly prefer just to warn regardless of the edition: the implementation would be simpler, and presumably only few scripts are doing |
☀️ Test successful - status-appveyor, status-travis |
indeed. how many scripts are there that call |
I agree that if we warn only in 2018 then we can't actually remove it until the next edition, and I'd personally be ok starting to warn in the 2015 edition and we can evaluate whether it's reasonable to remove from the 2018 edition |
pushed a commit to aid evaluation 😄 |
(btw happy to cleanup the git history if you'd like) |
note I had to adapt 3 tests, which I think is fine seeing as it's fair to assume that cargo's test suite is bound to be more likely to be sensitive to the sudden appearance of new warnings. |
📌 Commit d8f7828 has been approved by |
Warn/error when cargo installing the cwd in 2015/2018 Fixes #5327 submitted for early review. feedback very welcome, I'm happy to iterate (and learn).
☀️ Test successful - status-appveyor, status-travis |
Fixes #5327
submitted for early review. feedback very welcome, I'm happy to iterate (and learn).