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

Rustpkg should extract dependencies from extern mod statements. #5681

Closed
graydon opened this issue Apr 2, 2013 · 4 comments
Closed

Rustpkg should extract dependencies from extern mod statements. #5681

graydon opened this issue Apr 2, 2013 · 4 comments
Labels
E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Milestone

Comments

@graydon
Copy link
Contributor

graydon commented Apr 2, 2013

Sub-bug of #5677

Rustpkg currently parses pkg.rs to figure out dependencies between packages. This has to change:

  • As discussed in Rustpkg should infer crates to build #5680 rustpkg should usually operate without any pkg.rs files. It needs to find dependencies by inference by default. This means reading the source files and looking for extern mod statements (post-syntax-expansion and post-cfg-filtering).
  • As discussed in Rustpkg should operate on a URL-like pkgid #5679 the strings found in extern mod statements should be pkgids, which should be enough to find and install a package through a variety of mechanisms (RUST_PATH search order, falling back to local binary package management and/or fetching source from a URL)
@catamorphism
Copy link
Contributor

I opened a separate bug, #6407, for the second bullet point. I'm going to implement this issue first.

@catamorphism
Copy link
Contributor

Er, "this issue" as in inference; then I'll expand what's allowed in extern mod directives.

@catamorphism
Copy link
Contributor

The first part of this is done, except for cleaning up tidy errors and figuring out how to work around a borrow check issue that I'm currently handling with a copy. I might just submit a pull request with the latter issue unfixed and request advice.

catamorphism added a commit to catamorphism/rust that referenced this issue May 29, 2013
This commit won't be quite as useful until I implement RUST_PATH and
until we change `extern mod` to take a general string instead of
an identifier (rust-lang#5682 and rust-lang#6407).

With that said, now if you're using rustpkg and a program contains:

extern mod foo;

rustpkg will attempt to search for `foo`, so that you don't have to
provide a -L directory explicitly. In addition, rustpkg will
actually try to build and install `foo`, unless it's already
installed (specifically, I tested that `extern mod extra;` would
not cause it to try to find source for `extra` and compile it
again).

This is as per rust-lang#5681.

Incidentally, I changed some driver code to infer the link name
from the crate link_meta attributes. If that change isn't ok, say
something.
catamorphism added a commit to catamorphism/rust that referenced this issue May 30, 2013
This commit won't be quite as useful until I implement RUST_PATH and
until we change `extern mod` to take a general string instead of
an identifier (rust-lang#5682 and rust-lang#6407).

With that said, now if you're using rustpkg and a program contains:

extern mod foo;

rustpkg will attempt to search for `foo`, so that you don't have to
provide a -L directory explicitly. In addition, rustpkg will
actually try to build and install `foo`, unless it's already
installed (specifically, I tested that `extern mod extra;` would
not cause it to try to find source for `extra` and compile it
again).

This is as per rust-lang#5681.

Incidentally, I changed some driver code to infer the link name
from the crate link_meta attributes. If that change isn't ok, say
something. Also, I changed the addl_lib_search_paths field in the
session options to be an @mut ~[Path] so that it can be modified
after expansion but before later phases.
catamorphism added a commit to catamorphism/rust that referenced this issue Jun 2, 2013
This commit won't be quite as useful until I implement RUST_PATH and
until we change `extern mod` to take a general string instead of
an identifier (rust-lang#5682 and rust-lang#6407).

With that said, now if you're using rustpkg and a program contains:

extern mod foo;

rustpkg will attempt to search for `foo`, so that you don't have to
provide a -L directory explicitly. In addition, rustpkg will
actually try to build and install `foo`, unless it's already
installed (specifically, I tested that `extern mod extra;` would
not cause it to try to find source for `extra` and compile it
again).

This is as per rust-lang#5681.

Incidentally, I changed some driver code to infer the link name
from the crate link_meta attributes. If that change isn't ok, say
something. Also, I changed the addl_lib_search_paths field in the
session options to be an @mut ~[Path] so that it can be modified
after expansion but before later phases.
bors added a commit that referenced this issue Jun 2, 2013
catamorphism added a commit to catamorphism/rust that referenced this issue Jun 12, 2013
This commit won't be quite as useful until I implement RUST_PATH and
until we change `extern mod` to take a general string instead of
an identifier (rust-lang#5682 and rust-lang#6407).

With that said, now if you're using rustpkg and a program contains:

extern mod foo;

rustpkg will attempt to search for `foo`, so that you don't have to
provide a -L directory explicitly. In addition, rustpkg will
actually try to build and install `foo`, unless it's already
installed (specifically, I tested that `extern mod extra;` would
not cause it to try to find source for `extra` and compile it
again).

This is as per rust-lang#5681.

Incidentally, I changed some driver code to infer the link name
from the crate link_meta attributes. If that change isn't ok, say
something.
@catamorphism
Copy link
Contributor

Closing -- #6407 captures what's left of this.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 5, 2020
match_wildcard_for_single_variants: remove empty line at start of lint example.

See https://rust-lang.github.io/rust-clippy/master/index.html#match_wildcard_for_single_variants

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot.
Projects
None yet
Development

No branches or pull requests

2 participants