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<()> {
4343 let target_mount = os_string ! ( & target_parent_dir, ":" , & target_prefix) ;
4444 let docker_sock = os_string ! ( DOCKER_SOCKET , ":" , DOCKER_SOCKET ) ;
4545
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+
4655 Command :: new ( "docker" )
4756 . arg ( "run" )
4857 . arg ( "-v" )
@@ -51,6 +60,7 @@ fn execute(test: &str) -> anyhow::Result<()> {
5160 . arg ( target_mount)
5261 . arg ( "-v" )
5362 . arg ( docker_sock)
63+ . args ( nixos_args)
5464 . arg ( "-w" )
5565 . arg ( container_prefix)
5666 . arg ( "-e" )
You can’t perform that action at this time.
0 commit comments