Skip to content

Commit e02d50d

Browse files
refactor(tests): keep the tmachine crate at tests/tmachine
Put the crate back at tests/tmachine/, next to the Ansible and Nix config it uses, instead of in a subdirectory. Build tmachine from a fileset of Cargo.toml, Cargo.lock, and src/ so edits to that config do not rebuild the binary. Signed-off-by: Matthew Grossman <[email protected]>
1 parent d545087 commit e02d50d

15 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎tests/tmachine/config.nix‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let
1515
images = import ./images.nix {
1616
inherit pkgs qemuPkgs firmwarePkgs;
1717
};
18-
tmachine = pkgs.callPackage ./orchestrator {
18+
tmachine = pkgs.callPackage ./. {
1919
OVMF = firmwarePkgs.OVMF;
2020
};
2121
qemu = qemuPkgs.qemu.override { hostCpuOnly = true; };
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ rustPlatform.buildRustPackage {
1212
pname = "tmachine";
1313
version = "0.1.0";
1414

15-
src = lib.cleanSource ./.;
15+
# Only the crate files, so edits to the Ansible and Nix config beside it
16+
# do not rebuild tmachine.
17+
src = lib.fileset.toSource {
18+
root = ./.;
19+
fileset = lib.fileset.unions [
20+
./Cargo.toml
21+
./Cargo.lock
22+
./src
23+
];
24+
};
1625
cargoLock.lockFile = ./Cargo.lock;
1726

1827
env = lib.optionalAttrs stdenv.hostPlatform.isAarch64 {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)