* Support for doing builds in a chroot under Linux. The builder is
executed in a chroot that contains just the Nix store, the temporary build directory, and a configurable set of additional directories (/dev and /proc by default). This allows a bit more purity enforcement: hidden build-time dependencies on directories such as /usr or /nix/var/nix/profiles are no longer possible. As an added benefit, accidental network downloads (cf. NIXPKGS-52) are prevented as well (because files such as /etc/resolv.conf are not available in the chroot). However the usefulness of chroots is diminished by the fact that many builders depend on /bin/sh, so you need /bin in the list of additional directories. (And then on non-NixOS you need /lib as well...)
This commit is contained in:
		
							parent
							
								
									0b4ed64d29
								
							
						
					
					
						commit
						9397cd30c8
					
				
					 3 changed files with 162 additions and 16 deletions
				
			
		|  | @ -72,8 +72,9 @@ void makePathReadOnly(const Path & path); | |||
| /* Create a temporary directory. */ | ||||
| Path createTempDir(const Path & tmpRoot = ""); | ||||
| 
 | ||||
| /* Create a directory and all its parents, if necessary. */ | ||||
| void createDirs(const Path & path); | ||||
| /* Create a directory and all its parents, if necessary.  Returns the
 | ||||
|    list of created directories, in order of creation. */ | ||||
| Paths createDirs(const Path & path); | ||||
| 
 | ||||
| /* Create a file and write the given text to it.  The file is written
 | ||||
|    in binary mode (i.e., no end-of-line conversions).  The path should | ||||
|  | @ -166,8 +167,9 @@ class AutoDelete | |||
| { | ||||
|     Path path; | ||||
|     bool del; | ||||
|     bool recursive;     | ||||
| public: | ||||
|     AutoDelete(const Path & p); | ||||
|     AutoDelete(const Path & p, bool recursive = true); | ||||
|     ~AutoDelete(); | ||||
|     void cancel(); | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue