Bug 1499196 - Always use the topobjdir to output rust library dependencies. r=ted,firefox-build-system-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D9039
This commit is contained in:
Chris Manchester 2018-10-18 10:40:32 +00:00
Родитель b51590cb83
Коммит 9c0704f0de
5 изменённых файлов: 8 добавлений и 11 удалений

Просмотреть файл

@ -62,7 +62,7 @@ def DisableCompilerWarnings():
COMPILE_FLAGS['WARNINGS_CFLAGS'] = []
@template
def RustLibrary(name, features=None, target_dir=None, output_category=None):
def RustLibrary(name, features=None, output_category=None):
'''Template for Rust libraries.'''
Library(name)
@ -78,9 +78,6 @@ def RustLibrary(name, features=None, target_dir=None, output_category=None):
if features:
RUST_LIBRARY_FEATURES = features
if target_dir:
RUST_LIBRARY_TARGET_DIR = target_dir
if output_category:
RUST_LIBRARY_OUTPUT_CATEGORY = output_category

Просмотреть файл

@ -529,7 +529,7 @@ class TreeMetadataEmitter(LoggingMixin):
'crate-type %s is not permitted for %s' % (crate_type, libname),
context)
cargo_target_dir = context.get('RUST_LIBRARY_TARGET_DIR', '.')
cargo_target_dir = context.config.topobjdir
dependencies = set(config.get('dependencies', {}).iterkeys())

Просмотреть файл

@ -837,7 +837,7 @@ class TestRecursiveMakeBackend(BackendTester):
if not l.startswith('COMPUTED_')]
expected = [
'RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libtest_library.a',
'RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libtest_library.a' % env.topobjdir,
'CARGO_FILE := $(srcdir)/Cargo.toml',
'CARGO_TARGET_DIR := %s' % env.topobjdir,
]
@ -854,7 +854,7 @@ class TestRecursiveMakeBackend(BackendTester):
if not l.startswith('COMPUTED_')]
expected = [
'HOST_RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libhostrusttool.a',
'HOST_RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libhostrusttool.a' % env.topobjdir,
'CARGO_FILE := $(srcdir)/Cargo.toml',
'CARGO_TARGET_DIR := %s' % env.topobjdir,
]
@ -871,7 +871,7 @@ class TestRecursiveMakeBackend(BackendTester):
if not l.startswith('COMPUTED_')]
expected = [
'HOST_RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libhostrusttool.a',
'HOST_RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libhostrusttool.a' % env.topobjdir,
'CARGO_FILE := $(srcdir)/Cargo.toml',
'CARGO_TARGET_DIR := %s' % env.topobjdir,
'HOST_RUST_LIBRARY_FEATURES := musthave cantlivewithout',
@ -889,7 +889,7 @@ class TestRecursiveMakeBackend(BackendTester):
if not l.startswith('COMPUTED_')]
expected = [
'RUST_LIBRARY_FILE := ./x86_64-unknown-linux-gnu/release/libfeature_library.a',
'RUST_LIBRARY_FILE := %s/x86_64-unknown-linux-gnu/release/libfeature_library.a' % env.topobjdir,
'CARGO_FILE := $(srcdir)/Cargo.toml',
'CARGO_TARGET_DIR := %s' % env.topobjdir,
'RUST_LIBRARY_FEATURES := musthave cantlivewithout',

Просмотреть файл

@ -6,5 +6,5 @@
include('../../rust/gkrust-features.mozbuild')
RustLibrary('gkrust-gtest', gkrust_features, '../..',
RustLibrary('gkrust-gtest', gkrust_features,
output_category=None if CONFIG['LINK_GTEST_DURING_COMPILE'] else 'gtest')

Просмотреть файл

@ -6,7 +6,7 @@
include('gkrust-features.mozbuild')
RustLibrary('gkrust', gkrust_features, '..')
RustLibrary('gkrust', gkrust_features)
# Target directory doesn't matter a lot here, since we can't share panic=abort
# compilation artifacts with gkrust.