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

binaryen: 102 -> 105; emscripten: 3.0.0 -> 3.1.10 #172741

Merged
merged 4 commits into from
Jun 17, 2022

Conversation

duxovni
Copy link
Contributor

@duxovni duxovni commented May 12, 2022

Description of changes

emscripten 3.1.1 and later include multiple fixes for nondeterministic build output; see emscripten-core/emscripten#15780 and emscripten-core/emscripten#15844.

I've combined the emscripten upgrade and the binaryen upgrade into one pull request, because emscripten breaks if either of them is upgraded without upgrading the other one (as in #159401).

Several packages with dependencies on emscripten/binaryen are broken; all of them were already broken on master and are unaffected by this change:

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.05 Release Notes (or backporting 21.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@willcohen
Copy link
Contributor

Result of nixpkgs-review pr 172741 run on x86_64-darwin 1

1 package marked as broken and skipped:
  • open-music-kontrollers.mephisto
2 packages built:
  • binaryen
  • emscripten

@willcohen
Copy link
Contributor

When testing a rebase of #172207 on top of this (to determine potential breakage), emscriptenPackages.zlib and emscriptenPackages.json_c still continue to build as noted on that PR, but the otherwise fixed emscriptenPackages.libxml2 now fails with the following error:

$ nix-build $NIXPKGS -A emscriptenPackages.libxml2
this derivation will be built:
  /nix/store/8qid47b023i2vx7wv1q2ixbjk1a70p8m-emscripten-libxml2-2.9.14.drv
building '/nix/store/8qid47b023i2vx7wv1q2ixbjk1a70p8m-emscripten-libxml2-2.9.14.drv'...
unpacking sources
unpacking source archive /nix/store/x8swlr47ad8y0v15ssbq2c8x5abnn602-libxml2-2.9.14.tar.xz
source root is libxml2-2.9.14
setting SOURCE_DATE_EPOCH to timestamp 1651491766 of file libxml2-2.9.14/libxml2.spec
patching sources
applying patch /nix/store/frr6f2hq56j6b4wc0bsklaqskjsagqc0-utf8-xmlErrorFuncHandler.patch
patching file python/libxml.c
Hunk #1 succeeded at 1621 (offset 1 line).
Hunk #2 succeeded at 1638 (offset 1 line).
autoreconfPhase
autoreconfPhase not used...
configuring
configure: ./configure --prefix=/nix/store/11kprvkv7gs87l1sgl1hl1l76kw6pk61-emscripten-libxml2-2.9.14 --without-python
checking whether to enable maintainer-specific portions of Makefiles... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /nix/store/5imadx3sbb1f2gqhxhw5rq5idwqj4mib-coreutils-9.0/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /nix/store/5imadx3sbb1f2gqhxhw5rq5idwqj4mib-coreutils-9.0/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... /nix/store/flviblq5i53jgpzj8s5dpw3pdppxycpl-emscripten-3.1.10/bin/emcc
checking whether the C compiler works... no
configure: error: in `/build/libxml2-2.9.14':
configure: error: C compiler cannot create executables
See `config.log' for more details
emconfigure: error: './configure --prefix=/nix/store/11kprvkv7gs87l1sgl1hl1l76kw6pk61-emscripten-libxml2-2.9.14 --without-python' failed (returned 77)
error: builder for '/nix/store/8qid47b023i2vx7wv1q2ixbjk1a70p8m-emscripten-libxml2-2.9.14.drv' failed with exit code 1

@willcohen willcohen self-requested a review May 17, 2022 15:32
@duxovni
Copy link
Contributor Author

duxovni commented May 17, 2022

Hmm, interesting. Looks like the error relates to https://github.com/emscripten-core/emscripten/blob/main/emcc.py#L2435-L2440 introduced in emscripten-core/emscripten#15905 ; when libxml2's configure script tries to build a trivial C program with emcc, the linker gets sad because it can't find the symbol __funcs_on_exit, which seems to be because the build flags include -nostdlib and no replacement is provided? I'm not clear on whether the misconfiguration is in libxml2 or in emscripten, though.

config.log

@Artturin Artturin added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label May 18, 2022
@duxovni
Copy link
Contributor Author

duxovni commented May 19, 2022

Ok, I was pretty far off the mark in my previous comment, tracked it down to an emscripten bug - when emcc is called from inside emconfigure and also needs to populate its cache from scratch, it incorrectly retains the EMMAKEN_JUST_CONFIGURE variable while building the cache. This, in conjunction with the atexit changes, causes those errors. It looks like a pretty simple fix, I'll link the PR here and we can backport the patch if needed.

@duxovni
Copy link
Contributor Author

duxovni commented May 19, 2022

@Artturin Artturin removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label May 22, 2022
Co-authored-by: Will Cohen <[email protected]>
@ofborg ofborg bot added the ofborg-internal-error Ofborg encountered an error label May 26, 2022
@duxovni
Copy link
Contributor Author

duxovni commented May 27, 2022

(Could also move this to emscripten 3.1.11 since that includes my PR, but that's failing to build for possibly-LLVM-related reasons that I don't really have time to investigate further :/)

@cole-h
Copy link
Member

cole-h commented May 27, 2022

@ofborg eval

@cole-h cole-h removed the ofborg-internal-error Ofborg encountered an error label May 27, 2022
@willcohen willcohen mentioned this pull request Jun 15, 2022
13 tasks
@SuperSandro2000 SuperSandro2000 merged commit 7b1e56a into NixOS:master Jun 17, 2022
@rhendric rhendric mentioned this pull request Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants