Skip to content

element-desktop: fix darwin build - #501797

Merged
viraptor merged 1 commit into
NixOS:masterfrom
viraptor:element-desktop-mac
Mar 22, 2026
Merged

viraptor merged 1 commit into
NixOS:masterfrom
viraptor:element-desktop-mac

Conversation

@viraptor

@viraptor viraptor commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor

Added the actool reimplementation as a build dependency. It can do assets packing like more modern versions of Apple's actool from xcode, which we don't carry in nixpkgs.

Closes: #485589

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@viraptor viraptor mentioned this pull request Mar 21, 2026
1 of 13 tasks
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Mar 21, 2026
@ofborg ofborg Bot added the 6.topic: darwin Running or building packages on Darwin label Mar 21, 2026
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/6593

@SuperSandroBot

Copy link
Copy Markdown

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 501797
Commit: f816c186eb19797e39a3c84a82d8b54be290f354 (subsequent changes)
Merge: 9afef56e3b865d2d62a58fc76213790770b0b201

Logs: https://github.com/SuperSandro2000/nixpkgs-review-gha/actions/runs/23385572621


aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • element-desktop

Error logs: `aarch64-darwin`
element-desktop
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip --enable-deterministic-archives -S /nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/Resources/build/icon.ico
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip: error: '/nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/bin/element-desktop': /nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip: The file was not recognized as a valid object file
error: '/nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/MacOS/Element': The file was not recognized as a valid object file
0  libLLVM.dylib            0x000000010ddaf73c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1  libLLVM.dylib            0x000000010ddad220 llvm::sys::RunSignalHandlers() + 164
2  libLLVM.dylib            0x000000010ddb02f0 SignalHandler(int, __siginfo*, void*) + 312
3  libsystem_platform.dylib 0x00000001918e16a4 _sigtramp + 56
4  libLLVM.dylib            0x000000010fa6fdf8 std::__1::__wrap_iter<llvm::objcopy::coff::Relocation*> std::__1::vector<llvm::objcopy::coff::Relocation, std::__1::allocator<llvm::objcopy::coff::Relocation>>::__insert_with_size[abi:fn200100]<llvm::object::coff_relocation const*, llvm::object::coff_relocation const*>(std::__1::__wrap_iter<llvm::objcopy::coff::Relocation const*>, llvm::object::coff_relocation const*, llvm::object::coff_relocation const*, long) + 200
5  libLLVM.dylib            0x000000010fa6e968 llvm::objcopy::coff::COFFReader::readSections(llvm::objcopy::coff::Object&) const + 468
6  libLLVM.dylib            0x000000010fa6fa14 llvm::objcopy::coff::COFFReader::create() const + 236
7  libLLVM.dylib            0x000000010fa6924c llvm::objcopy::coff::executeObjcopyOnBinary(llvm::objcopy::CommonConfig const&, llvm::objcopy::COFFConfig const&, llvm::object::COFFObjectFile&, llvm::raw_ostream&) + 80
8  libLLVM.dylib            0x000000010fa67e94 llvm::objcopy::executeObjcopyOnBinary(llvm::objcopy::MultiFormatConfig const&, llvm::object::Binary&, llvm::raw_ostream&) + 208
9  libLLVM.dylib            0x000000010dd907fc llvm::writeToOutput(llvm::StringRef, std::__1::function<llvm::Error (llvm::raw_ostream&)>) + 684
10 llvm-objcopy             0x00000001049751d4 llvm_objcopy_main(int, char**, llvm::ToolContext const&) + 2520
11 llvm-objcopy             0x0000000104976274 main + 88
12 dyld                     0x0000000191506b98 start + 6076
xargs: strip: terminated by signal 11

@viraptor

viraptor commented Mar 21, 2026 •

Copy link
Copy Markdown
Contributor Author

This is weird, I've had 2 people build it and it just worked. Not sure why this check was different @SuperSandroBot
I'll do some digging. Strip should definitely not run on the icon file.

@booxter

booxter commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 501797
Commit: f816c186eb19797e39a3c84a82d8b54be290f354


aarch64-darwin

❌ 1 package failed to build:
  • element-desktop

