Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- uses: actions/checkout@v4
- uses: DeterminateSystems/determinate-nix-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- run: nix build .#packages.${{ inputs.system }}.nix-cli-static --no-link -L
- run: nix build .#packages.${{ inputs.system }}.nix-cli-static .#packages.${{ inputs.system }}.nix-cli-libcxxStdenv-static --no-link -L
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need 2 static builds? What's the difference?

Copy link
Copy Markdown
Member Author

@RossComputerGuy RossComputerGuy May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darwin uses libc++, typically Linux uses libstdc++. FlakeBOM needs libc++ on Darwin.

Comment thread
coderabbitai[bot] marked this conversation as resolved.

test:
if: ${{ inputs.if && inputs.run_tests}}
Expand Down
26 changes: 14 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -461,21 +461,23 @@
supportsCross ? true,
linuxOnly ? false,
}:
lib.optionalAttrs (linuxOnly -> nixpkgsFor.${system}.native.stdenv.hostPlatform.isLinux) (
lib.optionalAttrs (linuxOnly -> nixpkgsFor.${system}.native.stdenv.hostPlatform.isLinux) {
# These attributes go right into `packages.<system>`.
"${pkgName}" = nixpkgsFor.${system}.native.nixComponents2.${pkgName};
"${pkgName}-static" = nixpkgsFor.${system}.native.pkgsStatic.nixComponents2.${pkgName};
}
// flatMapAttrs (lib.genAttrs stdenvs (_: { })) (
stdenvName:
{ }:
{
# These attributes go right into `packages.<system>`.
"${pkgName}" = nixpkgsFor.${system}.native.nixComponents2.${pkgName};
"${pkgName}-static" = nixpkgsFor.${system}.native.pkgsStatic.nixComponents2.${pkgName};
"${pkgName}-${stdenvName}" =
nixpkgsFor.${system}.nativeForStdenv.${stdenvName}.nixComponents2.${pkgName};
}
// lib.optionalAttrs supportsCross {
"${pkgName}-${stdenvName}-static" =
nixpkgsFor.${system}.nativeForStdenv.${stdenvName}.pkgsStatic.nixComponents2.${pkgName};
}
// flatMapAttrs (lib.genAttrs stdenvs (_: { })) (
stdenvName:
{ }:
{
# These attributes go right into `packages.<system>`.
"${pkgName}-${stdenvName}" =
nixpkgsFor.${system}.nativeForStdenv.${stdenvName}.nixComponents2.${pkgName};
}
)
)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
// lib.optionalAttrs supportsCross (
flatMapAttrs (lib.genAttrs crossSystems (_: { })) (
Expand Down
38 changes: 20 additions & 18 deletions packaging/dependencies.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,26 @@ scope: {
# small, run Nix with GC_PRINT_STATS=1 and look for messages
# such as `Mark stack overflow`, `No room to copy back mark
# stack`, and `Grew mark stack to ... frames`.
NIX_CFLAGS_COMPILE = [
"-DINITIAL_MARK_STACK_SIZE=1048576"
]
# For some reason that is not clear, it is wanting to use libgcc_eh which is not available.
# Force this to be built with compiler-rt & libunwind over libgcc_eh works.
# Issue: https://github.com/NixOS/nixpkgs/issues/177129
++
lib.optionals
(
stdenv.cc.isClang
&& stdenv.hostPlatform.isStatic
&& stdenv.cc.libcxx != null
&& stdenv.cc.libcxx.isLLVM
)
[
"-rtlib=compiler-rt"
"-unwindlib=libunwind"
];
NIX_CFLAGS_COMPILE = builtins.toString (
[
"-DINITIAL_MARK_STACK_SIZE=1048576"
]
# For some reason that is not clear, it is wanting to use libgcc_eh which is not available.
# Force this to be built with compiler-rt & libunwind over libgcc_eh works.
# Issue: https://github.com/NixOS/nixpkgs/issues/177129
++
lib.optionals
(
stdenv.cc.isClang
&& stdenv.hostPlatform.isStatic
&& stdenv.cc.libcxx != null
&& stdenv.cc.libcxx.isLLVM
)
[
"-rtlib=compiler-rt"
"-unwindlib=libunwind"
]
);

buildInputs =
(attrs.buildInputs or [ ])
Expand Down
4 changes: 4 additions & 0 deletions src/libutil/unix/file-descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#include <unistd.h>
#include <span>

#if defined(__linux__) || defined(__FreeBSD__)
# include <sys/syscall.h>
#endif

#include "util-config-private.hh"
#include "util-unix-config-private.hh"

Expand Down
Loading