Skip to content
Snippets Groups Projects
Commit e254cc07 authored by Ted Mielczarek's avatar Ted Mielczarek
Browse files

bug 1298422 - vendor byteorder into third-party/rust. r=froydnj

MozReview-Commit-ID: ChKCKiIVEfq

--HG--
extra : rebase_source : c0da7411a2f0b7fc171c9ebb99fce91361944aa5
parent 919372cf
No related branches found
No related tags found
No related merge requests found
Showing
with 13 additions and 280 deletions
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = '@top_srcdir@/third_party/rust'
......@@ -92,6 +92,10 @@ case $cmd in
# copy build and config directory.
cp -pPR ${TOPSRCDIR}/build ${TOPSRCDIR}/config ${tgtpath}
# copy cargo config
${MKDIR} -p ${tgtpath}/.cargo
cp -pPR ${TOPSRCDIR}/.cargo/config.in ${tgtpath}/.cargo
# put in js itself
cp -pPR ${TOPSRCDIR}/mfbt ${tgtpath}
cp -p ${SRCDIR}/../moz.configure ${tgtpath}/js
......
......@@ -18,7 +18,7 @@ exclude = [
]
[dependencies]
byteorder = { version = "0.5.0", path = "../byteorder" }
byteorder = "0.5.0"
[dev-dependencies]
test-assembler = "0.1.2"
......
......@@ -84,4 +84,6 @@ if not CONFIG['JS_STANDALONE'] and CONFIG['MOZ_BUILD_APP']:
# Bring in the configuration for the configured application.
include('/' + CONFIG['MOZ_BUILD_APP'] + '/app.mozbuild')
CONFIGURE_SUBST_FILES += ['.cargo/config']
include('build/templates.mozbuild')
......@@ -408,55 +408,6 @@ class TreeMetadataEmitter(LoggingMixin):
'%s %s of crate %s refers to a non-existent path' % (description, dep_crate_name, crate_name),
context)
def _verify_local_paths(self, context, crate_dir, config):
"""Verify that a Cargo.toml config specifies local paths for all its dependencies."""
crate_name = config['package']['name']
# This is not exactly how cargo works (cargo would permit
# identically-named packages with different versions in the same
# library), but we want to try and avoid using multiple
# different versions of a single package for code size reasons.
if crate_name not in self._crate_directories:
self._crate_directories[crate_name] = crate_dir
else:
previous_dir = self._crate_directories[crate_name]
if crate_dir != previous_dir:
raise SandboxValidationError(
'Crate %s found at multiple paths: %s, %s' % (crate_name, crate_dir, previous_dir),
context)
# This check should ideally be positioned when we're recursing through
# dependencies, but then we would never get the chance to run the
# duplicated names check above.
if crate_name in self._crate_verified_local:
return
crate_deps = config.get('dependencies', {})
if crate_deps:
self._verify_deps(context, crate_dir, crate_name, crate_deps)
has_custom_build = 'build' in config['package']
build_deps = config.get('build-dependencies', {})
if has_custom_build and build_deps:
self._verify_deps(context, crate_dir, crate_name, build_deps,
description='Build dependency')
# We have now verified that all the declared dependencies of
# this crate have local paths. Now verify recursively.
self._crate_verified_local.add(crate_name)
if crate_deps:
for dep_crate_name, values in crate_deps.iteritems():
rel_dep_dir = mozpath.normpath(mozpath.join(crate_dir, values['path']))
dep_toml = mozpath.join(context.config.topsrcdir, rel_dep_dir, 'Cargo.toml')
self._verify_local_paths(context, rel_dep_dir, self._parse_cargo_file(dep_toml))
if has_custom_build and build_deps:
for dep_crate_name, values in build_deps.iteritems():
rel_dep_dir = mozpath.normpath(mozpath.join(crate_dir, values['path']))
dep_toml = mozpath.join(context.config.topsrcdir, rel_dep_dir, 'Cargo.toml')
self._verify_local_paths(context, rel_dep_dir, self._parse_cargo_file(dep_toml))
def _rust_library(self, context, libname, static_args):
# We need to note any Rust library for linking purposes.
cargo_file = mozpath.join(context.srcdir, 'Cargo.toml')
......@@ -490,7 +441,6 @@ class TreeMetadataEmitter(LoggingMixin):
'crate-type %s is not permitted for %s' % (crate_type, libname),
context)
self._verify_local_paths(context, context.relsrcdir, config)
return RustLibrary(context, libname, cargo_file, crate_type, **static_args)
......
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
build = "build.rs"
[lib]
crate-type = ["staticlib"]
[build-dependencies]
bogus = { version = "0.1.0", path = "/path/to/somewhere" }
# 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
RustLibrary('random-crate')
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
build = "build.rs"
[lib]
crate-type = ["staticlib"]
[build-dependencies]
bogus = { version = "0.1.0", path = "../bogus" }
# 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
RustLibrary('random-crate')
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
[lib]
crate-type = ["staticlib"]
[dependencies]
ok = { version = "0.1.0", path = "ok" }
# 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
RustLibrary('random-crate')
[package]
name = "ok"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
build = "build.rs"
[build-dependencies]
bogus = { version = "0.1.0" }
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
build = "build.rs"
[lib]
crate-type = ["staticlib"]
[build-dependencies]
bogus = "0.1.0"
# 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
RustLibrary('random-crate')
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
build = "build.rs"
[lib]
crate-type = ["staticlib"]
[build-dependencies]
bogus = { version = "0.1.0" }
# 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
RustLibrary('random-crate')
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
[lib]
crate-type = ["staticlib"]
[dependencies]
bogus = { version = "0.1.0", path = "/path/to/somewhere" }
# 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
RustLibrary('random-crate')
[package]
name = "random-crate"
version = "0.1.0"
authors = [
"Nobody <nobody@mozilla.org>",
]
[lib]
crate-type = ["staticlib"]
[dependencies]
bogus = { version = "0.1.0", path = "../bogus" }
# 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
RustLibrary('random-crate')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment