-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Stabilize --extern flag without a path. #64882
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b47e3d8
Stabilize --extern flag without a path.
ehuss e0058ce
Add more --extern tests.
ehuss 4bf411e
Update built-in help for --extern.
ehuss b54e8ec
Update extern linking documentation.
ehuss 41e051d
Update src/test/ui-fulldeps/pathless-extern-unstable.rs
ehuss f9e4f0f
Add test for --extern alloc=librustc.rlib
ehuss 845ec5d
Remove docs on --extern metadata precedence.
ehuss ee459c6
Update for unstable option refactoring.
ehuss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove docs on --extern metadata precedence.
- Loading branch information
commit 845ec5df7af7fa9cc0d4c52ff61b38160e9dcc37
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have tests ensuring that sysroot crates, e.g. private rustc details emit an error when used on a stable compiler? (Also when an explicit path is used to them, not just a search.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if both
--extern CRATENAME=PATH
and--extern CRATENAME
are specified for the sameCRATENAME
? It would be nice to document that.AFAIR, multiple
--extern CRATENAME=PATH
s with the sameCRATENAME
are possible if they lead to different kinds of libraries, likerlib
anddylib
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are about 30 tests doing various things with pathless
--extern
(search for// compile-flags:.*--extern
).I have added some more specific tests:
run-make-fulldeps/extern-flag-pathless
: Shows what happens when you mix pathless with path--extern
flags. Also demonstrates the preference of rlib over dylib.ui-fulldeps/pathless-extern-unstable.rs
: Shows--extern rustc
is not allowed.ui/pathless-extern-ok.rs
: Basic test for a sysroot crate.I don't have a good intuition of how sophisticated rustc tests should be. They are also a bit disorganized, so I didn't know where to stick them, or which style would be preferred. I think the dylib tests should be safe from a cross platform standpoint (I believe they only run on Linux?).
I updated the documentation with some more detail. I never really know how detailed rustc docs should be. I intentionally left the prefer-dynamic algorithm vague. It is described somewhat in
src/librustc_metadata/dependency_format.rs
. I figure since it is complex, and possibly subject to change, it may not be worthwhile. I can add more or remove some if desired.