diff options
author | Alain Zscheile <fogti+devel@ytrizja.de> | 2023-07-02T16·43+0200 |
---|---|---|
committer | lukegb <lukegb@tvl.fyi> | 2023-07-07T20·06+0000 |
commit | 56c776d9e9175e135ed2cb7043685fc193be5662 (patch) | |
tree | 3319a185127cf87ebe4ddb2d7dde80da23f0f066 /users/fogti/store-ref-scanner/default.nix | |
parent | e751372f2f2ffbb1d32e9729e3c83c2c12c29ea3 (diff) |
fix(users): rename zseri -> fogti r/6396
in accordnace with similar renaming on other sites (e.g. GitHub, Exozyme, chaos.social) My experience with exozyme tells me that fully applying this change might require manual editing of gerrits database anyways to fix broken references/patch ownerships. Change-Id: I024ff264c09b25d8f854c489d93458d1fce7e9f4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8919 Autosubmit: lukegb <lukegb@tvl.fyi> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: zseri <zseri.devel@ytrizja.de>
Diffstat (limited to 'users/fogti/store-ref-scanner/default.nix')
-rw-r--r-- | users/fogti/store-ref-scanner/default.nix | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/users/fogti/store-ref-scanner/default.nix b/users/fogti/store-ref-scanner/default.nix new file mode 100644 index 000000000000..38f3fd64ecd7 --- /dev/null +++ b/users/fogti/store-ref-scanner/default.nix @@ -0,0 +1,49 @@ +{ depot, lib, pkgs, ... }: + +let + sourceFilter = name: type: + let + baseName = builtins.baseNameOf (builtins.toString name); + in + (baseName == "Cargo.toml") + || (type == "directory" && baseName == "src") + || (lib.hasSuffix ".rs" baseName) + ; +in + +pkgs.buildRustCrate rec { + pname = "store-ref-scanner"; + crateName = "store-ref-scanner"; + version = "0.1.0"; + edition = "2021"; + src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; }; + + passthru.tests = pkgs.buildRustCrate { + pname = "store-ref-scanner-tests"; + inherit crateName src version edition; + buildTests = true; + postInstall = '' + set -ex + export RUST_BACKTRACE=1 + # recreate a file hierarchy as when running tests with cargo + # the source for test data + # build outputs + testRoot=target/debug + mkdir -p $testRoot + chmod +w -R . + # test harness executables are suffixed with a hash, + # like cargo does this allows to prevent name collision + # with the main executables of the crate + hash=$(basename $out) + ls -lasR $out + for file in $out/tests/*; do + f=$testRoot/$(basename $file)-$hash + cp $file $f + $f 2>&1 | tee -a $out/tests.log + done + rm -rf $out/tests + set +ex + ''; + }; + +} |