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

xquartz: fix build #40407

Merged
merged 1 commit into from May 19, 2018
Merged

xquartz: fix build #40407

merged 1 commit into from May 19, 2018

Conversation

vcunat
Copy link
Member

@vcunat vcunat commented May 12, 2018

Things done:

  • use libGLU instead of mesa for darwin support
  • move patches from local to github url
  • fixup xquartz install

There may still be some issues at runtime. PRs welcome!

Fixes #40196

(cherry picked from commit c839771)

Motivation for this change
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/)
  • Fits CONTRIBUTING.md.

@vcunat
Copy link
Member Author

vcunat commented May 12, 2018

@GrahamcOfBorg build xorg.xorgserver

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: xorg.xorgserver

Partial log (click to expand)

Cannot nix-instantiate `xorg.xorgserver' because:
�[31;1merror:�[0m while evaluating the attribute 'postInstall' of the derivation 'xorg-server-1.19.6' at �[1m/var/lib/gc-of-borg/nix-test-rs-27/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-27/pkgs/stdenv/generic/make-derivation.nix�[0m:148:11:
attribute 'mesa' missing, at �[1m/var/lib/gc-of-borg/nix-test-rs-27/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-aarch64-community-27/pkgs/servers/x11/xorg/overrides.nix�[0m:514:42

@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: xorg.xorgserver

Partial log (click to expand)

Cannot nix-instantiate `xorg.xorgserver' because:
error: while evaluating the attribute 'postInstall' of the derivation 'xorg-server-1.19.6' at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/stdenv/generic/make-derivation.nix:148:11:
attribute 'mesa' missing, at /var/lib/gc-of-borg/nix-root/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/gleber-bastion/pkgs/servers/x11/xorg/overrides.nix:514:42

@matthewbauer
Copy link
Member

Does this work as expected for you? I was a little concerned that there might still be some patches needed.

cairo epoxy;
inherit (buildPackages) pkgconfig xmlto asciidoc flex bison;
inherit (darwin) apple_sdk cf-private libobjc;
bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
mesa = libGL;
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this is still needed somewhere (eval fail)

Copy link
Member Author

Choose a reason for hiding this comment

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

I know and have a fix; I'm just looking at other things in the meantime.

Copy link
Member

Choose a reason for hiding this comment

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

Yes i think abbradar’s commit is needed to cherrypick.

@vcunat
Copy link
Member Author

vcunat commented May 12, 2018

On 18.03 it doesn't even build. I don't have a Darwin, and that's why I created the PR to use the Borg.

Things done:

- use libGLU instead of mesa for darwin support
- move patches from local to github url
- fixup xquartz install

There may still be some issues at runtime. PRs welcome!

Fixes NixOS#40196

(cherry picked from commit c839771)
@vcunat vcunat added 6.topic: darwin Running or building packages on Darwin 8.has: port to stable A PR already has a backport to the stable release. labels May 12, 2018
@vcunat
Copy link
Member Author

vcunat commented May 12, 2018

@matthewbauer if you (or someone else) can test this on 18.03, that would be great. Even if not and borg confirms it builds, I'd merge it. I'm confident non-Darwin platforms won't get broken.

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: xquartz

Partial log (click to expand)


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.


@GrahamcOfBorg
Copy link

No attempt on x86_64-linux (full log)

The following builds were skipped because they don't evaluate on x86_64-linux: xquartz

Partial log (click to expand)


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.


@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: xquartz

Partial log (click to expand)

no configure script, doing nothing
installing
post-installation fixup
gzipping man pages under /nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz/share/man/
strip is /nix/store/8v9y23q86l8y6kip8110m0d3343ar3al-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz/lib  /nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz/bin
patching script interpreter paths in /nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz
/nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz/bin/startx: interpreter directive changed from "/bin/sh" to "/nix/store/i2wr98av5x68cif4z9zzkq37i5ji74dq-bash-4.4-p12/bin/sh"
/nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz/lib/X11/xinit/privileged_startx.d/privileged: interpreter directive changed from "/bin/sh" to "/nix/store/i2wr98av5x68cif4z9zzkq37i5ji74dq-bash-4.4-p12/bin/sh"
/nix/store/6wbhfsqs3h3niidgcbwzpg3yg0apbcnf-xquartz

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: xorg.xorgserver

Partial log (click to expand)

make[2]: Leaving directory '/private/tmp/nix-build-xorg-server-1.18.4.drv-0/xorg-server-1.18.4'
make[1]: Leaving directory '/private/tmp/nix-build-xorg-server-1.18.4.drv-0/xorg-server-1.18.4'
propagating requisites
post-installation fixup
gzipping man pages under /nix/store/7k47c7qgxijz0cxx8kzjlqvfryqrqlrk-xorg-server-1.18.4/share/man/
strip is /nix/store/8v9y23q86l8y6kip8110m0d3343ar3al-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/7k47c7qgxijz0cxx8kzjlqvfryqrqlrk-xorg-server-1.18.4/lib  /nix/store/7k47c7qgxijz0cxx8kzjlqvfryqrqlrk-xorg-server-1.18.4/bin
patching script interpreter paths in /nix/store/7k47c7qgxijz0cxx8kzjlqvfryqrqlrk-xorg-server-1.18.4
/nix/store/7k47c7qgxijz0cxx8kzjlqvfryqrqlrk-xorg-server-1.18.4/Applications/XQuartz.app/Contents/MacOS/X11: interpreter directive changed from "/bin/bash" to "/nix/store/i2wr98av5x68cif4z9zzkq37i5ji74dq-bash-4.4-p12/bin/bash"
/nix/store/7k47c7qgxijz0cxx8kzjlqvfryqrqlrk-xorg-server-1.18.4

@matthewbauer
Copy link
Member

@vcunat can you check out this failure on Hydra:

https://hydra.nixos.org/build/74047022

It might be caused by my commit, but I honestly have no idea what is going on there. It could be unrelated but I'm not sure if anyone else has been messing with xorg stuff.

@matthewbauer
Copy link
Member

matthewbauer commented May 12, 2018

So, it looks like it has to do with the s/mesa_noglu/libGLU/ change. I misread the original as mesa_glu and libGLU = libGLDarwinOr mesa_glu. I believe to work correctly you would have to do something like this as an arg:

mesa_noglu = (if stdenv.isDarwin then libGLDarwin else mesa_noglu);

BTW I find the libGLDarwinOr incredibly confusing to work with. I don't have any time right now but if anyone can, a commit replacing all libGLDarwinOr with if stdenv.isDarwin then libGLDarwin else alternative would make things much more verbose. Not sure which style is preferred but using the if statement each time is clearer to me.

@vcunat Are you able to take care of this? I am not on a Linux system right now so can't debug but the above change should work. I will be available tomorrow (UTC-5) though if no one has gotten to it yet.

@vcunat
Copy link
Member Author

vcunat commented May 13, 2018

Yes, that failure gets fixed when I revert your commit. That's on master. Curiously, here in this PR the build does not get broken (I tested that yesterday). I'll try to fix master later today (in ~12h).

@vcunat
Copy link
Member Author

vcunat commented May 13, 2018

For reference, the Linux problem on master should've been solved by #40438.

@vcunat vcunat merged commit 7e14bdc into NixOS:release-18.03 May 19, 2018
vcunat added a commit that referenced this pull request May 19, 2018
@vcunat vcunat deleted the p/xquartz-18.03 branch May 19, 2018 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin 8.has: port to stable A PR already has a backport to the stable release. 10.rebuild-darwin: 11-100 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants