forked from mirrors/gecko-dev
Bug 1888321 - Rename .cargo/config.in to .cargo/config.toml.in. r=firefox-build-system-reviewers,webdriver-reviewers,ahochheiden
Cargo 1.79 is emitting a warning when using .cargo/config. .cargo/config.toml has been supported since cargo 1.39. Differential Revision: https://phabricator.services.mozilla.com/D205974
This commit is contained in:
parent
ff68b67b5e
commit
26df6afc74
12 changed files with 23 additions and 20 deletions
|
|
@ -113,9 +113,9 @@ replace-with = "vendored-sources"
|
||||||
|
|
||||||
# Take advantage of the fact that cargo will treat lines starting with #
|
# Take advantage of the fact that cargo will treat lines starting with #
|
||||||
# as comments to add preprocessing directives. This file can thus by copied
|
# as comments to add preprocessing directives. This file can thus by copied
|
||||||
# as-is to $topsrcdir/.cargo/config with no preprocessing to be used there
|
# as-is to $topsrcdir/.cargo/config.toml with no preprocessing to be used there
|
||||||
# (for e.g. independent tasks building rust code), or be preprocessed by
|
# (for e.g. independent tasks building rust code), or be preprocessed by
|
||||||
# the build system to produce a .cargo/config with the right content.
|
# the build system to produce a .cargo/config.toml with the right content.
|
||||||
#define REPLACE_NAME vendored-sources
|
#define REPLACE_NAME vendored-sources
|
||||||
#define VENDORED_DIRECTORY third_party/rust
|
#define VENDORED_DIRECTORY third_party/rust
|
||||||
# We explicitly exclude the following section when preprocessing because
|
# We explicitly exclude the following section when preprocessing because
|
||||||
|
|
@ -112,5 +112,5 @@ if CONFIG["COMPILE_ENVIRONMENT"] and CONFIG["CBINDGEN"]:
|
||||||
"cbindgen-metadata.json",
|
"cbindgen-metadata.json",
|
||||||
script="/build/RunCbindgen.py",
|
script="/build/RunCbindgen.py",
|
||||||
entry_point="generate_metadata",
|
entry_point="generate_metadata",
|
||||||
inputs=["!/.cargo/config"],
|
inputs=["!/.cargo/config.toml"],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -202,15 +202,15 @@ endif
|
||||||
$(addprefix build/unix/stdc++compat/,target host) build/clang-plugin/host: config/export
|
$(addprefix build/unix/stdc++compat/,target host) build/clang-plugin/host: config/export
|
||||||
|
|
||||||
# Rust targets, and export targets that run cbindgen need
|
# Rust targets, and export targets that run cbindgen need
|
||||||
# $topobjdir/.cargo/config to be preprocessed first. Ideally, we'd only set it
|
# $topobjdir/.cargo/config.toml to be preprocessed first. Ideally, we'd only set it
|
||||||
# as a dependency of the rust targets, but unfortunately, that pushes Make to
|
# as a dependency of the rust targets, but unfortunately, that pushes Make to
|
||||||
# execute them much later than we'd like them to be when the file doesn't exist
|
# execute them much later than we'd like them to be when the file doesn't exist
|
||||||
# prior to Make running. So we also set it as a dependency of pre-export, which
|
# prior to Make running. So we also set it as a dependency of pre-export, which
|
||||||
# ensures it exists before recursing the rust targets and the export targets
|
# ensures it exists before recursing the rust targets and the export targets
|
||||||
# that run cbindgen, tricking Make into keeping them early.
|
# that run cbindgen, tricking Make into keeping them early.
|
||||||
$(rust_targets): $(DEPTH)/.cargo/config
|
$(rust_targets): $(DEPTH)/.cargo/config.toml
|
||||||
ifndef TEST_MOZBUILD
|
ifndef TEST_MOZBUILD
|
||||||
recurse_pre-export: $(DEPTH)/.cargo/config
|
recurse_pre-export: $(DEPTH)/.cargo/config.toml
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ rsync_filter_list = """
|
||||||
+ /config/**
|
+ /config/**
|
||||||
+ /python/**
|
+ /python/**
|
||||||
|
|
||||||
+ /.cargo/config.in
|
+ /.cargo/config.toml.in
|
||||||
|
|
||||||
+ /third_party/function2/**
|
+ /third_party/function2/**
|
||||||
- /third_party/python/gyp
|
- /third_party/python/gyp
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,9 @@ if CONFIG["MOZ_BUILD_APP"]:
|
||||||
else:
|
else:
|
||||||
include("/toolkit/toolkit.mozbuild")
|
include("/toolkit/toolkit.mozbuild")
|
||||||
|
|
||||||
OBJDIR_PP_FILES[".cargo"] += [CONFIG["MOZ_OVERRIDE_CARGO_CONFIG"] or ".cargo/config.in"]
|
OBJDIR_PP_FILES[".cargo"] += [
|
||||||
|
CONFIG["MOZ_OVERRIDE_CARGO_CONFIG"] or ".cargo/config.toml.in"
|
||||||
|
]
|
||||||
|
|
||||||
DEFINES["top_srcdir"] = TOPSRCDIR
|
DEFINES["top_srcdir"] = TOPSRCDIR
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -390,11 +390,12 @@ def cargo_vet(command_context, arguments, stdout=None, env=os.environ):
|
||||||
|
|
||||||
locked = "--locked" in arguments
|
locked = "--locked" in arguments
|
||||||
if locked:
|
if locked:
|
||||||
# The use of --locked requires .cargo/config to exist, but other things,
|
# The use of --locked requires .cargo/config.toml to exist, but other things,
|
||||||
# like cargo update, don't want it there, so remove it once we're done.
|
# like cargo update, don't want it there, so remove it once we're done.
|
||||||
topsrcdir = Path(command_context.topsrcdir)
|
topsrcdir = Path(command_context.topsrcdir)
|
||||||
shutil.copyfile(
|
shutil.copyfile(
|
||||||
topsrcdir / ".cargo" / "config.in", topsrcdir / ".cargo" / "config"
|
topsrcdir / ".cargo" / "config.toml.in",
|
||||||
|
topsrcdir / ".cargo" / "config.toml",
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -406,7 +407,7 @@ def cargo_vet(command_context, arguments, stdout=None, env=os.environ):
|
||||||
)
|
)
|
||||||
finally:
|
finally:
|
||||||
if locked:
|
if locked:
|
||||||
(topsrcdir / ".cargo" / "config").unlink()
|
(topsrcdir / ".cargo" / "config.toml").unlink()
|
||||||
|
|
||||||
# When the function is invoked without stdout set (the default when running
|
# When the function is invoked without stdout set (the default when running
|
||||||
# as a mach subcommand), exit with the returncode from cargo vet.
|
# as a mach subcommand), exit with the returncode from cargo vet.
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,9 @@ CARGO_CONFIG_TEMPLATE = """\
|
||||||
|
|
||||||
# Take advantage of the fact that cargo will treat lines starting with #
|
# Take advantage of the fact that cargo will treat lines starting with #
|
||||||
# as comments to add preprocessing directives. This file can thus by copied
|
# as comments to add preprocessing directives. This file can thus by copied
|
||||||
# as-is to $topsrcdir/.cargo/config with no preprocessing to be used there
|
# as-is to $topsrcdir/.cargo/config.toml with no preprocessing to be used there
|
||||||
# (for e.g. independent tasks building rust code), or be preprocessed by
|
# (for e.g. independent tasks building rust code), or be preprocessed by
|
||||||
# the build system to produce a .cargo/config with the right content.
|
# the build system to produce a .cargo/config.toml with the right content.
|
||||||
#define REPLACE_NAME {replace_name}
|
#define REPLACE_NAME {replace_name}
|
||||||
#define VENDORED_DIRECTORY {directory}
|
#define VENDORED_DIRECTORY {directory}
|
||||||
# We explicitly exclude the following section when preprocessing because
|
# We explicitly exclude the following section when preprocessing because
|
||||||
|
|
@ -847,7 +847,7 @@ license file's hash.
|
||||||
output = res.stdout.decode("UTF-8")
|
output = res.stdout.decode("UTF-8")
|
||||||
|
|
||||||
# Get the snippet of configuration that cargo vendor outputs, and
|
# Get the snippet of configuration that cargo vendor outputs, and
|
||||||
# update .cargo/config with it.
|
# update .cargo/config.toml with it.
|
||||||
# XXX(bug 1576765): Hopefully do something better after
|
# XXX(bug 1576765): Hopefully do something better after
|
||||||
# https://github.com/rust-lang/cargo/issues/7280 is addressed.
|
# https://github.com/rust-lang/cargo/issues/7280 is addressed.
|
||||||
config = "\n".join(
|
config = "\n".join(
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export PATH="$MOZ_FETCHES_DIR/rustc/bin:$PATH"
|
||||||
|
|
||||||
cd $GECKO_PATH/testing/geckodriver
|
cd $GECKO_PATH/testing/geckodriver
|
||||||
|
|
||||||
cp $GECKO_PATH/.cargo/config.in $GECKO_PATH/.cargo/config
|
cp $GECKO_PATH/.cargo/config.toml.in $GECKO_PATH/.cargo/config.toml
|
||||||
|
|
||||||
cargo build --frozen --verbose --release --target "$TARGET"
|
cargo build --frozen --verbose --release --target "$TARGET"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ cd $GECKO_PATH
|
||||||
export PATH=$PATH:$MOZ_FETCHES_DIR/rustc/bin:$HOME/.cargo/bin
|
export PATH=$PATH:$MOZ_FETCHES_DIR/rustc/bin:$HOME/.cargo/bin
|
||||||
cd gfx/wr/
|
cd gfx/wr/
|
||||||
mkdir .cargo
|
mkdir .cargo
|
||||||
cargo vendor --locked --sync ./Cargo.toml > .cargo/config
|
cargo vendor --locked --sync ./Cargo.toml > .cargo/config.toml
|
||||||
mkdir wrench-deps
|
mkdir wrench-deps
|
||||||
mv vendor .cargo wrench-deps/
|
mv vendor .cargo wrench-deps/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ cross-compile ARMv7 from a Linux host system is as follows:
|
||||||
% rustup target install armv7-unknown-linux-gnueabihf
|
% rustup target install armv7-unknown-linux-gnueabihf
|
||||||
```
|
```
|
||||||
|
|
||||||
5. Put this in [testing/geckodriver/.cargo/config]:
|
5. Put this in [testing/geckodriver/.cargo/config.toml]:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
[target.armv7-unknown-linux-gnueabihf]
|
[target.armv7-unknown-linux-gnueabihf]
|
||||||
|
|
@ -47,4 +47,4 @@ cross-compile ARMv7 from a Linux host system is as follows:
|
||||||
```
|
```
|
||||||
|
|
||||||
[central]: https://hg.mozilla.org/mozilla-central/
|
[central]: https://hg.mozilla.org/mozilla-central/
|
||||||
[testing/geckodriver/.cargo/config]: https://searchfox.org/mozilla-central/source/testing/geckodriver/.cargo/config
|
[testing/geckodriver/.cargo/config.toml]: https://searchfox.org/mozilla-central/source/testing/geckodriver/.cargo/config.toml
|
||||||
|
|
|
||||||
|
|
@ -83,14 +83,14 @@ ifdef ENABLE_MOZSEARCH_PLUGIN
|
||||||
cd $(topobjdir)/ && cp _build_manifests/install/dist_include '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_INCLUDEMAP_BASENAME).map'
|
cd $(topobjdir)/ && cp _build_manifests/install/dist_include '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_INCLUDEMAP_BASENAME).map'
|
||||||
@echo 'Generating mozsearch scip index...'
|
@echo 'Generating mozsearch scip index...'
|
||||||
$(RM) $(MOZSEARCH_SCIP_INDEX_BASENAME).zip
|
$(RM) $(MOZSEARCH_SCIP_INDEX_BASENAME).zip
|
||||||
cp $(topsrcdir)/.cargo/config.in $(topsrcdir)/.cargo/config
|
cp $(topsrcdir)/.cargo/config.toml.in $(topsrcdir)/.cargo/config.toml
|
||||||
cd $(topsrcdir)/ && \
|
cd $(topsrcdir)/ && \
|
||||||
CARGO=$(MOZ_FETCHES_DIR)/rustc/bin/cargo \
|
CARGO=$(MOZ_FETCHES_DIR)/rustc/bin/cargo \
|
||||||
RUSTC=$(MOZ_FETCHES_DIR)/rustc/bin/rustc \
|
RUSTC=$(MOZ_FETCHES_DIR)/rustc/bin/rustc \
|
||||||
$(MOZ_FETCHES_DIR)/rustc/bin/rust-analyzer scip . && \
|
$(MOZ_FETCHES_DIR)/rustc/bin/rust-analyzer scip . && \
|
||||||
zip -r5D '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_SCIP_INDEX_BASENAME).zip' \
|
zip -r5D '$(ABS_DIST)/$(PKG_PATH)$(MOZSEARCH_SCIP_INDEX_BASENAME).zip' \
|
||||||
index.scip
|
index.scip
|
||||||
rm $(topsrcdir)/.cargo/config
|
rm $(topsrcdir)/.cargo/config.toml
|
||||||
ifeq ($(MOZ_BUILD_APP),mobile/android)
|
ifeq ($(MOZ_BUILD_APP),mobile/android)
|
||||||
@echo 'Generating mozsearch java/kotlin semanticdb tarball...'
|
@echo 'Generating mozsearch java/kotlin semanticdb tarball...'
|
||||||
$(RM) $(MOZSEARCH_JAVA_INDEX_BASENAME).zip
|
$(RM) $(MOZSEARCH_JAVA_INDEX_BASENAME).zip
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue