Commit Graph

114 Commits

Author SHA1 Message Date
Randy Eckenrode
2f2e655427
darwin.cctools: add to darwin-aliases.nix 2024-07-17 22:36:19 -04:00
Randy Eckenrode
a49dbb2544
darwin.stdenv: switch to top-level cctools and ld64 2024-07-13 17:54:36 -04:00
Randy Eckenrode
f635e39514
darwin.moltenvk: use the 12.3 SDK
Additionally, specify a 10.15 deployment target. According to the upstream documentation, 10.15 is the minimum macOS release supported at runtime.
2024-07-12 01:57:08 -04:00
Randy Eckenrode
1542e50e60
darwin.apple_sdk_12_3: init at 12.3 2024-07-12 01:57:08 -04:00
Tristan Ross
7a95a8948b
Merge pull request #324155 from paparodeo/x64-sdk11-no-rebuilds
treewide: change various flags to allow x64 darwin to default to sdk 11.0 when ready
2024-07-08 17:19:17 -07:00
Reno Dakota
3cb23cec23
treewide: fixes to allow x64 darwin to default to sdk 11
update code to not assume that x64 darwin must use sdk 10.12. After this
change it's possible to build a sdk 11 stdenv on darwin x64
2024-07-02 23:30:01 +00:00
Randy Eckenrode
8834c2f569
darwin.binutilsDualAs: use gas output of darwin.cctools 2024-06-27 07:33:47 -04:00
Randy Eckenrode
13db408c44
darwin.binutils: refactor and clean up
Update darwin.binutils based on darwin.cctools-llvm. It works essentially in the same way, simplifying the derivation. The support for providing both assemblers is handled in a separate commit.

Additionally, unlike cctools-llvm, the lists of tools are provided as passthru attributes: `cctools_cmds` and `llvm_cmds`.
2024-06-27 07:33:46 -04:00
zowoq
e5d9b197e9 darwin.openwith: unbreak on x86_64-darwin 2024-05-15 09:08:54 +10:00
Weijia Wang
37251fba47 insert-dylib: rename from darwin.insert_dylib 2024-04-04 04:12:17 +02:00
github-actions[bot]
14abde4e89
Merge master into staging-next 2024-03-27 12:01:28 +00:00
Randy Eckenrode
80186737d0
darwin.builder: move to darwin-aliases 2024-03-26 21:38:49 -04:00
Randy Eckenrode
31dc171e97
darwin: add darwin-aliases.nix 2024-03-26 21:38:49 -04:00
github-actions[bot]
7f8db6f00d
Merge staging-next into staging 2024-03-20 18:01:38 +00:00
Weijia Wang
ea012e17f7 maloader: unstable-2014-02-25 -> 0-unstable-2018-05-02 2024-03-20 09:53:22 +01:00
Weijia Wang
ad87dc75d6 opencflite: 476.19.0 -> 635.21.8 2024-03-18 00:23:38 +01:00
github-actions[bot]
83409a8a66
Merge staging-next into staging 2024-03-17 12:02:22 +00:00
Randy Eckenrode
bf86b51cd2
darwin.moltenvk: clean up derivation
- Drop the patches in favor of patching up the xcodeproj files, which
  should make updates in the future easier (no more patch conflicts);
- Switch to building `MoltenVKPackaging.xcodeproj` instead of building
  the projects individually;
- Link `libMoltenVK.dylib` manually, which is needed for MoltenVK 1.2.8
  due to xcbuild not being able to build the dylib in the xcodeproj;
- Add support for enabling private API usage and default it to `true`.
  This will be a new feature in MoltenVK 1.2.8;
