aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-21 13:52:55 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-21 13:52:55 +0200
commit4a1cd104952ed95c6f3fc9329de3cfd7c65a8931 (patch)
tree377c26b482ea94eb19eb81b9f414ae48f280e255
parent8426d99b0efc0b22a01db0e2e97adb72134ac5bf (diff)
parentaabf5c86c9df1b4e1616a4cf06ee14a6edf2e5e1 (diff)
Merge remote-tracking branch 'origin/master' into flakes
-rw-r--r--configure.ac12
-rw-r--r--doc/manual/command-ref/nix-channel.xml4
-rw-r--r--scripts/install-nix-from-closure.sh5
-rw-r--r--src/libstore/remote-store.cc2
-rw-r--r--src/libstore/remote-store.hh5
-rw-r--r--src/libstore/ssh-store.cc3
6 files changed, 24 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 43e398543..77cd3ad15 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,6 +158,18 @@ AX_BOOST_BASE([1.66], [CXXFLAGS="$BOOST_CPPFLAGS $CXXFLAGS"], [AC_MSG_ERROR([Nix
# ends up with LDFLAGS being empty, so we set it afterwards.
LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
+# On some platforms, new-style atomics need a helper library
+AC_MSG_CHECKING(whether -latomic is needed)
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
+#include <stdint.h>
+uint64_t v;
+int main() {
+ return (int)__atomic_load_n(&v, __ATOMIC_ACQUIRE);
+}]])], GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=no, GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=yes)
+AC_MSG_RESULT($GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC)
+if test "x$GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC" = xyes; then
+ LIBS="-latomic $LIBS"
+fi
# Look for OpenSSL, a required dependency.
PKG_CHECK_MODULES([OPENSSL], [libcrypto], [CXXFLAGS="$OPENSSL_CFLAGS $CXXFLAGS"])
diff --git a/doc/manual/command-ref/nix-channel.xml b/doc/manual/command-ref/nix-channel.xml
index 5a2866e6b..9fea59167 100644
--- a/doc/manual/command-ref/nix-channel.xml
+++ b/doc/manual/command-ref/nix-channel.xml
@@ -111,13 +111,13 @@ $ nix-env -iA nixpkgs.hello</screen>
<para>You can revert channel updates using <option>--rollback</option>:</para>
<screen>
-$ nix-instantiate --eval -E '(import &lt;nixpkgs> {}).lib.nixpkgsVersion'
+$ nix-instantiate --eval -E '(import &lt;nixpkgs> {}).lib.version'
"14.04.527.0e935f1"
$ nix-channel --rollback
switching from generation 483 to 482
-$ nix-instantiate --eval -E '(import &lt;nixpkgs> {}).lib.nixpkgsVersion'
+$ nix-instantiate --eval -E '(import &lt;nixpkgs> {}).lib.version'
"14.04.526.dbadfad"
</screen>
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh
index 35926f3da..3f1581854 100644
--- a/scripts/install-nix-from-closure.sh
+++ b/scripts/install-nix-from-closure.sh
@@ -141,11 +141,9 @@ if [ -z "$_NIX_INSTALLER_TEST" ]; then
fi
added=
+p=$HOME/.nix-profile/etc/profile.d/nix.sh
if [ -z "$NIX_INSTALLER_NO_MODIFY_PROFILE" ]; then
-
# Make the shell source nix.sh during login.
- p=$HOME/.nix-profile/etc/profile.d/nix.sh
-
for i in .bash_profile .bash_login .profile; do
fn="$HOME/$i"
if [ -w "$fn" ]; then
@@ -157,7 +155,6 @@ if [ -z "$NIX_INSTALLER_NO_MODIFY_PROFILE" ]; then
break
fi
done
-
fi
if [ -z "$added" ]; then
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index b7f202a6b..f34369d8f 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -151,7 +151,7 @@ void RemoteStore::initConnection(Connection & conn)
conn.to << PROTOCOL_VERSION;
if (GET_PROTOCOL_MINOR(conn.daemonVersion) >= 14) {
- int cpu = settings.lockCPU ? lockToCurrentCPU() : -1;
+ int cpu = sameMachine() && settings.lockCPU ? lockToCurrentCPU() : -1;
if (cpu != -1)
conn.to << 1 << cpu;
else
diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh
index 82fbec092..1f375dd71 100644
--- a/src/libstore/remote-store.hh
+++ b/src/libstore/remote-store.hh
@@ -29,6 +29,8 @@ public:
const Setting<unsigned int> maxConnectionAge{(Store*) this, std::numeric_limits<unsigned int>::max(),
"max-connection-age", "number of seconds to reuse a connection"};
+ virtual bool sameMachine() = 0;
+
RemoteStore(const Params & params);
/* Implementations of abstract store API methods. */
@@ -146,6 +148,9 @@ public:
std::string getUri() override;
+ bool sameMachine()
+ { return true; }
+
private:
ref<RemoteStore::Connection> openConnection() override;
diff --git a/src/libstore/ssh-store.cc b/src/libstore/ssh-store.cc
index 39205ae2c..93e117389 100644
--- a/src/libstore/ssh-store.cc
+++ b/src/libstore/ssh-store.cc
@@ -35,6 +35,9 @@ public:
return uriScheme + host;
}
+ bool sameMachine()
+ { return false; }
+
void narFromPath(const Path & path, Sink & sink) override;
ref<FSAccessor> getFSAccessor() override;