Skip to content

apk-tools: fix build on darwin#101125

Closed
siraben wants to merge 1 commit intoNixOS:masterfrom
siraben:apk-tools-darwin
Closed

apk-tools: fix build on darwin#101125
siraben wants to merge 1 commit intoNixOS:masterfrom
siraben:apk-tools-darwin

Conversation

@siraben
Copy link
Copy Markdown
Member

@siraben siraben commented Oct 20, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Oct 20, 2020
@ofborg ofborg bot requested a review from alyssais October 20, 2020 07:16
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Oct 20, 2020
@r-burns
Copy link
Copy Markdown
Contributor

r-burns commented Oct 20, 2020

Nice, this definitely gets us closer. Unfortunately it looks like there are some bits which are harder to work around, like the futimens and utimensat calls which require the 10.13 SDK. I think any patches to add macos support should be upstreamed since they'd end up being pretty extensive.

@siraben
Copy link
Copy Markdown
Member Author

siraben commented Oct 20, 2020

For those without darwin machines, here's the build log ATM.

Build log
$ nix-build -A apk-tools                                     
these derivations will be built:
  /nix/store/5jr6rvs3xczl9f1q2azs469l5jhijakw-apk-tools-2.10.5.drv
building '/nix/store/5jr6rvs3xczl9f1q2azs469l5jhijakw-apk-tools-2.10.5.drv'...
unpacking sources
unpacking source archive /nix/store/720yapms12br0qfd0px2k9m4h263asiv-apk-tools-2.10.5.tar.xz
source root is apk-tools-2.10.5
setting SOURCE_DATE_EPOCH to timestamp 1582035588 of file apk-tools-2.10.5/test/version.sh
patching sources
configuring
no configure script, doing nothing
building
build flags: -j4 -l4 SHELL=/nix/store/8i9kyqfxhk2s9dzx32x0sgdk7kyx9wjc-bash-4.4-p23/bin/bash CC=cc SBINDIR=\$\(out\)/bin LIBDIR=\$\(out\)/lib LUA_LIBDIR=\$\(out\)/lib/lua/5.3 MANDIR=\$\(out\)/share/man DOCDIR=\$\(out\)/share/doc/apk INCLUDEDIR=\$\(out\)/include PKGCONFIGDIR=\$\(out\)/lib/pkgconfig
  GENERR  libfetch/ftperr.h
  GENERR  libfetch/httperr.h
  CC      libfetch/common.o
  CC      libfetch/ftp.o
  CC      libfetch/http.o
  CC      libfetch/openssl-compat.o
  CC      libfetch/file.o
  CC      libfetch/fetch.o
  AR      libfetch/libfetch.a
/nix/store/ksks2lqixy6d9wxj6gwsd1c9r94ajsaa-cctools-port-949.0.1/bin/ranlib: file: libfetch/libfetch.a(openssl-compat.o) has no symbols
  CC      src/archive.o
  CC      src/blob.o
src/archive.c:480:33: error: too many arguments to function call, expected 3, have 4
                r = mknod(atfd, fn, ae->mode, ae->device);
                    ~~~~~                     ^~~~~~~~~~
/nix/store/qbbl5g6l5kx3zwjmkbcwflrzfrk6by0g-Libsystem-osx-10.12.6/include/sys/stat.h:359:1: note: 'mknod' declared here
int     mknod(const char *, mode_t, dev_t);
^
src/archive.c:513:73: error: too few arguments to function call, expected 6, have 5
                                if (fsetxattr(fd, xattr->name, xattr->value.ptr, xattr->value.len, 0) < 0) {
                                    ~~~~~~~~~                                                       ^
/nix/store/qbbl5g6l5kx3zwjmkbcwflrzfrk6by0g-Libsystem-osx-10.12.6/include/sys/xattr.h:67:1: note: 'fsetxattr' declared here
int fsetxattr(int fd, const char *name, const void *value, size_t size, u_int32_t position, int options);
^
src/archive.c:536:7: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                r = utimensat(atfd, fn, times, atflags);
                    ^
src/archive.c:536:7: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
4 errors generated.
make[1]: *** [Make.rules:202: src/archive.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Make.rules:288: src/] Error 2
builder for '/nix/store/5jr6rvs3xczl9f1q2azs469l5jhijakw-apk-tools-2.10.5.drv' failed with exit code 2
error: build of '/nix/store/5jr6rvs3xczl9f1q2azs469l5jhijakw-apk-tools-2.10.5.drv' failed

@siraben
Copy link
Copy Markdown
Member Author

siraben commented Oct 20, 2020

@r-burns Is the 10.13 SDK available for use on nixpkgs yet?

@r-burns
Copy link
Copy Markdown
Contributor

r-burns commented Oct 21, 2020

Nope, we're still on 10.12. I don't know what the timescale is on the 10.13 update but I know it's nontrivial. I'll open an issue for this and see if I can get some more info.

@r-burns r-burns mentioned this pull request Oct 21, 2020
@SuperSandro2000
Copy link
Copy Markdown
Member

SuperSandro2000 commented Oct 28, 2020

Result of nixpkgs-review pr 101125 1

2 packages failed to build:
  • alpine-make-vm-image
  • apk-tools
unpacking sources
unpacking source archive /nix/store/720yapms12br0qfd0px2k9m4h263asiv-apk-tools-2.10.5.tar.xz
source root is apk-tools-2.10.5
setting SOURCE_DATE_EPOCH to timestamp 1582035588 of file apk-tools-2.10.5/test/version.sh
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
build flags: -j8 -l8 SHELL=/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23/bin/bash CC=cc SBINDIR=\$\(out\)/bin LIBDIR=\$\(out\)/lib LUA_LIBDIR=\$\(out\)/lib/lua/5.3 MANDIR=\$\(out\)/share/man DOCDIR=\$\(out\)/share/doc/apk INCLUDEDIR=\$\(out\)/include PKGCONFIGDIR=\$\(out\)/lib/pkgconfig
  GENERR  libfetch/ftperr.h
/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23/bin/bash: libfetch/errlist.sh: /bin/sh: bad interpreter: No such file or directory
/nix/store/k8p54jg8ipvnfz435mayf5bnqhw4qqap-bash-4.4-p23/bin/bash: libfetch/errlist.sh: /bin/sh: bad interpreter: No such file or directory
make[1]: *** [libfetch/Makefile:11: libfetch/ftperr.h] Error 126
make: *** [Make.rules:288: libfetch/] Error 2

@stale
Copy link
Copy Markdown

stale bot commented Apr 26, 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 Apr 26, 2021
@r-burns r-burns added the 2.status: blocked by pr/issue Another PR or issue is preventing this from being completed label Sep 21, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 21, 2021
@stale
Copy link
Copy Markdown

stale bot commented Apr 16, 2022

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 Apr 16, 2022
@wegank
Copy link
Copy Markdown
Member

wegank commented Jan 24, 2023

Closed by #191605.

@wegank wegank closed this Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: blocked by pr/issue Another PR or issue is preventing this from being completed 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 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-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants