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

glibc fails to build on macOS #103356

Closed
cresh opened this issue Nov 10, 2020 · 4 comments
Closed

glibc fails to build on macOS #103356

cresh opened this issue Nov 10, 2020 · 4 comments
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin

Comments

@cresh
Copy link
Contributor

cresh commented Nov 10, 2020

Describe the bug
builder for '/nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv' failed with exit code 1
error: build of '/nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv' failed

To Reproduce
Steps to reproduce the behavior:

  1. Update to latest master
  2. nix-env -i glibc

Expected behavior
glibc should build

Additional context

> nix-env -i glibc
warning: there are multiple derivations named 'glibc-2.32'; using the first one
installing 'glibc-2.32'
these derivations will be built:
  /nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv
building '/nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv'...
unpacking sources
unpacking source archive /nix/store/yl0acs9vzng0cd4qfdcgb3zpwjm034nw-glibc-2.32.tar.xz
source root is glibc-2.32
setting SOURCE_DATE_EPOCH to timestamp 1596593820 of file glibc-2.32/wctype/wctype_l.c
patching sources
applying patch /nix/store/pp29isd0nvy4jrm9q2f92pjlc83xwa0i-nix-locale-archive.patch
patching file locale/loadarchive.c
patching file locale/programs/locale.c
Hunk #1 succeeded at 634 (offset 1 line).
Hunk #2 succeeded at 663 (offset 1 line).
patching file locale/programs/locarchive.c
applying patch /nix/store/5212825a2npxaf7qd81sxfrqq6219rlx-dont-use-system-ld-so-cache.patch
patching file elf/ldconfig.c
Hunk #1 succeeded at 55 with fuzz 1 (offset 4 lines).
patching file elf/Makefile
Hunk #1 succeeded at 647 (offset 88 lines).
patching file sysdeps/generic/dl-cache.h
applying patch /nix/store/mnglr8rr7nl444h7p50ysyq8qd0fm1lm-dont-use-system-ld-so-preload.patch
patching file elf/rtld.c
Hunk #1 succeeded at 1781 (offset 268 lines).
applying patch /nix/store/za0pg7fmysrcwrqcal26fnmzw6vycgdn-fix_path_attribute_in_getconf.patch
patching file sysdeps/unix/confstr.h
applying patch /nix/store/xkd50xxii6k7l1kmw4l5x6xzbhamcs87-allow-kernel-2.6.32.patch
patching file sysdeps/unix/sysv/linux/configure
patching file sysdeps/unix/sysv/linux/configure.ac
patching file sysdeps/unix/sysv/linux/dl-osinfo.h
applying patch /nix/store/3l70d7kcfsh91w6792h4fqs4kjbq17py-glibc-reinstate-prlimit64-fallback.patch?id=eab07e78b691ae7866267fc04d31c7c3ad6b0eeb
patching file sysdeps/unix/sysv/linux/getrlimit64.c
patching file sysdeps/unix/sysv/linux/setrlimit.c
Hunk #2 succeeded at 46 with fuzz 1.
patching file sysdeps/unix/sysv/linux/setrlimit64.c
Hunk #1 succeeded at 36 with fuzz 2.
applying patch /nix/store/nqa9d4yxz1l2cgswzqr1pkm4jfrksm0q-locale-C.diff
patching file localedata/locales/C
applying patch /nix/store/7kw224hdyxd7115lrqh9a4dv2x8msq2s-fix-x64-abi.patch
patching file elf/dl-tls.c
Hunk #1 succeeded at 898 (offset 71 lines).
applying patch /nix/store/ba9r5nbm6nrr0a0l9hnbrrwpf5xfi9m7-darwin-cross-build.patch
patching file Makefile.in
patching file Makerules
Hunk #1 succeeded at 847 (offset -68 lines).
Hunk #2 succeeded at 859 (offset -68 lines).
Hunk #3 succeeded at 875 (offset -68 lines).
Hunk #4 succeeded at 893 (offset -68 lines).
Hunk #5 succeeded at 1499 (offset -116 lines).
can't find file to patch at input line 82
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- glibc-2.27/sunrpc/rpc_main.c       2019-02-15 17:32:43.710244513 +0100
|+++ glibc-2.27/sunrpc/rpc_main.c       2019-02-15 17:23:57.139617796 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 94
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- glibc-2.27/sunrpc/rpc_scan.c       2019-02-15 17:32:54.845490606 +0100
|+++ glibc-2.27/sunrpc/rpc_scan.c       2019-02-15 17:24:54.288066644 +0100
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
builder for '/nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv' failed with exit code 1
error: build of '/nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv' failed

