我正在使用nix-shell调试我的包。配置脚本如下所示:
configurePhase = ''
mkdir -p $out
...
'';通过nix-build运行时,这段代码是可以的,但是在使用nix-shell运行时,我不能在运行configurePhase时创建$out目录。
mkdir: cannot create directory '/nix/store/...': Read-only file system我明白为什么会发生这种事,但怎么解决呢?
发布于 2015-07-25 14:04:14
这是因为$out指向以只读方式挂载的/nix/store/...。
作为埃尔科·多尔斯特拉,有两种方法可以解决这个问题:
configurePhase中创建configurePhase,而是在installPhase中创建它。$out设置为不同的值。可以将$out变量设置为
nix-shell --command "export out=/tmp/foo; return"https://stackoverflow.com/questions/31559303
复制相似问题