- Use darwin.apple_sdk.libs.simd instead of symlinking from the SDK;
- Filter out rc and beta releases in the update script; and
- Support static builds of MoltenVK.
2024-03-16 21:44:27 -04:00
Randy Eckenrode
0fb285678d
darwin.apple_sdk.darwin-stubs: add SDK-specific stubs
For the 11.0 SDK, base the stubs on the SDK for now.
2024-03-16 19:21:47 -04:00
yihuang
267735f785
doc: fix darwin-builder doc (#291518) 2024-02-28 06:36:13 -08:00
Ovyerus
d25cd80eca
darwin.xcode: add 15 and 15.1 2023-12-22 11:33:20 +11:00
Randy Eckenrode
daa79a1d2d
darwin.stdenv: use CoreFoundation instead of CF
This patch switches the CoreFoundation on x86_64-darwin from the open
source swift-corelibs-foundation (CF) to the system CoreFoundation.

This change was motivated by failures building packages for the current
staging-next cycle #263535 due to an apparent incompatibility with the
rpath-based approach to choosing CF or CoreFoundation and macOS 14. This
error often manifests as a crash with an Illegal Instruction.

For example, building aws-sdk-cpp for building Nix will fail this way.

https://hydra.nixos.org/build/239459417/nixlog/1

    Application Specific Information:
    CF objects must have a non-zero isa

    Error Formulating Crash Report:
    PC register does not match crashing frame (0x0 vs 0x7FF8094DD640)

    Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
    0   CoreFoundation                	    0x7ff8094dd640 CF_IS_OBJC.cold.1 + 14
    1   CoreFoundation                	    0x7ff8094501d0 CF_IS_OBJC + 60
    2   CoreFoundation                	    0x7ff8093155e8 CFRelease + 40
    3   ???                           	       0x10c7a2c61 s_aws_secure_transport_ctx_destroy + 65
    4   ???                           	       0x10c87ba32 aws_ref_count_release + 34
    5   ???                           	       0x10c7b7adb aws_tls_connection_options_clean_up + 27
    6   ???                           	       0x10c596db4 Aws::Crt::Io::TlsConnectionOptions::~TlsConnectionOptions() + 20
    7   ???                           	       0x10c2d249c Aws::CleanupCrt() + 92
    8   ???                           	       0x10c2d1ff0 Aws::ShutdownAPI(Aws::SDKOptions const&) + 64
    9   ???                           	       0x102d9bc6f main + 335
    10  dyld                          	       0x202f333a6 start + 1942

According to a [post][1] on the Apple developer forums, hardening was
added to CoreFoundation, and this particular message occurs when you
attempt to release an object it does not recognize as a valid CF object.
(Thank you to @lilyinstarlight for finding this post).

When I switched aws-sdk-cpp to link against CoreFoundation instead of
CF, the error went away. Somehow both libraries were being used. To
prevent dependent packages from linking the wrong CoreFoundation, it
would need to be added as a propagated build input.

Note that there are other issues related to mixing CF and CoreFoundation
frameworks. #264503 fixes an issue with abseil-cpp where it propagates
CF, causing issues when using a different SDK version. Mixing versions
can also cause crashes with Python when a shared object is loaded that
is linked to the “wrong” CoreFoundation.

`NIX_COREFOUNDATION_RPATH` is supposed to make sure the right
CoreFoundation is being used, but it does not appear to be enough on
macOS 14 (presumably due to the hardening). While it is possible to
propagate CoreFoundation manually, the cleaner solution is to make it
the default. CF remains available as `darwin.swift-corelibs-foundation`.

[1]: https://developer.apple.com/forums/thread/739355
2023-11-02 21:20:55 -04:00
Vladimír Čunát
d811555465
Merge branch 'staging' into staging-next 2023-10-26 10:36:50 +02:00
Michael Hoang
ab1f45f3d3 linux-builder: support x86_64-linux on aarch64 2023-10-24 13:35:37 +02:00
Randy Eckenrode
beb14644b7
darwin.apple_sdk: use bootstrap fetchurl 2023-10-13 18:51:05 -04:00
Theodore Ni
dab839357e
Merge branch 'master' into staging-next
Had to merge https://github.com/NixOS/nixpkgs/pull/245957 and
https://github.com/NixOS/nixpkgs/pull/247245.
2023-08-20 12:01:22 -07:00
Adam Joseph
cbc8aa437c treewide: use uncurried version of makeScopeWithSplicing 2023-08-14 02:51:10 +03:00
Simon Žlender
8e912feb29 codesign_allocate: reference cctools 2023-08-01 21:27:09 +02:00
Silvan Mosberger
a0b8caf3bc
Revert "lib.customisation: uncurry makeScopeWithSplicing" 2023-07-28 23:04:09 +02:00
Artturin
3716ef19d8 lib.makeScopeWithSplicing: provide default for keep,extra
These are often unneeded by the user.
2023-07-28 17:41:01 +03:00
Adam Joseph
cb13669b00 lib.customisation: uncurry makeScopeWithSplicing
Deeply-curried functions are pretty error-prone in untyped languages
like Nix.  This is a particularly bad case because
`top-level/splice.nix` *also* declares a makeScopeWithSplicing, but
it takes *two fewer arguments*.

Let's switch to attrset-passing form, to provide some minimal level
of sanity-checking.
2023-07-27 21:31:59 -07:00
github-actions[bot]
da44aac0b1
Merge master into staging-next 2023-07-07 12:01:26 +00:00
Michael Hoang
edef486898 darwin.linux-builder: rename from darwin.builder 2023-07-06 21:33:09 +10:00
Michael Hoang
34f6ce2fc2 darwin.builder: allow overriding configuration 2023-07-06 21:32:08 +10:00
Randy Eckenrode
b2574122a9
cctools: make cctools-llvm the default on Darwin 2023-07-02 10:03:29 -04:00
Randy Eckenrode
df7487ff17
cctools-llvm: init at 11.1.0-973.0.1
cctools-llvm is a replacement for cctools that replaces as much of cctools with equivalents from LLVM that it can reasonably do. This was motivated by wanting to reduce dependencies on cctools, which are updated infrequently by upstream.

To provide a motivating example, the version of `strip` included in cctools cannot properly strip the archives in compiler-rt in LLVM 15. Paths are left to bootstrap tools, resulting in failed requisites checks in the final stdenv build. Since `strip` needs replaced, the opportunity was taken to replace other provided they are functional replacements.

Note: This has to be done in cctools (or some equivalent) because some derivations (noteably LLVM) use the bintools of the stdenv directly instead of going through the wrapper.

The following tools from LLVM are not used in this derivation:

* LLD - not fully compatible with ld64 yet and potentially too big of a change;
* libtool - not a drop-in replacement yet because it does not support linker passthrough, which is needed by xcbuild;
* lipo - crashes when running the LLVM test suite;
* install_name_tool - fails when trying to build swift-corefoundation; and.
* randlib - not completely a drop-in replacement, so leaving it out for now.

If other incompatabilities are found, the tools can be reverted or made conditional. For example, cctools `strip` is preferred on older versions of LLVM (which lack the compiler-rt issue) or when cctools itself is a new enough version because `llvm-strip` on LLVM 11 produces files that older verions of `codesign_allocate` cannot process correctly.

One final caveat/note: Some tools are not duplicated or linked from cctools-port. The names of the tools and which ones were linked was determined based on what is provided upstream in Xcode and is installed on macOS system.
2023-06-06 19:05:22 -04:00
Connor Baker
b2eb5c816f apple_sdk: remove cf-private alias 2023-05-01 21:59:03 -04:00
Weijia Wang
12b91012e5 darwin.darling: drop 2023-04-25 22:45:59 +03:00
github-actions[bot]
c4fe2133de
Merge staging-next into staging 2023-02-15 06:01:44 +00:00
Felix Buehler
bc3d5934d7 treewide: use lib.optionals 2023-02-14 19:11:59 +01:00
github-actions[bot]
29cdca7736
Merge staging-next into staging 2023-02-13 06:02:02 +00:00
Sandro
3e7bf1e547
Merge pull request #204493 from reckenrode/xcodes-update 2023-02-13 00:38:33 +01:00
Artturin
4e3dcf364e treewide: makeSetupHook deps -> propagatedBuildInputs 2023-02-07 21:02:00 +02:00
zowoq
eceae845cd darwin.openwith: init at unstable-2022-10-28 2023-02-07 06:22:06 +10:00
Randy Eckenrode
2e2bd8b4f5
xcode: add missing versions 2023-01-28 17:51:18 -05:00
github-actions[bot]
feb2240b37
Merge master into staging-next 2023-01-22 18:01:03 +00:00
Domen Kožar
9d57399b8e
Merge pull request #157628 from veprbl/pr/darwin_cctools_apple
darwin.cctools-apple: init at 973.0.1-609
2023-01-22 17:21:33 +00:00
Alyssa Ross
0ae87d514f treewide: add names to all setup hooks 2023-01-19 15:00:36 +00:00
Vladimír Čunát
befc83905c
Merge #209423: gnat12: add for x86_64-darwin 2023-01-13 18:32:21 +01:00
Boey Maun Suang
82b88d2db6 bintoolsDualAs: Add package
For reasons explained in the commit contents, in order to build the
native gnat package for x86_64-darwin, the native gnatboot package for
x86_64-darwin must have access to both the Clang integrated assembler
and the cctools GNU assembler for that platform.  This commit creates a
package with both of those assemblers that x86_64-darwin gnatboot can
then be wrapped with.
2023-01-07 18:32:12 +11:00