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

sage: 8.0 -> 8.1, fix sandbox build #34291

Merged
merged 1 commit into from Jan 26, 2018
Merged

Conversation

timokau
Copy link
Member

@timokau timokau commented Jan 26, 2018

This updates sage to 8.1 and, more importantly, makes the build work sandboxed.

Motivation for this change

The sandboxed build was failing, because it relied heavily on /usr/bin/env. This is fixed with a lot of shebang patching (both to system packages and to sage-internal packages).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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/) (Well, there are too many to test all. But at least ./result/bin/sage)
  • Fits CONTRIBUTING.md.

The sandboxed build was failing, because it relied heavily on
/usr/bin/env. This is fixed with a lot of shebang patching (both
to system packages and to sage-internal packages).
@7c6f434c
Copy link
Member

@GrahamcOfBorg build sage

@7c6f434c
Copy link
Member

After looking at what is needed for a rebuild-everything-locally sandboxed build, I have gone into negative-amount-of-surprise about my failure to build it while reusing maxima-ecl etc. built externally…

@timokau
Copy link
Member Author

timokau commented Jan 26, 2018

Yeah, sage is a real pain! Lets just hope they don't change their build too much in the future.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

Package ‘sage-8.1’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-zoidberg/pkgs/applications/science/math/sage/default.nix:195 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

@7c6f434c
Copy link
Member

An optimist would hope that they would actually change their build in the future and make it easier to package with system versions of software! Oh well…

On the other hand, Debian does seem to be forcing Sage to reuse at least some of the dependencies from the outer system.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-linux

[openblas-0.2.20.p1] Warning: 'scale2' may be used uninitialized in this function [-Wmaybe-uninitialized]
[openblas-0.2.20.p1] gfortran -O2 -Wall -m64 -fPIC -c -o stpcon.o stpcon.f
[openblas-0.2.20.p1] gfortran -O2 -Wall -m64 -fPIC -c -o stprfs.o stprfs.f
[openblas-0.2.20.p1] gfortran -O2 -Wall -m64 -fPIC -c -o stptri.o stptri.f
[openblas-0.2.20.p1] stptri.f:229:0:
[openblas-0.2.20.p1] 
[openblas-0.2.20.p1]       $                     AP( JCLAST ), AP( JC+1 ), 1 )
[openblas-0.2.20.p1]  
building of ‘/nix/store/my9pnv0yd9wdblk0lzjk0w49rik53jax-sage-8.1.drv’ timed out after 1800 seconds
error: build of ‘/nix/store/my9pnv0yd9wdblk0lzjk0w49rik53jax-sage-8.1.drv’ failed

@7c6f434c
Copy link
Member

@grahamc timeout means no output for half an hour? Any way to see if there was a sudden load on the builder machine?

@grahamc
Copy link
Member

grahamc commented Jan 26, 2018

The timeout is for overall build time.

@7c6f434c
Copy link
Member

There goes my plan to improve builder utilisation…

@7c6f434c 7c6f434c merged commit bfc4d04 into NixOS:master Jan 26, 2018
@7c6f434c
Copy link
Member

(actually tested on my sandbox-enabled build brix)

Thanks!

@timokau
Copy link
Member Author

timokau commented Jan 27, 2018

Great, thanks!

@timokau
Copy link
Member Author

timokau commented Jan 29, 2018

This commit is included in nixos-unstable now, but not in the binary cache. Is that because the hydra build failed? I tried to navigate hydra.nixos.org, but I couldn't figure out how that is organized.

@7c6f434c
Copy link
Member

[giac-1.2.3.47.p0] ! LaTeX Error: File xcolor.sty' not found.`

I… don't understand what has happenned.

https://hydra.nixos.org/job/nixpkgs/trunk/sage.x86_64-linux
https://hydra.nixos.org/build/68286564
https://hydra.nixos.org/build/68286564/nixlog/2/raw

@timokau
Copy link
Member Author

timokau commented Jan 29, 2018

Well thats an easy fix, but how did that happen? Can it be that texlive.combine somehow breaks sandboxing? I have xcolor on my system (but did build with sandbox).

@7c6f434c
Copy link
Member

I am not really sure.

@timokau
Copy link
Member Author

timokau commented Jan 29, 2018

I opened an issue (#34387) about it, hopefully somebody more knowledgable about the sandbox and texlive-combined can explain and maybe fix the issue. Its probably better to wait for that before I make a PR for a fix, since there may be more latex packages missing and I don't want to abuse hydra as a test machine.

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

4 participants