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

rustc: Add knowledge of separate lookup paths #19941

Merged
merged 1 commit into from
Dec 30, 2014

Conversation

alexcrichton
Copy link
Member

This commit adds support for the compiler to distinguish between different forms
of lookup paths in the compiler itself. Issue #19767 has some background on this
topic, as well as some sample bugs which can occur if these lookup paths are not
separated.

This commits extends the existing command line flag -L with the same trailing
syntax as the -l flag. Each argument to -L can now have a trailing :all,
:native, :crate, or :dependency. This suffix indicates what form of lookup
path the compiler should add the argument to. The dependency lookup path is
used when looking up crate dependencies, the crate lookup path is used when
looking for immediate dependencies (extern crate statements), and the native
lookup path is used for probing for native libraries to insert into rlibs. Paths
with all are used for all of these purposes (the default).

The default compiler lookup path (the rustlib libdir) is by default added to all
of these paths. Additionally, the RUST_PATH lookup path is added to all of
these paths.

Closes #19767

@alexcrichton
Copy link
Member Author

r? @brson

@lifthrasiir
Copy link
Contributor

Is there a particular reason to change the option syntax from -L [KIND=]PATH (as proposed by the original issue) to -L PATH[:KIND]?

@alexcrichton
Copy link
Member Author

I realized that it was inconsistent with how -l worked, so I wanted to make sure that they were at least somewhat similar (a fairly weak argument though)

@alexcrichton alexcrichton force-pushed the issue-19767 branch 3 times, most recently from bbaeb71 to 232e487 Compare December 23, 2014 06:49
This commit adds support for the compiler to distinguish between different forms
of lookup paths in the compiler itself. Issue rust-lang#19767 has some background on this
topic, as well as some sample bugs which can occur if these lookup paths are not
separated.

This commits extends the existing command line flag `-L` with the same trailing
syntax as the `-l` flag. Each argument to `-L` can now have a trailing `:all`,
`:native`, `:crate`, or `:dependency`. This suffix indicates what form of lookup
path the compiler should add the argument to. The `dependency` lookup path is
used when looking up crate dependencies, the `crate` lookup path is used when
looking for immediate dependencies (`extern crate` statements), and the `native`
lookup path is used for probing for native libraries to insert into rlibs. Paths
with `all` are used for all of these purposes (the default).

The default compiler lookup path (the rustlib libdir) is by default added to all
of these paths. Additionally, the `RUST_PATH` lookup path is added to all of
these paths.

Closes rust-lang#19767
bors added a commit that referenced this pull request Dec 30, 2014
This commit adds support for the compiler to distinguish between different forms
of lookup paths in the compiler itself. Issue #19767 has some background on this
topic, as well as some sample bugs which can occur if these lookup paths are not
separated.

This commits extends the existing command line flag `-L` with the same trailing
syntax as the `-l` flag. Each argument to `-L` can now have a trailing `:all`,
`:native`, `:crate`, or `:dependency`. This suffix indicates what form of lookup
path the compiler should add the argument to. The `dependency` lookup path is
used when looking up crate dependencies, the `crate` lookup path is used when
looking for immediate dependencies (`extern crate` statements), and the `native`
lookup path is used for probing for native libraries to insert into rlibs. Paths
with `all` are used for all of these purposes (the default).

The default compiler lookup path (the rustlib libdir) is by default added to all
of these paths. Additionally, the `RUST_PATH` lookup path is added to all of
these paths.

Closes #19767
@bors bors merged commit d085d9d into rust-lang:master Dec 30, 2014
@alexcrichton alexcrichton deleted the issue-19767 branch January 20, 2015 06:48
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.

Compiler lookup path separation
4 participants