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

cdrtools broken on darwin #60357

Closed
Amar1729 opened this issue Apr 28, 2019 · 2 comments · Fixed by #64460
Closed

cdrtools broken on darwin #60357

Amar1729 opened this issue Apr 28, 2019 · 2 comments · Fixed by #64460
Labels
6.topic: darwin Running or building packages on Darwin

Comments

@Amar1729
Copy link
Contributor

Amar1729 commented Apr 28, 2019

Issue description

Cdrtools (current nixpkg) is compatible with darwin, but doesn't build here with nix yet.

Removing the incompatible dependencies on acl and libcap results in a failed build (full log). Last few lines:

creating xconfig.h
        ==> MAKING SYMLINKS in ./RULES/
        ==> MAKING SYMLINKS in ./TEMPLATES/
sh conf/cc-config.sh cc cc incs/Dcc.i386-darwin
Trying to find cc
Found cc
cc is clang
Making clang the default compiler in 'incs/Dcc.i386-darwin'
        ==> MAKING DIRECTORY "incs/i386-darwin-clang/Inull"
        ==> CONFIGURING RULES "incs/i386-darwin-clang/rules.cnf"
creating cache ./config.cache
checking host system type... x86_64-apple-macosx18.5.0
checking if sh is bash... yes
checking if /bin/sh is bash... yes
checking whether sh -ce is broken... no
checking whether /bin/sh -ce is broken... no
checking whether /bin/bosh is a working shell... no
checking whether /opt/schily/bin/bosh is a working shell... no
checking for cc... clang
checking for gcc... (cached) clang
checking whether the C compiler (clang   -O   -Llibs/i386-darwin-clang -L/usr/local/lib -framework IOKit -framework CoreFoundation) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
RULES/rules.cnf:71: incs/i386-darwin-clang/rules.cnf: No such file or directory
make: *** [RULES/rules.cnf:59: incs/i386-darwin-clang/rules.cnf] Error 1
builder for '/nix/store/2gp07d7nn4pw697y7n6rpkcpw638404s-cdrtools-3.02a06.drv' failed with exit code 2
error: build of '/nix/store/2gp07d7nn4pw697y7n6rpkcpw638404s-cdrtools-3.02a06.drv' failed

I've updated the package in the following ways:

  • doBuild=false
  • changed the installPhase to:
    • make INS_BASE=#{out} INS_RBASE=#{out} DESTDIR=#{out} install
  • included darwin.IOKit

Last few lines of current build error:

creating xconfig.h
        ==> MAKING "all" ON SUBDIRECTORY "SRCROOT/conf"
make[1]: Entering directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/conf'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/conf'
        ==> MAKING "all" ON SUBDIRECTORY "SRCROOT/inc"
make[1]: Entering directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/inc'
        ==> MAKING "all" ON SUBCOMPONENT "SRCROOT/inc/align_test.mk"
make[2]: Entering directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/inc'
        ==> MAKING DIRECTORY "OBJ/i386-darwin-clang"
        ==> MAKING DIRECTORY "OBJ/i386-darwin-clang/man"
        ==> MAKING DEPENDENCIES "OBJ/i386-darwin-clang/align_test.d"
 ==> COMPILING "OBJ/i386-darwin-clang/align_test.o"
        ==> LINKING "OBJ/i386-darwin-clang/align_test"
ld: warning: directory not found for option '-L../libs/i386-darwin-clang'
ld: warning: directory not found for option '-L../libs/i386-darwin-clang'
        ==> GENERATING include file "../incs/i386-darwin-clang/align.h"
make[2]: Leaving directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/inc'
        ==> MAKING "all" ON SUBCOMPONENT "SRCROOT/inc/avoffset.mk"
make[2]: Entering directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/inc'
        ==> MAKING DEPENDENCIES "OBJ/i386-darwin-clang/avoffset.d"
 ==> COMPILING "OBJ/i386-darwin-clang/avoffset.o"
        ==> LINKING "OBJ/i386-darwin-clang/avoffset"
ld: warning: directory not found for option '-L../libs/i386-darwin-clang'
ld: warning: directory not found for option '-L../libs/i386-darwin-clang'
        ==> GENERATING include file "../incs/i386-darwin-clang/avoffset.h"
/nix/store/jizc4dhwkp8kffbprbl3n9np8ipw6fz8-bash-4.4-p23/bin/bash: line 2: 58797 Segmentation fault: 11  OBJ/i386-darwin-clang/avoffset > ../incs/i386-darwin-clang/avoffset.h
/nix/store/jizc4dhwkp8kffbprbl3n9np8ipw6fz8-bash-4.4-p23/bin/bash: line 2: 58801 Segmentation fault: 11  OBJ/i386-darwin-clang/avoffset > ../incs/i386-darwin-clang/avoffset.h
make[2]: *** [../RULES/rules.inc:50: ../incs/i386-darwin-clang/avoffset.h] Error 139
make[2]: Leaving directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/inc'
make[1]: *** [../RULES/rules.mks:23: all] Error 2
make[1]: Leaving directory '/private/var/folders/zk/t4rzq9t166x94d10mr4r1zl5yb8l3y/T/nix-build-cdrtools-3.02a06.drv-5/cdrtools-3.02/inc'
make: *** [RULES/rules1.dir:25: all] Error 2
builder for '/nix/store/6ib4cmkpr3wz0gil8xmw6alvay4kacys-cdrtools-3.02a06.drv' failed with exit code 2
error: build of '/nix/store/6ib4cmkpr3wz0gil8xmw6alvay4kacys-cdrtools-3.02a06.drv' failed

(full log here)

I'll make a PR if I can figure this out, but some of these issues are stumping me. Hoping someone else has some idea how to fix it.

Steps to reproduce

  1. be on darwin and nixpkgs master
  2. nix-build . -A cdrtools

Technical details

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

 - system: `"x86_64-darwin"`
 - host os: `Darwin 18.5.0, macOS 10.14.4`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.2.2`
 - channels(amar): `"nixpkgs-19.09pre177248.ed1b59a98e7"`
 - nixpkgs: `/Users/amar/.nix-defexpr/channels/nixpkgs`
@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Apr 28, 2019
@blissdev
Copy link

@Amar1729 Can you point me to directions on to try this locally? I'm just getting started in nix. But I was able to compile cdrtools with a simple make so curious if this can be fixed.

@Amar1729
Copy link
Contributor Author

Amar1729 commented Jul 8, 2019

@blissdev

  • add allowUnsupportedSystem = true; to my ~/.config/nixpkgs/config.nix
  • comment buildInputs = [ acl libcap ]; in the local clone of nixpkgs: pkgs/applications/misc/cdrtools/default.nix
  • attempt to build with nix-build . -A cdrtools

See if you run into errors trying to build it like that. You may need to add darwin.IOKit as a dependency, that's what I seemed to run into but couldn't get farther than that.

Trying to build it on its own with make works for me too but that's because the makefile just redirects to using cdrtools' bundled smake I think.

Edit:
No clue what's different, but I think something changed in the nix-bundled darwin frameworks which now allows this to be built. See my pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants