about summary refs log tree commit diff
path: root/src/libstore/globals.cc
AgeCommit message (Collapse)AuthorFilesLines
2018-09-28 Check requiredSystemFeatures for local buildsEelco Dolstra1-0/+15
For example, this prevents a "kvm" build on machines that don't have KVM. Fixes #2012.
2018-05-30 Modularize config settingsEelco Dolstra1-27/+11
Allow global config settings to be defined in multiple Config classes. For example, this means that libutil can have settings and evaluator settings can be moved out of libstore. The Config classes are registered in a new GlobalConfig class to which config files etc. are applied. Relevant to https://github.com/NixOS/nix/issues/2009 in that it removes the need for ad hoc handling of useCaseHack, which was the underlying cause of that issue.
2018-04-11 initPlugins: Fix dlopen error message.Shea Levy1-1/+1
2018-02-19 Merge branch 'register-settings' of https://github.com/shlevy/nixEelco Dolstra1-0/+16
2018-02-15 Set backup MANPATH in case man path isn’t set correctly.Matthew Bauer1-0/+1
Previously, this would fail at startup for non-NixOS installs: nix-env --help The fix for this is to just use "nixManDir" as the value for MANPATH when spawning "man". To test this, I’m using the following: $ nix-build release.nix -A build $ MANPATH= ./result/bin/nix-env --help Fixes #1627
2018-02-13 Allow plugins to define new settings.Shea Levy1-0/+16
2018-02-13 Enable specifying directories in plugin-files.Shea Levy1-6/+18
2018-02-08 Add plugins to make Nix more extensible.Shea Levy1-0/+15
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2017-11-21 Propagate flags like --sandbox to the daemon properlyEelco Dolstra1-3/+3
2017-10-24 nix: Respect -I, --arg, --argstrEelco Dolstra1-3/+3
Also, random cleanup to argument handling.
2017-10-24 Remove the builder-files optionEelco Dolstra1-1/+6
You can now include files via the "builders" option, using the syntax "@<filename>". Having only one option makes it easier to override builders completely. For backward compatibility, the default is "@/etc/nix/machines", or "@<filename>" for each file name in NIX_REMOTE_SYSTEMS.
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-1/+1
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-06-12 Provide a builtin default for $NIX_SSL_CERT_FILEEelco Dolstra1-1/+9
This is mostly to ensure that when Nix is started on macOS via a launchd service or sshd (for a remote build), it gets a certificate bundle.
2017-06-07 Don't show flags from config settings in "nix --help"Eelco Dolstra1-4/+16
2017-06-07 nix: Make all options available as flagsEelco Dolstra1-0/+7
Thus, instead of ‘--option <name> <value>’, you can write ‘--<name> <value>’. So --option http-connections 100 becomes --http-connections 100 Apart from brevity, the difference is that it's not an error to set a non-existent option via --option, but unrecognized arguments are fatal. Boolean options have special treatment: they're mapped to the argument-less flags ‘--<name>’ and ‘--no-<name>’. E.g. --option auto-optimise-store false becomes --no-auto-optimise-store
2017-05-15 Add --with-sandbox-shell configure flagEelco Dolstra1-2/+2
And add a 116 KiB ash shell from busybox to the release build. This helps to make sandbox builds work out of the box on non-NixOS systems and with diverted stores.
2017-05-02 Replace $NIX_REMOTE_SYSTEMS with an option "builder-files"Eelco Dolstra1-0/+4
Also, to unify with hydra-queue-runner, allow it to be a list of files.
2017-04-20 Improve nix show-config --jsonEelco Dolstra1-0/+5
In particular, show descriptions. This could be used for manpage generation etc.
2017-04-20 Setting: Remove "Tag" template argumentEelco Dolstra1-19/+3
2017-04-20 Read per-user settings from ~/.config/nix/nix.confEelco Dolstra1-6/+6
2017-04-13 Convert Settings to the new config systemEelco Dolstra1-278/+39
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Merge branch 'rework-options' of https://github.com/copumpkin/nixEelco Dolstra1-34/+117
2017-03-30 Add exec primop behind allow-unsafe-native-code-during-evaluation.Shea Levy1-2/+2
Execute a given program with the (optional) given arguments as the user running the evaluation, parsing stdout as an expression to be evaluated. There are many use cases for nix that would benefit from being able to run arbitrary code during evaluation, including but not limited to: * Automatic git fetching to get a sha256 from a git revision * git rev-parse HEAD * Automatic extraction of information from build specifications from other tools, particularly language-specific package managers like cabal or npm * Secrets decryption (e.g. with nixops) * Private repository fetching Ideally, we would add this functionality in a more principled way to nix, but in the mean time 'builtins.exec' can be used to get these tasks done. The primop is only available when the 'allow-unsafe-native-code-during-evaluation' nix option is true. That flag also enables the 'importNative' primop, which is strictly more powerful but less convenient (since it requires compiling a plugin against the running version of nix).
2017-03-15 Store: Add a method for getting build logsEelco Dolstra1-1/+0
This allows various Store implementations to provide different ways to get build logs. For example, BinaryCacheStore can get the build logs from the binary cache. Also, remove the log-servers option since we can use substituters for this.
2017-03-08 Add option to disable import-from-derivation completely, even if the drv is ↵Shea Levy1-0/+2
already realized
2017-03-06 Properly set the caFile for aws-sdk-cpp s3Shea Levy1-0/+1
2017-02-28 Support auto-configuration of build-max-jobsEelco Dolstra1-1/+8
"build-max-jobs" and the "-j" option can now be set to "auto" to use the number of CPUs in the system. (Unlike build-cores, it doesn't use 0 to imply auto-configuration, because a) magic values are a bad idea in general; b) 0 is a legitimate value used to disable local building.) Fixes #1198.
2017-02-27 _SC_NPROCESSORS_ONLN -> std::thread::hardware_concurrency()Eelco Dolstra1-7/+3
2017-02-22 Explicitly model all settings and fail on unrecognized onesDan Peebles1-33/+115
Previously, the Settings class allowed other code to query for string properties, which led to a proliferation of code all over the place making up new options without any sort of central registry of valid options. This commit pulls all those options back into the central Settings class and removes the public get() methods, to discourage future abuses like that. Furthermore, because we know the full set of options ahead of time, we now fail loudly if someone enters an unrecognized option, thus preventing subtle typos. With some template fun, we could probably also dump the full set of options (with documentation, defaults, etc.) to the command line, but I'm not doing that yet here.
2017-02-16 Move netrcFile to SettingsEelco Dolstra1-19/+17
Also get rid of Settings::processEnvironment(), it appears to be useless.
2017-02-08 Include config.h implicitly with '-include config.h' in CFLAGSTuomas Tynkkynen1-2/+0
Because config.h can #define things like _FILE_OFFSET_BITS=64 and not every compilation unit includes config.h, we currently compile half of Nix with _FILE_OFFSET_BITS=64 and other half with _FILE_OFFSET_BITS unset. This causes major havoc with the Settings class on e.g. 32-bit ARM, where different compilation units disagree with the struct layout. E.g.: diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc @@ -166,6 +166,8 @@ void Settings::update() _get(useSubstitutes, "build-use-substitutes"); + fprintf(stderr, "at Settings::update(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); _get(buildUsersGroup, "build-users-group"); diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -138,6 +138,8 @@ void RemoteStore::initConnection(Connection & conn) void RemoteStore::setOptions(Connection & conn) { + fprintf(stderr, "at RemoteStore::setOptions(): &useSubstitutes = %p\n", &nix::settings.useSubstitutes); conn.to << wopSetOptions Gave me: at Settings::update(): &useSubstitutes = 0xb6e5c5cb at RemoteStore::setOptions(): &useSubstitutes = 0xb6e5c5c7 That was not a fun one to debug!
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-3/+3
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-3/+3
2016-10-27 Add nix.conf options for -k and -KShea Levy1-0/+2
Fixes #1084
2016-08-13 remove old traces of resolve-system-dependenciesJude Taylor1-1/+1
2016-08-10 Remove $NIX_DB_DIREelco Dolstra1-1/+0
This variable has no reason to exist, given $NIX_STATE_DIR.
2016-04-29 Eliminate the substituter mechanismEelco Dolstra1-13/+0
Substitution is now simply a Store -> Store copy operation, most typically from BinaryCacheStore to LocalStore.
2016-04-25 Show the log tail when a build failsEelco Dolstra1-1/+0
If --no-build-output is given (which will become the default for the "nix" command at least), show the last 10 lines of the build output if the build fails.
2016-04-25 Remove --print-build-traceEelco Dolstra1-1/+0
This was added to support Hydra, but Hydra no longer uses it.
2016-04-11 Remove manifest supportEelco Dolstra1-1/+0
Manifests have been superseded by binary caches for years. This also gets rid of nix-pull, nix-generate-patches and bsdiff/bspatch.
2016-04-08 Remove failed build cachingEelco Dolstra1-2/+0
This feature was implemented for Hydra, but Hydra no longer uses it.
2015-10-21 move preBuildHook defaulting to globals.ccJude Taylor1-0/+5
2015-07-17 OCD: foreach -> C++11 ranged forEelco Dolstra1-8/+8
2015-06-22 Make /nix/var/nix/db/reserved biggerEelco Dolstra1-1/+1
Issue #564.
2015-04-18 Add the pre-build hook.Shea Levy1-0/+1
This hook can be used to set system-specific per-derivation build settings that don't fit into the derivation model and are too complex or volatile to be hard-coded into nix. Currently, the pre-build hook can only add chroot dirs/files through the interface, but it also has full access to the chroot root. The specific use case for this is systems where the operating system ABI is more complex than just the kernel-support system calls. For example, on OS X there is a set of system-provided frameworks that can reliably be accessed by any program linked to them, no matter the version the program is running on. Unfortunately, those frameworks do not necessarily live in the same locations on each version of OS X, nor do their dependencies, and thus nix needs to know the specific version of OS X currently running in order to make those frameworks available. The pre-build hook is a perfect mechanism for doing just that.
2015-04-18 Revert "Add the pre-build hook."Shea Levy1-1/+0
Going to reimplement differently. This reverts commit 1e4a4a2e9fc382f47f58b448f3ee034cdd28218a.
2015-04-16 Fix using restricted mode with chrootsEelco Dolstra1-0/+1
2015-04-12 Add the pre-build hook.Shea Levy1-0/+1
This hook can be used to set system specific per-derivation build settings that don't fit into the derivation model and are too complex or volatile to be hard-coded into nix. Currently, the pre-build hook can only add chroot dirs/files. The specific use case for this is systems where the operating system ABI is more complex than just the kernel-supported system calls. For example, on OS X there is a set of system-provided frameworks that can reliably be accessed by any program linked to them, no matter the version the program is running on. Unfortunately, those frameworks do not necessarily live in the same locations on each version of OS X, nor do their dependencies, and thus nix needs to know the specific version of OS X currently running in order to make those frameworks available. The pre-build hook is a perfect mechanism for doing just that.
2015-04-09 Implement a TTL on cached fetchurl/fetchTarball resultsEelco Dolstra1-0/+8
This is because we don't want to do HTTP requests on every evaluation, even though we can prevent a full redownload via the cached ETag. The default is one hour.
2015-02-23 Use chroots for all derivationsEelco Dolstra1-2/+0
If ‘build-use-chroot’ is set to ‘true’, fixed-output derivations are now also chrooted. However, unlike normal derivations, they don't get a private network namespace, so they can still access the network. Also, the use of the ‘__noChroot’ derivation attribute is no longer allowed. Setting ‘build-use-chroot’ to ‘relaxed’ gives the old behaviour.