chore(third_party/crate2nix): run tests in /build/source
Cherry-pick of https://github.com/nix-community/crate2nix/pull/328. This should fix rstest runs inside crate2nix-generated derivations. Change-Id: I9d393768f7f764e33c5938bd8fa14bd1bb0b72e1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10650 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI
This commit is contained in:
parent
62b10cac44
commit
850a4bfc7b
3 changed files with 81 additions and 0 deletions
|
|
@ -13541,6 +13541,16 @@ rec {
|
|||
# recreate a file hierarchy as when running tests with cargo
|
||||
|
||||
# the source for test data
|
||||
# It's necessary to locate the source in $NIX_BUILD_TOP/source/
|
||||
# instead of $NIX_BUILD_TOP/
|
||||
# because we compiled those test binaries in the former and not the latter.
|
||||
# So all paths will expect source tree to be there and not in the build top directly.
|
||||
# For example: $NIX_BUILD_TOP := /build in general, if you ask yourself.
|
||||
# TODO(raitobezarius): I believe there could be more edge cases if `crate.sourceRoot`
|
||||
# do exist but it's very hard to reason about them, so let's wait until the first bug report.
|
||||
mkdir -p source/
|
||||
cd source/
|
||||
|
||||
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
|
||||
|
||||
# build outputs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue