Skip to content

mold: 2.38.0 -> 2.39.0#402472

Merged
azahi merged 1 commit intomasterfrom
unknown repository
May 8, 2025
Merged

mold: 2.38.0 -> 2.39.0#402472
azahi merged 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Apr 28, 2025

The breakage on darwin is a nix problem.
rui314/mold#1455

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Apr 28, 2025
@nix-owners nix-owners bot requested review from azahi and paveloom April 28, 2025 08:59
Copy link
Contributor

@RossSmyth RossSmyth left a comment

Choose a reason for hiding this comment

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

The reason it failed the vet was because you changed the attribute name in the package definition.
8c67f48#diff-f8b4de2887568c28f0b6e63f3e20e2dce9e6b4bf46a61fe414a6b7e618f944d5R10

Just change the override in all-packages as it was before. I tested it locally and it works fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tbb_2022_0,
tbb,

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
tbb_2022_0
tbb

Copy link
Contributor

Choose a reason for hiding this comment

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

- tbb = tbb_2021_11;
+ tbb = tbb_2022_0;

@ghost
Copy link
Author

ghost commented Apr 29, 2025

@RossSmyth I understand what you are saying. At the same time, it doesn't make it any less stupid.
Why don't we define in another file what the tbb from all-packages.nix is as well. And in that other file it's still not what it means because it's defined in another 2 files both with something different, so anyone that looks at the mold package.nix cannot know what the things in it mean because they are defined to something else somewhere else.

@ghost ghost changed the title mold: 2.38.0 -> 2.38.1 mold: 2.38.0 -> 2.39.0 May 5, 2025
@azahi
Copy link
Member

azahi commented May 5, 2025

@RossSmyth I understand what you are saying. At the same time, it doesn't make it any less stupid. Why don't we define in another file what the tbb from all-packages.nix is as well. And in that other file it's still not what it means because it's defined in another 2 files both with something different, so anyone that looks at the mold package.nix cannot know what the things in it mean because they are defined to something else somewhere else.

Because overriding a generic attribute is easier than overriding a specific "versioned" attribute, which is a hack by the way. This is pretty much a nitpick because we don't have anything about this in contribution guidelines, so I'll merge it as is.

azahi
azahi previously requested changes May 5, 2025
Copy link
Member

@azahi azahi left a comment

Choose a reason for hiding this comment

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

@ghost
Copy link
Author

ghost commented May 5, 2025

@azahi Is it a check problem or is it because the darwin build doesn't work in the first place?
That check is supposed to test the basic functionality of showing the program version and I doubt mold shows something on linux, but nothing on darwin and I have a feeling it didn't work before either, be that a nix problem or an upstream one, tho this is just a theory since I have no way to test darwin to see what is the problem.
Do I add darwin as being broken or just remove the check?

@azahi
Copy link
Member

azahi commented May 6, 2025

@ghost
Copy link
Author

ghost commented May 6, 2025

Compilation working != program working
Who here has a darwin and can test this program to see why it fails to find the version because I think it doesn't work even tho it compiles; I'm guessing paveloom since you clearly don't have darwin.

The below program builds completely fine, but it doesn't work

#include <stdio.h>

int main() {
    int *ptr = NULL;
    *ptr = 1;
    printf("",*ptr);
    return 0;
}

@Kamillaova
Copy link
Contributor

(lldb) target create "/nix/store/zjn752vm9nf0dl4n7j8miqvsvg6mpsjj-mold-2.39.0/bin/mold"
Current executable set to '/nix/store/zjn752vm9nf0dl4n7j8miqvsvg6mpsjj-mold-2.39.0/bin/mold' (arm64).
(lldb) run --version
Process 50947 launched: '/nix/store/zjn752vm9nf0dl4n7j8miqvsvg6mpsjj-mold-2.39.0/bin/mold' (arm64)
mold 2.39.0 (compatible with GNU ld)
Process 50947 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x102fa04e4)
    frame #0: 0x0000000102fa04e4
error: memory read failed for 0x102fa0400
Target 0: (mold) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x102fa04e4)
  * frame #0: 0x0000000102fa04e4
    frame #1: 0x0000000102ed5330 libtbb.12.dylib`tbb::detail::r1::global_control_release() at global_control.cpp:157:9 [opt]
    frame #2: 0x0000000102ed6544 libtbb.12.dylib`tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce() [inlined] tbb::detail::r1::__TBB_InitOnce::remove_ref() at main.cpp:90:9 [opt]
    frame #3: 0x0000000102ed6528 libtbb.12.dylib`tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce() [inlined] tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce(this=0x0000000102f08860) at main.h:79:9 [opt]
    frame #4: 0x0000000102ed6518 libtbb.12.dylib`tbb::detail::r1::__TBB_InitOnce::~__TBB_InitOnce(this=0x0000000102f08860) at main.h:77:23 [opt]
    frame #5: 0x00000001951042e8 libsystem_c.dylib`__cxa_finalize_ranges + 476
    frame #6: 0x0000000195104070 libsystem_c.dylib`exit + 44
    frame #7: 0x0000000100046cec mold`std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> mold::parse_nonpositional_args<mold::X86_64>(ctx=0x000000016fdfdc00) at cmdline.cc:0 [opt]
    frame #8: 0x00000001004f2d08 mold`int mold::mold_main<mold::X86_64>(argc=2, argv=0x000000016fdff220) at main.cc:283:40 [opt]
    frame #9: 0x0000000194ebe0e0 dyld`start + 2360
(lldb)

@Kamillaova
Copy link
Contributor

I also think it would be a good to set hydraPlatforms to unix except darwin since no one will use mold on macos and if someone does, it's cross-compilation where many packages need to be compiled and mold even compiles faster than glibc

@azahi
Copy link
Member

azahi commented May 8, 2025

I'll merge this as-is, Darwin users are welcome to try to fix this if needed.

@azahi azahi dismissed their stale review May 8, 2025 21:51

Stale.

@azahi azahi merged commit ffeb8dd into NixOS:master May 8, 2025
28 checks passed
@simonzkl simonzkl mentioned this pull request May 16, 2025
3 tasks
@szlend
Copy link
Member

szlend commented May 17, 2025

FYI, it's the switch to tbb_2022_0 that broke mold on darwin, not the mold upgrade itself. It still works with the old tbb. I also tried upgrading tbb to 2022.1.0 and that didn't solve the issue. But it's the same version homebrew uses, so it's probably something wrong with either how we package tbb_2022_0, or the wider darwin stdenv.

@szlend
Copy link
Member

szlend commented May 17, 2025

How would mold package maintainers feel about downgrading tbb, at least for darwin?

@ghost ghost deleted the mold branch May 19, 2025 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants