In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper
this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
to avoid build error due to conflicting declaration:
flow/Profiler.actor.cpp: In function 'uint64_t gettid()':
flow/Profiler.actor.cpp:56:17: error: ambiguating new declaration of 'uint64_t gettid()'
FILE* f;
^
In file included from /nix/store/4wy9j24psf9ny4di3anjs7yk2fvfb0gq-glibc-2.31-dev/include/unistd.h:1170:0,
from ./flow/Platform.h:49,
from ./flow/flow.h:40,
from flow/Profiler.actor.cpp:39:
/nix/store/4wy9j24psf9ny4di3anjs7yk2fvfb0gq-glibc-2.31-dev/include/bits/unistd_ext.h:34:16: note: old declaration '__pid_t gettid()'
extern __pid_t gettid (void) __THROW;
^~~~~~
Since glibc 2.28, `<sys/types.h>` no longer includes
`<sys/sysmacros.h>`, which provides these macros,
so we have to explicitly import the latter, too, to fix the following
build problems:
flow/Platform.cpp: In function 'void getDiskStatistics(const string&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint64_t&)':
flow/Platform.cpp:626:56: error: 'gnu_dev_major' was not declared in this scope
if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) {
^
flow/Platform.cpp:626:111: error: 'gnu_dev_minor' was not declared in this scope
if(majorId == (unsigned int) gnu_dev_major(buf.st_dev) && minorId == (unsigned int) gnu_dev_minor(buf.st_dev)) {
^
These options should be experimental, and I'm keeping them off for now.
This also avoids any ABI concerns between libraries, too.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
This bumps the 6.1.x branch to the official 6.1.8 release. Also fixes a
minor bug in the new CMake build (an invalid parameter passed to CMake)
Signed-off-by: Austin Seipp <aseipp@pobox.com>
This adds a new build of FoundationDB 6.1, using the new, much improved
with CMake build system with fewer patches and rough edges.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
FoundationDB is currently in the process of migrating to CMake, and it
will eventually be the only build system. In preparation for this, split
off the current (somewhat nasty) builder into its own file, and allow
default.nix to be more declarative -- containing only the main supported
versions.
Similarly, a cmake.nix file will be added later.
There is no functional change here (NFC), only an organizational change
(file moves, no hash changes).
Signed-off-by: Austin Seipp <aseipp@pobox.com>