Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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 pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let
libc_lib = if libc == null then null else getLib libc;
cc_solib = getLib cc;
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
coreutils_bin = if nativeTools then "" else getBin coreutils;
coreutils_bin = if (nativeTools || targetPlatform.isWindows) then "" else getBin coreutils;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still think this one is in error? It means cc-wrapper won't use coreutils, which seems wrong.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. this is right. It should not use coreutils on windows. We don't have them on windows.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But that means you won't use them on Linux when you are making windows binaries. Use hostPlatform to turn it just when compiling on Windows (for any target).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm... I'll try hostPlatform, let's see. My issue was that it tried to buld coreutils for windows when cross compiling windows stuff on linux.


default_cxx_stdlib_compile = optionalString (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc)
"-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)";
Expand Down
1 change: 1 addition & 0 deletions pkgs/tools/misc/coreutils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

assert aclSupport -> acl != null;
assert selinuxSupport -> libselinux != null && libsepol != null;
assert hostPlatform.libc != "msvcrt";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it would make more sense to avoid the assertion and just do platforms = platforms.unix below. Assertions are annoying because there is no way to override them with something like allowUnsupportedPlatform.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fair point.


with lib;

Expand Down