-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add a flag to force generating toplevel crate map #10422
Merged
Merged
Conversation
This file contains 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
As we start to move runtime components into the crate map, it's becoming harder and harder to start the runtime from a C function as rust is embedded in another application. Right now if you compile a rust crate as a dynamic library which is then linked to another application, when using std::rt::start there are no I/O local services, even though rustuv was linked against and requested. The reason for this is that there is no top level crate map available specifying where to find libuv I/O. This option is not meant to be used regularly, but rather whenever compiling a final library crate and linking it into another application. This lifts the requirement that to get a crate map you must have the final destination be an executable.
bors
added a commit
that referenced
this pull request
Nov 12, 2013
As we start to move runtime components into the crate map, it's becoming harder and harder to start the runtime from a C function as rust is embedded in another application. Right now if you compile a rust crate as a dynamic library which is then linked to another application, when using std::rt::start there are no I/O local services, even though rustuv was linked against and requested. The reason for this is that there is no top level crate map available specifying where to find libuv I/O. This option is not meant to be used regularly, but rather whenever compiling a final library crate and linking it into another application. This lifts the requirement that to get a crate map you must have the final destination be an executable.
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Nov 12, 2013
In rust-lang#10422, I didn't actually test to make sure that the '-Z gen-crate-map' option was usable before I implemented it. The crate map was indeed generated when '-Z gen-crate-map' was specified, but the I/O factory slot was empty because of an extra check in trans about filling in that location. This commit both fixes that location, and checks in a "fancy test" which does lots of fun stuff. The test will use the rustc library to compile a rust crate, and then compile a C program to link against that crate and run the C program. To my knowledge this is the first test of its kind, so it's a little ad-hoc, but it seems to get the job done. We could perhaps generalize running tests like this, but for now I think it's fine to have this sort of functionality tucked away in a test.
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Nov 19, 2013
In rust-lang#10422, I didn't actually test to make sure that the '-Z gen-crate-map' option was usable before I implemented it. The crate map was indeed generated when '-Z gen-crate-map' was specified, but the I/O factory slot was empty because of an extra check in trans about filling in that location. This commit both fixes that location, and checks in a "fancy test" which does lots of fun stuff. The test will use the rustc library to compile a rust crate, and then compile a C program to link against that crate and run the C program. To my knowledge this is the first test of its kind, so it's a little ad-hoc, but it seems to get the job done. We could perhaps generalize running tests like this, but for now I think it's fine to have this sort of functionality tucked away in a test.
alexcrichton
added a commit
that referenced
this pull request
Nov 30, 2013
In #10422, I didn't actually test to make sure that the '-Z gen-crate-map' option was usable before I implemented it. The crate map was indeed generated when '-Z gen-crate-map' was specified, but the I/O factory slot was empty because of an extra check in trans about filling in that location. This commit both fixes that location, and checks in a "fancy test" which does lots of fun stuff. The test will use the rustc library to compile a rust crate, and then compile a C program to link against that crate and run the C program. To my knowledge this is the first test of its kind, so it's a little ad-hoc, but it seems to get the job done. We could perhaps generalize running tests like this, but for now I think it's fine to have this sort of functionality tucked away in a test.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 10, 2023
…p1995 Fix array-size-threshold config deserialization error changelog: Fix error when providing an `array-size-threshold` in `clippy.toml` Not entirely sure why it doesn't want to deserialize a u128, but converting it after the fact is an easy enough fix Fixes rust-lang#10422
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As we start to move runtime components into the crate map, it's becoming harder
and harder to start the runtime from a C function as rust is embedded in another
application. Right now if you compile a rust crate as a dynamic library which is
then linked to another application, when using std::rt::start there are no I/O
local services, even though rustuv was linked against and requested. The reason
for this is that there is no top level crate map available specifying where to
find libuv I/O.
This option is not meant to be used regularly, but rather whenever compiling a
final library crate and linking it into another application. This lifts the
requirement that to get a crate map you must have the final destination be an
executable.