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

Update Gambit and Gerbil #44847

Merged
merged 3 commits into from Aug 12, 2018
Merged

Update Gambit and Gerbil #44847

merged 3 commits into from Aug 12, 2018

Conversation

fare
Copy link
Contributor

@fare fare commented Aug 9, 2018

Motivation for this change

Upstream update + make Gambit stable buildable with recent Nix.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@@ -2,6 +2,7 @@

callPackage ./build.nix {
version = "4.8.9";
git-version = "v${version}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eval error because this isn't a recursive set. Try using callPackage ./build.nix rec { to make it recursive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Thanks a lot! Fixed.

@@ -1,4 +1,4 @@
{ stdenv, git, openssl, autoconf, pkgs, makeStaticLibraries, version, SRC }:
{ stdenv, git, openssl, autoconf, pkgs, makeStaticLibraries, version, SRC, git-version }:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git-version argument isn't used anywhere. Why did you add it?

version = "4.8.9";
git-version = "v${version}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining git-version only makes sense if it is actually used by build.nix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well,

1- I include it by symmetry with gerbil, that actually uses it. I actually intended to use it in gambit in the very same way, but that requires changes to the gambit build system similar to those done in Gerbil, that haven't made it on top of my todo list yet.

2- It's somewhat useful for me to track the progress of gambit unstable, and needed by symmetry in the stable build, too.

3- If you object to it, I can make it a comment instead, until I get to modifying the gambit build system (and get the changes upstreamed).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for explaining. While I understand your intentions, unused code tends to confuse people and make packages harder to maintain - you might not be the only one modifying these in the future. So please remove the unused code but feel free to add your comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. I understand your concerns. Here is an updated version where only the unstable build has the git-version, and only in a comment.

fare added a commit to mighty-gerbils/gerbil-utils that referenced this pull request Aug 10, 2018
git-version will be commented out for gambit, until actually used.
NixOS/nixpkgs#44847
@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

@GrahamcOfBorg build gambit-unstable gerbil-unstable

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-darwin (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

clang-5.0: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
clang -O2 -Wno-deprecated-declarations -I"/usr/local/opt/openssl/include"   -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-math-errno -fmodulo-sched -fomit-frame-pointer -fPIC -fno-common   -I"../include" -c -o "_t-univ-2.o" -I. -DHAVE_CONFIG_H _t-univ-2.c -D___LIBRARY
clang-5.0: warning: optimization flag '-fmodulo-sched' is not supported [-Wignored-optimization-argument]
clang-5.0: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
clang -O2 -Wno-deprecated-declarations -I"/usr/local/opt/openssl/include"   -Wno-unused -Wno-write-strings -Wdisabled-optimization -fwrapv -fno-strict-aliasing -fno-math-errno -fmodulo-sched -fomit-frame-pointer -fPIC -fno-common   -I"../include" -c -o "_t-c-2.o" -I. -DHAVE_CONFIG_H _t-c-2.c -D___LIBRARY
clang-5.0: warning: optimization flag '-fmodulo-sched' is not supported [-Wignored-optimization-argument]
clang-5.0: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
building of '/nix/store/1igkjj9g5l4xxwrivhqf51prs0bdkag3-gambit-unstable-2018-08-06.drv' timed out after 1800 seconds
cannot build derivation '/nix/store/79xvdl57h4dfgr6xag2ysf6r6v9r83as-gerbil-unstable-2018-08-09.drv': 1 dependencies couldn't be built
error: build of '/nix/store/1igkjj9g5l4xxwrivhqf51prs0bdkag3-gambit-unstable-2018-08-06.drv', '/nix/store/79xvdl57h4dfgr6xag2ysf6r6v9r83as-gerbil-unstable-2018-08-09.drv' failed

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

It does take a lot of time to build it — tens of minutes on my machine from last year.

Also, I see you use clang. I believe gambit currently works better with GCC. How do I force the use of GCC for Gambit and Gerbil?

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

Excerpt from an email last May by Marc Feeley, author of Gambit, on the gambit-list:

the build time of a “make -j8” on my 4 core laptop is over 10x slower when using CLANG. As for speed of the generated code, CLANG produces code that is about 3x slower than GCC.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/lazy__1.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/sort__0.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/coroutine__0.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/pregexp__1.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/event__rt.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/generic__rt.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/std/test__1.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gx-gambc.o1
patching script interpreter paths in /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09
checking for references to /tmp/nix-build-gerbil-unstable-2018-08-09.drv-0 in /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09...

@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

clang is the default compiler on darwin (MacOS), while x86_64-linux and aar64_linux use gcc7.
Not sure we support gcc on darwin.

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

It makes total sense as a default on Darwin. But can I somehow override the default?

@GrahamcOfBorg
Copy link

Timed out, unknown build status on aarch64-linux (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

[*] Cleaning up bootstrap
[*] Building gerbil stdlib
... generate stdlib depgraph
... compile build-config
... compile format
... compile pregexp
... compile sort
... compile sugar
building of '/nix/store/8rfl3x1qxiv4vjz74rpkdnml76iq0hgb-gerbil-unstable-2018-08-09.drv' timed out after 3600 seconds
error: build of '/nix/store/8rfl3x1qxiv4vjz74rpkdnml76iq0hgb-gerbil-unstable-2018-08-09.drv' failed

@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

Timeouts on ofborg are not uncommon since ofborg uses community-provided build machines that don't guarantee good performance. These packages usually build on hydra (higher time limit and better performance), so it should be fine without any changes.

To force gcc on darwin, you can add stdenv = gccStdenv; for the package in all-packages.nix, see other examples there. No guarantees, it may time out on ofborg as well. But feel free to give it a try.

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

Thanks, xeji. I added a commit that forces Gambit and Gerbil to use GCC rather than Clang.

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

NB: I checked that these changes are NOPs on my Linux amd64 NixOS box.

@xeji
Copy link
Contributor

xeji commented Aug 10, 2018

@GrahamcOfBorg build gambit-unstable gerbil-unstable

@GrahamcOfBorg
Copy link

Failure on x86_64-darwin (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

 ^~~~~~~~~
kqueue__0.c:8750:12: error: 'NOTE_MACHTIME' undeclared (first use in this function); did you mean 'NOTE_CHILD'?
 ___return (NOTE_MACHTIME);
            ^
kqueue__0.c:8750:1: note: in expansion of macro '___return'
 ___return (NOTE_MACHTIME);
 ^~~~~~~~~
*** ERROR; build failed
builder for '/nix/store/4vmycbc1m85g9y64pi9m7y7n3lwkqwa0-gerbil-unstable-2018-08-09.drv' failed with exit code 1
error: build of '/nix/store/4vmycbc1m85g9y64pi9m7y7n3lwkqwa0-gerbil-unstable-2018-08-09.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gerbil/compiler/optimize-top__rt.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gerbil/compiler/optimize-ann__0.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gerbil/compiler/optimize-ann__rt.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gerbil/compiler/driver__rt.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gerbil/core$_expander-runtime___rt.o1
shrinking /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09/lib/gerbil/core$_sugar_$_sugar_1___rt.o1
patching script interpreter paths in /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09
checking for references to /build in /nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09...
/nix/store/hl80a5v4s4krkcrc8zsjl4yi0hf4404p-gambit-unstable-2018-08-06
/nix/store/w6nrvxn2dmf4pgrqgcr11nph2jfri0a9-gerbil-unstable-2018-08-09

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

@vyzo can you give a look at the darwin failure? If not, who is building Gerbil on Darwin?

@fare
Copy link
Contributor Author

fare commented Aug 10, 2018

This looks like a recent upstream bug in the new kqueue support.

@grahamc What version of macOS is the Nix builder running? How do I tell?

@GrahamcOfBorg
Copy link

Timed out, unknown build status on aarch64-linux (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

[*] Cleaning up bootstrap
[*] Building gerbil stdlib
... generate stdlib depgraph
... compile build-config
... compile format
... compile pregexp
... compile sort
... compile sugar
building of '/nix/store/8rfl3x1qxiv4vjz74rpkdnml76iq0hgb-gerbil-unstable-2018-08-09.drv' timed out after 3600 seconds
error: build of '/nix/store/8rfl3x1qxiv4vjz74rpkdnml76iq0hgb-gerbil-unstable-2018-08-09.drv' failed

@vyzo
Copy link

vyzo commented Aug 11, 2018

The darwin failure should be fixed by mighty-gerbils/gerbil#118

clang builds gambit 10x slower to produce code that is 3x slower than
when using GCC. So use GCC to build Gambit and Gerbil.
@fare
Copy link
Contributor Author

fare commented Aug 11, 2018

@GrahamcOfBorg build gambit-unstable gerbil-unstable

I updated this PR to include @vyzo's latest upstream fixes.

@7c6f434c
Copy link
Member

@GrahamcOfBorg build gambit-unstable gerbil-unstable

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/compiler/optimize-top__1.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/compiler/ssxi__1.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/compiler/optimize-top__rt.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/compiler/optimize-ann__0.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/compiler/optimize-ann__rt.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/compiler/driver__rt.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/core$_expander-runtime___rt.o1
shrinking /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11/lib/gerbil/core$_sugar_$_sugar_1___rt.o1
patching script interpreter paths in /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11
checking for references to /build in /nix/store/jqsaq6k804c2xfq0b2kjgn7dry0yr9nr-gerbil-unstable-2018-08-11...

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

TAG lang/scheme/time.ss
TAG lang/scheme/write-impl.ss
TAG lang/scheme/write.ss
[*] Done
installing
post-installation fixup
moving /nix/store/lf2rkp8d7vlqkrh2amrc479iraki6lrf-gerbil-unstable-2018-08-11/doc to /nix/store/lf2rkp8d7vlqkrh2amrc479iraki6lrf-gerbil-unstable-2018-08-11/share/doc
patching script interpreter paths in /nix/store/lf2rkp8d7vlqkrh2amrc479iraki6lrf-gerbil-unstable-2018-08-11
/nix/store/1v612hm9ihd7iid12vpy6ivr58016yg2-gambit-unstable-2018-08-06
/nix/store/lf2rkp8d7vlqkrh2amrc479iraki6lrf-gerbil-unstable-2018-08-11

@GrahamcOfBorg
Copy link

Timed out, unknown build status on aarch64-linux (full log)

Attempted: gambit-unstable, gerbil-unstable

Partial log (click to expand)

[*] Cleaning up bootstrap
[*] Building gerbil stdlib
... generate stdlib depgraph
... compile build-config
... compile format
... compile pregexp
... compile sort
... compile sugar
building of '/nix/store/zh9klqqlxd76b9zsaaw3g3rknmhqi40s-gerbil-unstable-2018-08-11.drv' timed out after 3600 seconds
error: build of '/nix/store/zh9klqqlxd76b9zsaaw3g3rknmhqi40s-gerbil-unstable-2018-08-11.drv' failed

@fare
Copy link
Contributor Author

fare commented Aug 11, 2018

Can we either add a larger timeout for AA64, or disable it wholly? As such, it's only a waste of CPU. Can this be overridden on a per-package basis?

@7c6f434c 7c6f434c merged commit f4f93d6 into NixOS:master Aug 12, 2018
@7c6f434c
Copy link
Member

Let me just say we don't block Chromium build attempts on ofBorg (obviously, they time out always and everywhere). No tooling is perfect

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.

None yet

5 participants