Error logs: `aarch64-darwin`
element-desktop
/nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip: error: '/nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/Resources/build/icon.png': The file was not recognized as a valid object file
/nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip: error: '/nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/Resources/Assets.car': The file was not recognized as a valid object file
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip --enable-deterministic-archives -S /nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/Resources/build/icon.ico
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.dylib            0x000000010947773c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1  libLLVM.dylib            0x0000000109475220 llvm::sys::RunSignalHandlers() + 164
2  libLLVM.dylib            0x00000001094782f0 SignalHandler(int, __siginfo*, void*) + 312
3  libsystem_platform.dylib 0x000000018a633744 _sigtramp + 56
4  libLLVM.dylib            0x000000010b137df8 std::__1::__wrap_iter<llvm::objcopy::coff::Relocation*> std::__1::vector<llvm::objcopy::coff::Relocation, std::__1::allocator<llvm::objcopy::coff::Relocation>>::__insert_with_size[abi:fn200100]<llvm::object::coff_relocation const*, llvm::object::coff_relocation const*>(std::__1::__wrap_iter<llvm::objcopy::coff::Relocation const*>, llvm::object::coff_relocation const*, llvm::object::coff_relocation const*, long) + 200
5  libLLVM.dylib            0x000000010b136968 llvm::objcopy::coff::COFFReader::readSections(llvm::objcopy::coff::Object&) const + 468
6  libLLVM.dylib            0x000000010b137a14 llvm::objcopy::coff::COFFReader::create() const + 236
7  libLLVM.dylib            0x000000010b13124c llvm::objcopy::coff::executeObjcopyOnBinary(llvm::objcopy::CommonConfig const&, llvm::objcopy::COFFConfig const&, llvm::object::COFFObjectFile&, llvm::raw_ostream&) + 80
8  libLLVM.dylib            0x000000010b12fe94 llvm::objcopy::executeObjcopyOnBinary(llvm::objcopy::MultiFormatConfig const&, llvm::object::Binary&, llvm::raw_ostream&) + 208
9  libLLVM.dylib            0x00000001094587fc llvm::writeToOutput(llvm::StringRef, std::__1::function<llvm::Error (llvm::raw_ostream&)>) + 684
10 llvm-objcopy             0x00000001001f51d4 llvm_objcopy_main(int, char**, llvm::ToolContext const&) + 2520
11 llvm-objcopy             0x00000001001f6274 main + 88
12 dyld                     0x000000018a261d54 start + 7184
xargs: strip: terminated by signal 11

@debtquity

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 501797
Commit: f816c186eb19797e39a3c84a82d8b54be290f354 (subsequent changes)
Merge: 9afef56e3b865d2d62a58fc76213790770b0b201

Logs: https://github.com/debtquity/nixpkgs-review-gha/actions/runs/23391304515


x86_64-darwin (sandbox = relaxed)

✅ 1 package built:
  • element-desktop

aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • element-desktop

Error logs: `aarch64-darwin`
element-desktop
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip --enable-deterministic-archives -S /nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/Resources/build/icon.ico
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip: error: '/nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/Applications/Element.app/Contents/MacOS/Element': The file was not recognized as a valid object file
0  libLLVM.dylib            0x000000010954f73c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1 /nix/store/yppcv1v8rdm3086ykynmf7w5yy61v30b-cctools-binutils-darwin-1010.6/bin/strip: error: '/nix/store/dmw905hw2zgznwj3j9fqw106bamsk2pn-element-desktop-1.12.10/bin/element-desktop': The file was not recognized as a valid object file
 libLLVM.dylib            0x000000010954d220 llvm::sys::RunSignalHandlers() + 164
