Skip to content

Commit c430331

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 8cc0796 + 3560654 commit c430331

File tree

233 files changed

+25680
-6872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+25680
-6872
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
3+
# Filing a Nix issue
4+
5+
*WAIT* Are you sure you're filing your issue in the right repository?
6+
7+
We appreciate you taking the time to tell us about issues you encounter, but routing the issue to the right place will get you help sooner and save everyone time.
8+
9+
This is the Nix repository, and issues here should be about Nix the build and package management *_tool_*.
10+
11+
If you have a problem with a specific package on NixOS or when using Nix, you probably want to file an issue with _nixpkgs_, whose issue tracker is over at https://github.com/NixOS/nixpkgs/issues.
12+
13+
Examples of _Nix_ issues:
14+
15+
- Nix segfaults when I run `nix-build -A blahblah`
16+
- The Nix language needs a new builtin: `builtins.foobar`
17+
- Regression in the behavior of `nix-env` in Nix 2.0
18+
19+
Examples of _nixpkgs_ issues:
20+
21+
- glibc is b0rked on aarch64
22+
- chromium in NixOS doesn't support U2F but google-chrome does!
23+
- The OpenJDK package on macOS is missing a key component
24+
25+
Chances are if you're a newcomer to the Nix world, you'll probably want the [nixpkgs tracker](https://github.com/NixOS/nixpkgs/issues). It also gets a lot more eyeball traffic so you'll probably get a response a lot more quickly.
26+
27+
-->

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ perl/Makefile.config
1313

1414
/corepkgs/config.nix
1515

16-
# /corepkgs/buildenv/
17-
/corepkgs/buildenv/builder.pl
18-
1916
# /corepkgs/channels/
2017
/corepkgs/channels/unpack.sh
2118

@@ -38,6 +35,7 @@ perl/Makefile.config
3835
/scripts/nix-copy-closure
3936
/scripts/nix-reduce-build
4037
/scripts/nix-http-export.cgi
38+
/scripts/nix-profile-daemon.sh
4139

4240
# /src/libexpr/
4341
/src/libexpr/lexer-tab.cc
@@ -71,9 +69,6 @@ perl/Makefile.config
7169
# /src/nix-channel/
7270
/src/nix-channel/nix-channel
7371

74-
# /src/buildenv/
75-
/src/buildenv/buildenv
76-
7772
# /src/nix-build/
7873
/src/nix-build/nix-build
7974

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
makefiles = \
22
local.mk \
3-
src/boost/format/local.mk \
43
src/libutil/local.mk \
54
src/libstore/local.mk \
65
src/libmain/local.mk \
@@ -13,7 +12,6 @@ makefiles = \
1312
src/nix-collect-garbage/local.mk \
1413
src/nix-copy-closure/local.mk \
1514
src/nix-prefetch-url/local.mk \
16-
src/buildenv/local.mk \
1715
src/resolve-system-dependencies/local.mk \
1816
src/nix-channel/local.mk \
1917
src/nix-build/local.mk \
@@ -24,9 +22,10 @@ makefiles = \
2422
misc/launchd/local.mk \
2523
misc/upstart/local.mk \
2624
doc/manual/local.mk \
27-
tests/local.mk
25+
tests/local.mk \
26+
tests/plugins/local.mk
2827

29-
GLOBAL_CXXFLAGS += -std=c++14 -g -Wall -include config.h
28+
GLOBAL_CXXFLAGS += -g -Wall -include config.h
3029

3130
-include Makefile.config
3231

Makefile.config.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,19 @@ CXXFLAGS = @CXXFLAGS@
66
ENABLE_S3 = @ENABLE_S3@
77
HAVE_SODIUM = @HAVE_SODIUM@
88
HAVE_READLINE = @HAVE_READLINE@
9+
HAVE_BROTLI = @HAVE_BROTLI@
10+
HAVE_SECCOMP = @HAVE_SECCOMP@
911
LIBCURL_LIBS = @LIBCURL_LIBS@
1012
OPENSSL_LIBS = @OPENSSL_LIBS@
1113
PACKAGE_NAME = @PACKAGE_NAME@
1214
PACKAGE_VERSION = @PACKAGE_VERSION@
1315
SODIUM_LIBS = @SODIUM_LIBS@
1416
LIBLZMA_LIBS = @LIBLZMA_LIBS@
1517
SQLITE3_LIBS = @SQLITE3_LIBS@
18+
LIBBROTLI_LIBS = @LIBBROTLI_LIBS@
1619
bash = @bash@
1720
bindir = @bindir@
18-
bro = @bro@
21+
brotli = @brotli@
1922
lsof = @lsof@
2023
datadir = @datadir@
2124
datarootdir = @datarootdir@

configure.ac

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ CFLAGS=
6161
CXXFLAGS=
6262
AC_PROG_CC
6363
AC_PROG_CXX
64-
AX_CXX_COMPILE_STDCXX_11
64+
AC_PROG_CPP
65+
AX_CXX_COMPILE_STDCXX_14
6566

6667

6768
# Use 64-bit file system calls so that we can support files > 2 GiB.
@@ -127,7 +128,7 @@ NEED_PROG(gzip, gzip)
127128
NEED_PROG(xz, xz)
128129
AC_PATH_PROG(dot, dot)
129130
AC_PATH_PROG(pv, pv, pv)
130-
AC_PATH_PROG(bro, bro, bro)
131+
AC_PATH_PROGS(brotli, brotli bro, bro)
131132
AC_PATH_PROG(lsof, lsof, lsof)
132133

133134

@@ -174,23 +175,51 @@ AC_SUBST(HAVE_SODIUM, [$have_sodium])
174175

175176
# Look for liblzma, a required dependency.
176177
PKG_CHECK_MODULES([LIBLZMA], [liblzma], [CXXFLAGS="$LIBLZMA_CFLAGS $CXXFLAGS"])
178+
AC_CHECK_LIB([lzma], [lzma_stream_encoder_mt],
179+
[AC_DEFINE([HAVE_LZMA_MT], [1], [xz multithreaded compression support])])
177180

178181

182+
# Look for libbrotli{enc,dec}, optional dependencies
183+
PKG_CHECK_MODULES([LIBBROTLI], [libbrotlienc libbrotlidec],
184+
[AC_DEFINE([HAVE_BROTLI], [1], [Whether to use libbrotli.])
185+
CXXFLAGS="$LIBBROTLI_CFLAGS $CXXFLAGS"]
186+
have_brotli=1], [have_brotli=])
187+
AC_SUBST(HAVE_BROTLI, [$have_brotli])
188+
179189
# Look for libseccomp, required for Linux sandboxing.
180190
if test "$sys_name" = linux; then
181-
PKG_CHECK_MODULES([LIBSECCOMP], [libseccomp],
182-
[CXXFLAGS="$LIBSECCOMP_CFLAGS $CXXFLAGS"])
191+
AC_ARG_ENABLE([seccomp-sandboxing],
192+
AC_HELP_STRING([--disable-seccomp-sandboxing],
193+
[Don't build support for seccomp sandboxing (only recommended if your arch doesn't support libseccomp yet!)]
194+
))
195+
if test "x$enable_seccomp_sandboxing" != "xno"; then
196+
PKG_CHECK_MODULES([LIBSECCOMP], [libseccomp],
197+
[CXXFLAGS="$LIBSECCOMP_CFLAGS $CXXFLAGS"])
198+
have_seccomp=1
199+
AC_DEFINE([HAVE_SECCOMP], [1], [Whether seccomp is available and should be used for sandboxing.])
200+
else
201+
have_seccomp=
202+
fi
203+
else
204+
have_seccomp=
183205
fi
206+
AC_SUBST(HAVE_SECCOMP, [$have_seccomp])
184207

