Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1304815 - rearrange Rust crate structure for newer Rust releases;…
… r=ted.mielczarek In our current Rust world, we have the following dependency structure: xul.so --------------------------+ | xul-gtest.so -+--> xul.a --------+-> gkrust | +--> gkrust-gtest This structure results in link errors with multiply-defined symbols between gkrust-gtest and gkrust with newer Rust releases when linking xul-gtest.so. So we have to do something different. Our new structure is: xul.so --------------------------+ | xul-gtest.so -+--> xul.a --------+-> gkrust --+-> gkrust-shared | | +--> gkrust-gtest --------------+ and we enforce that a given shared library can only have at most one Rust library that it depends on. Said Rust library is assumed to include all significant Rust dependencies of the dependent static libraries as well. (In the above structure, gkrust is simply a wrapper around gkrust-shared, so gkrust-gtest doesn't have to include gkrust as a dependency.)
- Loading branch information
Showing
23 changed files
with
198 additions
and
93 deletions.
There are no files selected for viewing
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
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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/moz.build
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Any copyright is dedicated to the Public Domain. | ||
# http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
@template | ||
def Library(name): | ||
'''Template for libraries.''' | ||
LIBRARY_NAME = name | ||
|
||
|
||
@template | ||
def RustLibrary(name): | ||
'''Template for Rust libraries.''' | ||
Library(name) | ||
|
||
IS_RUST_LIBRARY = True | ||
|
||
Library('test') | ||
|
||
DIRS += [ | ||
'rust1', | ||
'rust2', | ||
] | ||
|
||
USE_LIBS += [ | ||
'rust1', | ||
'rust2', | ||
] |
15 changes: 15 additions & 0 deletions
15
python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/Cargo.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "rust1" | ||
version = "0.1.0" | ||
authors = [ | ||
"Nobody <nobody@mozilla.org>", | ||
] | ||
|
||
[lib] | ||
crate-type = ["staticlib"] | ||
|
||
[profile.dev] | ||
panic = "abort" | ||
|
||
[profile.release] | ||
panic = "abort" |
4 changes: 4 additions & 0 deletions
4
python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust1/moz.build
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Any copyright is dedicated to the Public Domain. | ||
# http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
RustLibrary('rust1') |
15 changes: 15 additions & 0 deletions
15
python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/Cargo.toml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "rust2" | ||
version = "0.1.0" | ||
authors = [ | ||
"Nobody <nobody@mozilla.org>", | ||
] | ||
|
||
[lib] | ||
crate-type = ["staticlib"] | ||
|
||
[profile.dev] | ||
panic = "abort" | ||
|
||
[profile.release] | ||
panic = "abort" |
4 changes: 4 additions & 0 deletions
4
python/mozbuild/mozbuild/test/frontend/data/multiple-rust-libraries/rust2/moz.build
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Any copyright is dedicated to the Public Domain. | ||
# http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
RustLibrary('rust2') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ authors = [ | |
] | ||
|
||
[lib] | ||
crate-type = ["rlib"] | ||
crate-type = ["staticlib"] | ||
|
||
[profile.dev] | ||
panic = "abort" | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ authors = [ | |
] | ||
|
||
[lib] | ||
crate-type = ["rlib"] | ||
crate-type = ["staticlib"] | ||
|
||
[profile.release] | ||
panic = "abort" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ authors = [ | |
] | ||
|
||
[lib] | ||
crate-type = ["rlib"] | ||
crate-type = ["staticlib"] | ||
|
||
[profile.dev] | ||
panic = "unwind" | ||
|
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
Oops, something went wrong.