File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ fn execute(test: &str) -> anyhow::Result<()> {
43
43
let target_mount = os_string ! ( & target_parent_dir, ":" , & target_prefix) ;
44
44
let docker_sock = os_string ! ( DOCKER_SOCKET , ":" , DOCKER_SOCKET ) ;
45
45
46
+ // NixOS's linkage model is different compared to any other Linux distribution, as it stores
47
+ // all of the shared libraries it links to in /nix. Mounting that directory inside the
48
+ // container allows the test binary to be executed inside of the container.
49
+ let nixos_args: & [ & str ] = if std:: fs:: exists ( "/nix" ) ? {
50
+ & [ "-v" , "/nix:/nix:ro" ]
51
+ } else {
52
+ & [ ]
53
+ } ;
54
+
46
55
Command :: new ( "docker" )
47
56
. arg ( "run" )
48
57
. arg ( "-v" )
@@ -51,6 +60,7 @@ fn execute(test: &str) -> anyhow::Result<()> {
51
60
. arg ( target_mount)
52
61
. arg ( "-v" )
53
62
. arg ( docker_sock)
63
+ . args ( nixos_args)
54
64
. arg ( "-w" )
55
65
. arg ( container_prefix)
56
66
. arg ( "-e" )
You can’t perform that action at this time.
0 commit comments