Notify maintainers
@eelco @Ma27

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.7`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.8`
 - channels(crestani): `"nixpkgs-19.03pre153206.f753852e11d"`
 - nixpkgs: `/Users/crestani/nixpkgs`
@cresh cresh added the 0.kind: bug Something is broken label Nov 10, 2020
@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Nov 11, 2020
@Ma27 Ma27 self-assigned this Nov 11, 2020
@Ma27
Copy link
Member

Ma27 commented Nov 11, 2020

First of all, I think that you meant @edolstra and not @eelco, please check in maintainers/maintainer-list.nix first which GitHub handle is actually associated with a maintainer.

Also, do you have something like NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 set in your environment? Because glibc is actually supported for Linux platforms only and shouldn't even evaluate on darwin.

FWIW I updated the patches (basically, all references to the sunrpc/-subtree had to be removed as this deprecated feature was dropped entirely in 2.32), so my local diff currently looks like this: https://gist.github.com/Ma27/2e2fc652d027d6aebe2cb200eb6bf7da

However, when trying to build glibc on a macOS machine, you'll get the following errors while running ./configure:

sparc x86_64 checking whether clang compiles in -mx32 mode by default... no

configure: error:
*** The GNU C library is currently unavailable for this platform.
*** If you are interested in seeing glibc on this platform visit
*** the "How to submit a new port" in the wiki:
***   https://sourceware.org/glibc/wiki/#Development
*** and join the community!
builder for '/nix/store/mqvnddf484qxlf3q8d1d73pqjm0c8abh-glibc-2.32.drv' failed with exit code 1
error: build of '/nix/store/mqvnddf484qxlf3q8d1d73pqjm0c8abh-glibc-2.32.drv' failed

cc @vcunat @SuperSandro2000

@cresh
Copy link
Contributor Author

cresh commented Nov 11, 2020

First of all, I think that you meant @edolstra and not @eelco, please check in maintainers/maintainer-list.nix first which GitHub handle is actually associated with a maintainer.

Sorry, I didn't know about that indirection, I'll keep it in mind for the future.

Also, do you have something like NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 set in your environment? Because glibc is actually supported for Linux platforms only and shouldn't even evaluate on darwin.

Yes, I do have that environment variable set; and I actually do not want to install glibc on my system directly, it is a failed transitive dependency for clj-kondo, which I actually meant to install. For this bug report I just narrowed it down to the glibc problem:

builder for '/nix/store/wnq9m218wjbk418m2b8gsng1s8kamacn-glibc-2.32.drv' failed with exit code 1
cannot build derivation '/nix/store/zgbfm456d29mam2xg1kbdh5sip20rb00-graalvm11-ce-20.2.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/4l8kxsrv7pzwgdfv3nnz7jgfqli31cql-clj-kondo-2020.11.07.drv': 1 dependencies couldn't be built
error: build of '/nix/store/4l8kxsrv7pzwgdfv3nnz7jgfqli31cql-clj-kondo-2020.11.07.drv' failed

Thanks for looking into it!

@Gaelan
Copy link
Contributor

Gaelan commented Nov 12, 2020

#103517 fixes this.

@veprbl veprbl linked a pull request Nov 12, 2020 that will close this issue
10 tasks
@Ma27 Ma27 removed their assignment Jan 7, 2021
@veprbl
Copy link
Member

veprbl commented Jan 29, 2021

The patch was fixed in #107744. Native compilation is not supported:

configure: error: 
*** The GNU C library is currently unavailable for this platform.
*** If you are interested in seeing glibc on this platform visit
*** the "How to submit a new port" in the wiki:
***   https://sourceware.org/glibc/wiki/#Development
*** and join the community!

@veprbl veprbl closed this as completed Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants