Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magic-vlsi false build on macOS #105310

Open
ohAitch opened this issue Nov 29, 2020 · 9 comments
Open

magic-vlsi false build on macOS #105310

ohAitch opened this issue Nov 29, 2020 · 9 comments
Labels
0.kind: bug 6.topic: darwin Running or building packages on Darwin

Comments

@ohAitch
Copy link
Contributor

ohAitch commented Nov 29, 2020

Describe the bug
Magic appears to build, but errors on dlopen(/nix/store/asdfhjkl-magic-vlsi-8.3.5/lib/magic/tcl/tclmagic.dylib) when being run.

To Reproduce
Steps to reproduce the behavior:

  1. nix-env -iA nixpkgs.magic-vlsi
  2. magic, see error
  3. Belatedly notice make[2]: *** No rule to make target '../graphics/libgraphics.o', needed by 'tclmagic.dylib'. Stop. in step 1 which failed to interrupt the build.

Expected behavior
Magic builds successfully on mac; barring that, somewhere in the install process it not building is detected, and a broken build is not linked into the environment.

Screenshots

buildPhase.txt

Screen Shot 2020-11-28 at 5 46 37 PM

Additional context
This appears identical to an issue reported upstream, I'm not sure if the straightforward resolution here is "find the earlier version which successfully built" or just "mark as unavailable on mac". I tried building 8.1.224 and it produced the same error, while 8.1.157 yields a different one - something about needing csh?

Notify maintainers

@anna328p @thoughtpolice

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

  • system: "x86_64-darwin"
  • host os: Darwin 19.6.0, macOS 10.15.6
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.3.8
  • channels(fyr): "nixpkgs-21.03pre254638.d47eb666b1e"
  • nixpkgs: /Users/fyr/.nix-defexpr/channels/nixpkgs
@anna328p
Copy link
Member

I have a Hackintosh somewhere, I may be able to debug this.

@ohAitch
Copy link
Contributor Author

ohAitch commented Nov 29, 2020

Happy to sponsor a https://macincloud.com/ or sth if it would help

@thoughtpolice
Copy link
Member

thoughtpolice commented Nov 29, 2020

From the build log:

grTCairo4.c:14:10: fatal error: 'cairo/cairo-xlib.h' file not found

Which is definitely not the case when building on Linux (which I tested on a recent update.) I have a new Mac on the way but unfortunately it's Apple Silicon, so I'm not sure how easily it will be to diagnose and fix this. I suspect it's probably something we've run into before, and is just a matter of getting the right buildInput to work, or whatever. Maybe someone else knows the proper way to use/include Cairo here, because I suspect that's the main issue.

If you can submit a patch, we can use @ofborg in order to test it on x86_64-darwin, at least...

@ohAitch
Copy link
Contributor Author

ohAitch commented Nov 30, 2020

@RTimothyEdwards what's the latest on magic building on Mac? Is this likely to be dependent on nixpkg build environment weirdness, Catalina changes, more general "not known to work"?

@ohAitch
Copy link
Contributor Author

ohAitch commented Nov 30, 2020

