lix/src/libutil
Tuomas Tynkkynen 2cd468874f Include config.h implicitly with '-include config.h' in CFLAGS
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!
2017-02-08 21:51:02 +02:00
..
affinity.cc printMsg(lvlError, ...) -> printError(...) etc. 2016-09-21 16:54:53 +02:00
affinity.hh Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
archive.cc Include config.h implicitly with '-include config.h' in CFLAGS 2017-02-08 21:51:02 +02:00
archive.hh Add NAR / Store accessor abstraction 2016-02-25 17:43:19 +01:00
args.cc Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
args.hh Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
compression.cc Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
compression.hh Do compression in a sink 2016-05-04 16:16:53 +02:00
finally.hh Add missing #include 2016-11-07 14:35:47 +01:00
hash.cc Include config.h implicitly with '-include config.h' in CFLAGS 2017-02-08 21:51:02 +02:00
hash.hh Cache path info lookups in SQLite 2016-04-20 14:12:38 +02:00
json.cc toJSON(): Support some more types 2016-10-06 17:00:52 +02:00
json.hh toJSON(): Support some more types 2016-10-06 17:00:52 +02:00
local.mk use $(LIBLZMA_LIBS) instead of -llzma 2016-05-31 03:20:11 -04:00
logging.cc printMsg(lvlError, ...) -> printError(...) etc. 2016-09-21 16:54:53 +02:00
logging.hh Use a steady clock for timeouts 2016-12-06 21:58:04 +01:00
lru-cache.hh Move path info caching from BinaryCacheStore to Store 2016-04-19 18:52:53 +02:00
monitor-fd.hh Fix interrupt handling 2017-01-26 20:40:33 +01:00
pool.hh Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
ref.hh Allow setting the state directory as a store parameter 2016-06-02 16:02:48 +02:00
serialise.cc AutoDeleteArray -> std::unique_ptr 2017-01-16 22:24:49 +01:00
serialise.hh Move SavingSourceAdapter to serialise.hh 2017-02-07 19:29:20 +01:00
sync.hh Add some functions needed by hydra 2016-10-12 15:49:37 +02:00
thread-pool.cc printMsg(lvlError, ...) -> printError(...) etc. 2016-09-21 16:54:53 +02:00
thread-pool.hh Fix assertion failure in ThreadPool::enqueue() 2016-07-21 18:14:16 +02:00
types.hh Include config.h implicitly with '-include config.h' in CFLAGS 2017-02-08 21:51:02 +02:00
util.cc Include config.h implicitly with '-include config.h' in CFLAGS 2017-02-08 21:51:02 +02:00
util.hh Restore default signal handling in child processes 2017-02-01 13:00:21 +01:00
xml-writer.cc OCD: foreach -> C++11 ranged for 2015-07-17 20:13:56 +02:00
xml-writer.hh And another one 2014-02-26 18:55:18 +01:00