185208

186209
# Look for aws-cpp-sdk-s3.
187210
AC_LANG_PUSH(C++)
188211
AC_CHECK_HEADERS([aws/s3/S3Client.h],
189-
[AC_DEFINE([ENABLE_S3], [1], [Whether to enable S3 support via aws-cpp-sdk-s3.])
212+
[AC_DEFINE([ENABLE_S3], [1], [Whether to enable S3 support via aws-sdk-cpp.])
190213
enable_s3=1], [enable_s3=])
191214
AC_SUBST(ENABLE_S3, [$enable_s3])
192215
AC_LANG_POP(C++)
193216

217+
if test -n "$enable_s3"; then
218+
declare -a aws_version_tokens=($(printf '#include <aws/core/VersionConfig.h>\nAWS_SDK_VERSION_STRING' | $CPP $CPPFLAGS - | grep -v '^#.*' | sed 's/"//g' | tr '.' ' '))
219+
AC_DEFINE_UNQUOTED([AWS_VERSION_MAJOR], ${aws_version_tokens@<:@0@:>@}, [Major version of aws-sdk-cpp.])
220+
AC_DEFINE_UNQUOTED([AWS_VERSION_MINOR], ${aws_version_tokens@<:@1@:>@}, [Minor version of aws-sdk-cpp.])
221+
fi
222+
194223

195224
# Whether to use the Boehm garbage collector.
196225
AC_ARG_ENABLE(gc, AC_HELP_STRING([--enable-gc],

corepkgs/buildenv.nix

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
with import <nix/config.nix>;
2-
31
{ derivations, manifest }:
42

53
derivation {
64
name = "user-environment";
7-
system = builtins.currentSystem;
8-
builder = nixLibexecDir + "/nix/buildenv";
5+
system = "builtin";
6+
builder = "builtin:buildenv";
97

108
inherit manifest;
119

@@ -24,21 +22,4 @@ derivation {
2422

2523
# Also don't bother substituting.
2624
allowSubstitutes = false;
27-
28-
__sandboxProfile = ''
29-
(allow sysctl-read)
30-
(allow file-read*
31-
(literal "/usr/lib/libSystem.dylib")
32-
(literal "/usr/lib/libSystem.B.dylib")
33-
(literal "/usr/lib/libobjc.A.dylib")
34-
(literal "/usr/lib/libobjc.dylib")
35-
(literal "/usr/lib/libauto.dylib")
36-
(literal "/usr/lib/libc++abi.dylib")
37-
(literal "/usr/lib/libc++.1.dylib")
38-
(literal "/usr/lib/libDiagnosticMessagesClient.dylib")
39-
(subpath "/usr/lib/system")
40-
(subpath "/dev"))
41-
'';
42-
43-
inherit chrootDeps;
4425
}

corepkgs/fetchurl.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ system ? builtins.currentSystem
1+
{ system ? "" # obsolete
22
, url
33
, md5 ? "", sha1 ? "", sha256 ? "", sha512 ? ""
44
, outputHash ?
@@ -17,7 +17,9 @@ derivation {
1717
inherit outputHashAlgo outputHash;
1818
outputHashMode = if unpack || executable then "recursive" else "flat";
1919

20-
inherit name system url executable unpack;
20+
inherit name url executable unpack;
21+
22+
system = "builtin";
2123

2224
# No need to double the amount of network traffic
2325
preferLocalBuild = true;

0 commit comments

Comments
 (0)