2  libLLVM.dylib            0x00000001095502f0 SignalHandler(int, __siginfo*, void*) + 312
3  libsystem_platform.dylib 0x000000019b1e56a4 _sigtramp + 56
4  libLLVM.dylib            0x000000010b20fdf8 std::__1::__wrap_iter<llvm::objcopy::coff::Relocation*> std::__1::vector<llvm::objcopy::coff::Relocation, std::__1::allocator<llvm::objcopy::coff::Relocation>>::__insert_with_size[abi:fn200100]<llvm::object::coff_relocation const*, llvm::object::coff_relocation const*>(std::__1::__wrap_iter<llvm::objcopy::coff::Relocation const*>, llvm::object::coff_relocation const*, llvm::object::coff_relocation const*, long) + 200
5  libLLVM.dylib            0x000000010b20e968 llvm::objcopy::coff::COFFReader::readSections(llvm::objcopy::coff::Object&) const + 468
6  libLLVM.dylib            0x000000010b20fa14 llvm::objcopy::coff::COFFReader::create() const + 236
7  libLLVM.dylib            0x000000010b20924c llvm::objcopy::coff::executeObjcopyOnBinary(llvm::objcopy::CommonConfig const&, llvm::objcopy::COFFConfig const&, llvm::object::COFFObjectFile&, llvm::raw_ostream&) + 80
8  libLLVM.dylib            0x000000010b207e94 llvm::objcopy::executeObjcopyOnBinary(llvm::objcopy::MultiFormatConfig const&, llvm::object::Binary&, llvm::raw_ostream&) + 208
9  libLLVM.dylib            0x00000001095307fc llvm::writeToOutput(llvm::StringRef, std::__1::function<llvm::Error (llvm::raw_ostream&)>) + 684
10 llvm-objcopy             0x00000001003011d4 llvm_objcopy_main(int, char**, llvm::ToolContext const&) + 2520
11 llvm-objcopy             0x0000000100302274 main + 88
12 dyld                     0x000000019ae0ab98 start + 6076
xargs: strip: terminated by signal 11

@samemrecebi

Copy link
Copy Markdown
Contributor

Small question, I fixed the building of the package myself by adding actool as a native dependency if Darwin. Why didn’t you do that? Only asking to understand something maybe I missed

@samemrecebi

Copy link
Copy Markdown
Contributor

This is weird, I've had 2 people build it and it just worked. Not sure why this check was different @SuperSandroBot I'll do some digging. Strip should definitely not run on the icon file.

I disabled stripping in the overlay as a temp fix as I couldn’t get it to build without doing that on aarch64 Darwin

@viraptor

viraptor commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Small question, I fixed the building of the package myself by adding actool as a native dependency if Darwin. Why didn’t you do that?

That results in an impure build which gets elements from the host system. I'm trying to remove that issue by providing our own implementation of actool which does the same thing, but actually gets built in nixpkgs. This means you don't have to have the whole xcode installed and the build can pass on hydra. (also the bonus of actually knowing how it works and having some control over the version behaviour - otherwise we'd have different things built on different systems - xcode changes behaviours and formats... randomly)

@viraptor
viraptor force-pushed the element-desktop-mac branch from f816c18 to bf259ea Compare March 22, 2026 01:29
@viraptor

Copy link
Copy Markdown
Contributor Author

I still don't understand why it builds for me without changes (and no other mac apps seem to have this issue), but I explicitly limited the directories to strip now. Give it a go @samemrecebi

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 22, 2026
@samemrecebi

Copy link
Copy Markdown
Contributor

I still don't understand why it builds for me without changes (and no other mac apps seem to have this issue), but I explicitly limited the directories to strip now. Give it a go @samemrecebi

Will do in a bit

@lafrenierejm

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 501797
Commit: bf259ea370b19600ef0b361c4af58cc829abf1c6


aarch64-darwin

✅ 1 package built:
  • element-desktop

@debtquity

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 501797
Commit: bf259ea370b19600ef0b361c4af58cc829abf1c6 (subsequent changes)
Merge: 2d4d2fe9ddc1b6d0f67ec351c5265f570575d871

Logs: https://github.com/debtquity/nixpkgs-review-gha/actions/runs/23411556363


x86_64-darwin (sandbox = relaxed)

✅ 1 package built:
  • element-desktop

aarch64-darwin (sandbox = relaxed)

✅ 1 package built:
  • element-desktop

@viraptor
viraptor added this pull request to the merge queue Mar 22, 2026
Merged via the queue into NixOS:master with commit b7207b8 Mar 22, 2026
45 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: element-desktop

7 participants