You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's actually not clear to me what the meaning is of a package with multiple crates, unless only one crate of each type (library or executable) is visible outside the package. So far, we've been assuming that a package ID unambiguously corresponds to a single crate. If different crates in the same package had different package IDs, they wouldn't be in the same package.
I propose the following rules:
In a package with multiple crates, only the library and executable crates at the top level (in the src/FOO directory where the package ID is FOO) are usable by crates that aren't in the same package.
rustpkg builds all crates in a given package, but only installs the two top-level crates.
Crates can only refer to other crates in the same package if those crates are in the same directory.
We discussed this in the meeting today. The conclusion was that rustpkg won't include special support for packages that need to install multiple crates. In the cases where it's needed, it will be possible to do so via a package script (pkg.rs). Otherwise, rustpkg will assume that any given package corresponds to a single executable crate that gets installed, and/or a single library crate that gets installed. (It will still build all crates when building a given package.)
I think it would be very disruptive to be able to install multiple crates via pkg.rs, but not be able to reliably use those crates from other crates handled by rustpkg (i.e. via the extern mod = "pkgid" syntax). I propose two possible resolutions to that:
Keep current syntax, add a disambiguation attribute:
extern mod foo = "Foo";// Link crate Foo from package Foo, and rename it to foo#[crate(Bar)]extern mod foo = "Foo";// Link crate Boo from package Foo, and rename it to foo
Pros:
Backwards compatible
Cons:
Awkward reading (a module is assigned to a package?)
Remove the current syntax, express everything as attributes:
#[pkg("Foo")]externmod foo;// Link crate Foo from package Foo, and rename it to foo#[pkg("Foo"),crate("Bar")]externmod foo;// Link crate Bar from package Foo, and rename it to foo
Pros:
Consistent positioning of package/crate specification
Less syntactic rules
Cons:
Not backwards compatible
More syntactically heavy in the likely common case of "one package=one crate".
The repository contains several subdirectories under examples/, each containing a main.rs, but rustpkg only leaves one executable (named examples) under build/. It should be creating a subdirectory of build/ for each of the examples/ subdirectories.
"
Activity
catamorphism commentedon Jun 19, 2013
Sub-bug of #5677
emberian commentedon Aug 5, 2013
triage bump
catamorphism commentedon Sep 13, 2013
I think this will more-or-less fall out of #7879, but I'm still leaving this open as a reminder to make a test case.
catamorphism commentedon Oct 5, 2013
It's actually not clear to me what the meaning is of a package with multiple crates, unless only one crate of each type (library or executable) is visible outside the package. So far, we've been assuming that a package ID unambiguously corresponds to a single crate. If different crates in the same package had different package IDs, they wouldn't be in the same package.
I propose the following rules:
catamorphism commentedon Oct 6, 2013
Finishing this is blocked on #9732 landing.
catamorphism commentedon Oct 15, 2013
We discussed this in the meeting today. The conclusion was that rustpkg won't include special support for packages that need to install multiple crates. In the cases where it's needed, it will be possible to do so via a package script (
pkg.rs). Otherwise, rustpkg will assume that any given package corresponds to a single executable crate that gets installed, and/or a single library crate that gets installed. (It will still build all crates when building a given package.)SiegeLord commentedon Nov 8, 2013
I think it would be very disruptive to be able to install multiple crates via pkg.rs, but not be able to reliably use those crates from other crates handled by rustpkg (i.e. via the
extern mod = "pkgid"syntax). I propose two possible resolutions to that:Keep current syntax, add a disambiguation attribute:
Pros:
Cons:
Remove the current syntax, express everything as attributes:
Pros:
Cons:
catamorphism commentedon Nov 9, 2013
I closed #8952 as a dup of this bug, but I want to make sure to address it:
"
@bjz pointed out the following example with glfw:
https://gist.github.com/bjz/8aac0e5338f50b88e31c
The repository contains several subdirectories under examples/, each containing a main.rs, but rustpkg only leaves one executable (named examples) under build/. It should be creating a subdirectory of build/ for each of the examples/ subdirectories.
"
flaper87 commentedon Feb 13, 2014
Closing rustpkg is deprecated
Auto merge of rust-lang#7240 - flip1995:rollup-6nwjgyp, r=flip1995
Merge rust-lang#7240
Merge pull request rust-lang#7240 from rust-lang/prevent_tests_from_r…