cairo = pkgs.cairo.override { x11Support = true; }; seems to get further, the dylib builds but then segfaults on start. (Or successfully starts if graphical mode is unset-ish with -d NULL, but then the main window unsurprisingly doesn't display much.)
I'm not completely clear on the difference between XQuartz and X11; I do notice it shows up as a separate Wish "application", unlike the results of connecting to XQuartz from docker.

Trace with -d X11:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000050
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [85685]

VM Regions Near 0x50:
--> 
    __TEXT                 000000010d64c000-000000010d64f000 [   12K] r-x/r-x SM=COW  /Volumes/VOLUME/*/*.6

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libX11.6.dylib                	0x0000000113f8f6b2 XDefaultColormap + 18
1   tclmagic.dylib                	0x00000001132fb499 GrTkInit + 169
2   tclmagic.dylib                	0x00000001132fcf7f x11SetDisplay + 799
3   tclmagic.dylib                	0x00000001132f1aa1 GrSetDisplay + 881
4   tclmagic.dylib                	0x000000011334ae8f mainInitAfterArgs + 367
5   tclmagic.dylib                	0x00000001133d5e5d _magic_initialize + 429
6   libtcl8.6.dylib               	0x000000010d7b4c43 TclInvokeStringCommand + 121
7   libtcl8.6.dylib               	0x000000010d7b6378 TclNRRunCallbacks + 79
8   libtcl8.6.dylib               	0x000000010d8429f2 SlaveEval + 139
9   libtcl8.6.dylib               	0x000000010d8405d8 NRInterpCmd + 2001
10  libtcl8.6.dylib               	0x000000010d7b6378 TclNRRunCallbacks + 79
11  libtcl8.6.dylib               	0x000000010d7b75bf TclEvalEx + 1995
12  libtcl8.6.dylib               	0x000000010d8574f8 Tcl_FSEvalFileEx + 596
13  libtk8.6.dylib                	0x000000010d675761 Tk_MainEx + 888
14  wish                          	0x000000010d64e44d main + 47
15  libdyld.dylib                 	0x00007fff6bde9cc9 start + 1

Trace with -d OGL:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [85634]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libX11.6.dylib                	0x00000001160f9ac3 _XFlush + 51
1   libX11.6.dylib                	0x00000001160fae33 _XGetRequest + 51
2   libX11.6.dylib                	0x00000001160ef9f2 XQueryExtension + 82
3   libX11.6.dylib                	0x00000001160e2c12 XInitExtension + 50
4   libGL.1.dylib                 	0x000000011621e1c8 __glXInitialize + 152
5   libGL.1.dylib                 	0x000000011621bbb4 glXChooseVisual + 68
6   tclmagic.dylib                	0x0000000115457e1d GrTOGLInit + 141
7   tclmagic.dylib                	0x000000011545928c oglSetDisplay + 812
8   tclmagic.dylib                	0x0000000115449aa1 GrSetDisplay + 881
9   tclmagic.dylib                	0x00000001154a2e8f mainInitAfterArgs + 367
10  tclmagic.dylib                	0x000000011552de5d _magic_initialize + 429
11  libtcl8.6.dylib               	0x000000010f9a9c43 TclInvokeStringCommand + 121
12  libtcl8.6.dylib               	0x000000010f9ab378 TclNRRunCallbacks + 79
13  libtcl8.6.dylib               	0x000000010fa379f2 SlaveEval + 139
14  libtcl8.6.dylib               	0x000000010fa355d8 NRInterpCmd + 2001
15  libtcl8.6.dylib               	0x000000010f9ab378 TclNRRunCallbacks + 79
16  libtcl8.6.dylib               	0x000000010f9ac5bf TclEvalEx + 1995
17  libtcl8.6.dylib               	0x000000010fa4c4f8 Tcl_FSEvalFileEx + 596
18  libtk8.6.dylib                	0x000000010f86c761 Tk_MainEx + 888
19  wish                          	0x000000010f84544d main + 47
20  libdyld.dylib                 	0x00007fff6bde9cc9 start + 1

-d cairo seems… not to be supported, which is weird since configure lists it as enabled and it's the part that got changed from not compiling to compiling 🤷

@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2021
@dbrnz
Copy link

dbrnz commented Jul 7, 2022

Although magic successfully built for me (Monterey 12.3.1), I'm getting the above seg faults at runtime -- @ohAitch did you manage to get things to work?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 7, 2022
@ohAitch
Copy link
Contributor Author

ohAitch commented Jul 7, 2022

I did not alas, iirc I gave up and ran a Ubuntu VM

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 8, 2023
@shaunplee
Copy link

I was able to build and run magic using MacPorts. I don't understand the inner workings of MacPorts to look for clues as to how it might help us fix magic-vlsi in nixpkgs.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

6 participants