summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus T. Aehlig <aehlig@linta.de>2024-06-27 16:34:42 +0200
committerKlaus T. Aehlig <aehlig@linta.de>2024-06-27 16:46:40 +0200
commit3c54e850a32e4250c36bee3f118df977c3e8773d (patch)
tree8997065bb29dcdd09fbe8f131680f2377c063e70
parent866e07a8baa21707ec73109b6e502af4fe4c41bf (diff)
downloadhello-nix-3c54e850a32e4250c36bee3f118df977c3e8773d.tar.gz
Update just-import-cargo, update just dependencies, and clean up
- With the new naming convention of just-import-cargo, there is no longer the conflict on the file etc/defulta/rust/TARGETS. - With the new version of the upstream rust rules, we can use the defaults target directly, as it fully honors TOOLCHAIN_CONFIG[RUST]. - With that simplification in place, we don't have to point just-import-cargo to rules-rust anymore, as for the default-imported rules, the TOOLCHAIN_CONFIG is honored as well.
-rw-r--r--etc/defaults/rust/TARGETS.cargo_import (renamed from etc/defaults/rust/TARGETS)0
-rwxr-xr-xetc/generate-repos.sh7
-rw-r--r--etc/repos.json13
-rw-r--r--etc/repos.template.json8
-rw-r--r--nix-import-tools/import-tools.nix4
-rw-r--r--src/rust/cargo/README.md15
6 files changed, 15 insertions, 32 deletions
diff --git a/etc/defaults/rust/TARGETS b/etc/defaults/rust/TARGETS.cargo_import
index fe4de0a..fe4de0a 100644
--- a/etc/defaults/rust/TARGETS
+++ b/etc/defaults/rust/TARGETS.cargo_import
diff --git a/etc/generate-repos.sh b/etc/generate-repos.sh
index d8cd187..4235fd0 100755
--- a/etc/generate-repos.sh
+++ b/etc/generate-repos.sh
@@ -9,14 +9,13 @@ readonly ROOT=$(readlink -f $(dirname $0)/..)
: ${RULES_RUST_BRANCH:=master}
# remove files generated by just-import-cargo
-rm -rf etc/deps-rust etc/defaults/rust/TARGETS # common to all cargo imports
-rm -f src/rust/cargo/circle/Cargo.lock src/rust/cargo/circle/TARGETS
+rm -rf etc/deps-rust etc/defaults/rust/TARGETS.cargo_import # common to all cargo imports
+rm -f src/rust/cargo/circle/Cargo.lock src/rust/cargo/circle/TARGETS # crate
just-import-git -C ${ROOT}/etc/repos.template.json \
--as rules -b ${RULES_CC_BRANCH} ${RULES_CC_REPO} rules \
| just-import-git -C - \
--as rules-rust -b ${RULES_RUST_BRANCH} ${RULES_RUST_REPO} rules-rust \
- | just-import-cargo --rules rules-rust/nix --repo-root ${ROOT} -rst \
- src/rust/cargo/circle \
+ | just-import-cargo --repo-root ${ROOT} -rst src/rust/cargo/circle \
| just-deduplicate-repos \
| hdump > ${ROOT}/etc/repos.json
diff --git a/etc/repos.json b/etc/repos.json
index 3f419a3..4ac3809 100644
--- a/etc/repos.json
+++ b/etc/repos.json
@@ -1,7 +1,7 @@
{ "repositories":
{ "":
{ "repository": {"type": "file", "path": "src"}
- , "bindings": {"rules": "rules/nix", "rust": "rules-rust/nix"}
+ , "bindings": {"rules": "rules/nix", "rust": "rules-rust"}
}
, "test":
{ "repository": {"type": "file", "path": "test"}
@@ -11,12 +11,6 @@
, "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
, "rules/nix":
{"repository": "rules", "target_root": "defaults", "rule_root": "rules"}
- , "rules-rust/nix":
- { "repository": "rules-rust"
- , "target_root": "defaults"
- , "rule_root": "rules-rust"
- , "target_file_name": "nix.TARGETS"
- }
, "rules/nix-test":
{ "repository": "rules"
, "target_root": "defaults"
@@ -38,7 +32,7 @@
{ "type": "git"
, "repository": "https://github.com/just-buildsystem/rules-rust"
, "branch": "master"
- , "commit": "9a4697a2c948a4bcb4a2232a371b6cb3c178e20b"
+ , "commit": "1a8211bda5c14ef0b2bff3af062c049d5598f02f"
, "subdir": "rules"
}
}
@@ -155,7 +149,8 @@
{ "repository": "rules-rust"
, "target_root": "defaults"
, "rule_root": "rules-rust"
- , "bindings": {"orig-rules": "rules-rust/nix"}
+ , "bindings": {"orig-rules": "rules-rust"}
+ , "target_file_name": "TARGETS.cargo_import"
}
}
}
diff --git a/etc/repos.template.json b/etc/repos.template.json
index 1b898be..33e6acc 100644
--- a/etc/repos.template.json
+++ b/etc/repos.template.json
@@ -1,7 +1,7 @@
{ "repositories":
{ "":
{ "repository": {"type": "file", "path": "src"}
- , "bindings": {"rules": "rules/nix", "rust": "rules-rust/nix"}
+ , "bindings": {"rules": "rules/nix", "rust": "rules-rust"}
}
, "test":
{ "repository": {"type": "file", "path": "test"}
@@ -11,12 +11,6 @@
, "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
, "rules/nix":
{"repository": "rules", "target_root": "defaults", "rule_root": "rules"}
- , "rules-rust/nix":
- { "repository": "rules-rust"
- , "target_root": "defaults"
- , "rule_root": "rules-rust"
- , "target_file_name": "nix.TARGETS"
- }
, "rules/nix-test":
{ "repository": "rules"
, "target_root": "defaults"
diff --git a/nix-import-tools/import-tools.nix b/nix-import-tools/import-tools.nix
index b12023b..3f34f4b 100644
--- a/nix-import-tools/import-tools.nix
+++ b/nix-import-tools/import-tools.nix
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
srcrustrules = fetchFromGitHub {
owner = "just-buildsystem";
repo = "rules-rust";
- rev = "bf3e05a614f1de5a9a8a0f8e40f1dd9e1f6609da";
- sha256 = "sha256-8y10ZmZpeTGtbkIeneaVISyMbVKfIi3gHqyvztnKn0M=";
+ rev = "1a8211bda5c14ef0b2bff3af062c049d5598f02f";
+ sha256 = "sha256-97VbtMp5B/5CtOp9U7J6FNB6omlG/YOfMIBFAsaOyjs=";
};
diff --git a/src/rust/cargo/README.md b/src/rust/cargo/README.md
index 5ac8e27..4e6d59a 100644
--- a/src/rust/cargo/README.md
+++ b/src/rust/cargo/README.md
@@ -19,12 +19,8 @@ on standard input and returns one on standard output. It needs to know
- the root of the pyhsical repository, and
- the location of the crate directory, relative to the root of the physical
repository.
- - the name of the already imported `rules-rust` repository.
-
-While the tool in general can also import `rules-rust` itself, we need to import
-the rules manually first, as we have to provide our own target root for the
-defaults. Future versions of the rules might bring a defaults target suitable
-for our use case, but so far this is not the case.
+ - the name of the already imported `rules-rust` repository, if desired
+ (otherwise it will default to the upstream rust rules).
The name of the imported main repository is the crate name (without version),
as specified in the `Cargo.toml` file. Some care should be taken that is does
@@ -36,10 +32,9 @@ As opposed to other import tools, however, `just-import-cargo` also creates
files in the pysical repository. Those are the following.
- In the crate the file `Cargo.lock` generated by the call to cargo, as
well as a target file,
- - The file `etc/defaults/rust/TARGETS` relative to in the top-level of the
- physical repository (with a content independent of the respective crate).
- This file is the reason that our `rules-rust/nix` use `nix.TARGETS` as
- target-file name.
+ - The file `etc/defaults/rust/TARGETS.cargo_import` relative to
+ in the top-level of the physical repository (with a content
+ independent of the respective crate).
- In the directory `etc/deps-rust` target files for all the imported crates.
As their name encode crate name and version, calling `just-import-cargo`
for several crates should not cause a conflict here.