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

qemu: add option to build with gtk support #38930

Merged
merged 1 commit into from Apr 17, 2018
Merged

Conversation

xeji
Copy link
Contributor

@xeji xeji commented Apr 14, 2018

Motivation for this change

Fix #30889 . Default SDL rendering of qemu window is ugly and often not readable, in particular when using a tiling window manager.

Add a build option gtkSupport to build qemu with gtk3 support.

Edit: modified to enable gtk support by default, except for qemu_xen (doesn't need graphics at all).

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.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: qemu

Partial log (click to expand)

copying path '/nix/store/nkq7ywyvjq9p6rgcn5f61s9qh5xld2q2-libsndfile-1.0.28' from 'https://cache.nixos.org'...
copying path '/nix/store/qb6z58qld6ln7kszipmbyfxv72x5cfpq-libxkbcommon-0.8.0' from 'https://cache.nixos.org'...
copying path '/nix/store/2mh6bd3z41fbfg01fbra2ah14k3lzg5h-libGL-1.0.0' from 'https://cache.nixos.org'...
copying path '/nix/store/a0n3v8dnrcwq13mxj8q0sh8vwzizgbk1-epoxy-1.5.0' from 'https://cache.nixos.org'...
copying path '/nix/store/8xhrf6qs1a43m3ii9r98c03411587x65-libpulseaudio-11.1' from 'https://cache.nixos.org'...
copying path '/nix/store/yy1il37p3jj3rf9b9f8nihz7cs6s43iw-spice-0.13.3' from 'https://cache.nixos.org'...
copying path '/nix/store/zq4lxmc0p1wgk6a8vdilf87v0fl9kbj6-virglrenderer-0.6.0' from 'https://cache.nixos.org'...
copying path '/nix/store/3frd3gq4b8aiapsq8fa04nbv5jdpxkks-SDL2-2.0.8' from 'https://cache.nixos.org'...
copying path '/nix/store/b8qf60pk0jv5sply5w0247bdksp3d8pp-qemu-2.11.1' from 'https://cache.nixos.org'...
/nix/store/b8qf60pk0jv5sply5w0247bdksp3d8pp-qemu-2.11.1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: qemu

Partial log (click to expand)

  /nix/store/sxnnrjn39q5wlg5nv4jcs1j67m4p45k2-spice-0.13.3
  /nix/store/wa91x76iqn3xf5ia438rd26xa9809g0d-virglrenderer-0.6.0
  /nix/store/wgfwg2saldxdn4cfkk1c3jjxrfamddhg-celt-0.5.1.3
copying path '/nix/store/8gldsnsy6p06pqqmzxmghfw2pw2ddgmb-usbredir-0.7.1' from 'https://cache.nixos.org'...
copying path '/nix/store/fhg27g0v7c302p9z58392wr0cpbcpl4p-vde2-2.3.2' from 'https://cache.nixos.org'...
copying path '/nix/store/wa91x76iqn3xf5ia438rd26xa9809g0d-virglrenderer-0.6.0' from 'https://cache.nixos.org'...
copying path '/nix/store/wgfwg2saldxdn4cfkk1c3jjxrfamddhg-celt-0.5.1.3' from 'https://cache.nixos.org'...
copying path '/nix/store/sxnnrjn39q5wlg5nv4jcs1j67m4p45k2-spice-0.13.3' from 'https://cache.nixos.org'...
copying path '/nix/store/qnvwl8fpjqqql9mb3fskbbj25pwnchhx-qemu-2.11.1' from 'https://cache.nixos.org'...
/nix/store/qnvwl8fpjqqql9mb3fskbbj25pwnchhx-qemu-2.11.1

@@ -55,6 +56,7 @@ stdenv.mkDerivation rec {
++ optionals numaSupport [ numactl ]
++ optionals pulseSupport [ libpulseaudio ]
++ optionals sdlSupport [ SDL2 ]
++ optionals gtkSupport [ gtk3 gettext gnome3.vte-ng ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is not standard vte enough? vte-ng is a fork that exposes some internal APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Changed to standard vte, doesn't seem to make a difference.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: qemu

Partial log (click to expand)

/nix/store/qnvwl8fpjqqql9mb3fskbbj25pwnchhx-qemu-2.11.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: qemu

Partial log (click to expand)

/nix/store/b8qf60pk0jv5sply5w0247bdksp3d8pp-qemu-2.11.1

@xeji
Copy link
Contributor Author

xeji commented Apr 14, 2018

@GrahamcOfBorg build qemu_test_gtk

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: qemu_test_gtk

Partial log (click to expand)

strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/6dxjzcpjxgyy69hsxyrwblq4wx1mxhpi-qemu-host-cpu-only-for-vm-tests-2.11.1/libexec  /nix/store/6dxjzcpjxgyy69hsxyrwblq4wx1mxhpi-qemu-host-cpu-only-for-vm-tests-2.11.1/bin 
patching script interpreter paths in /nix/store/6dxjzcpjxgyy69hsxyrwblq4wx1mxhpi-qemu-host-cpu-only-for-vm-tests-2.11.1
checking for references to /build in /nix/store/6dxjzcpjxgyy69hsxyrwblq4wx1mxhpi-qemu-host-cpu-only-for-vm-tests-2.11.1...
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/6dxjzcpjxgyy69hsxyrwblq4wx1mxhpi-qemu-host-cpu-only-for-vm-tests-2.11.1

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: qemu_test_gtk

Partial log (click to expand)

strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/n1as7i1l9jjrhqp95f0bklysqfnr8q5d-qemu-host-cpu-only-for-vm-tests-2.11.1/libexec  /nix/store/n1as7i1l9jjrhqp95f0bklysqfnr8q5d-qemu-host-cpu-only-for-vm-tests-2.11.1/bin
patching script interpreter paths in /nix/store/n1as7i1l9jjrhqp95f0bklysqfnr8q5d-qemu-host-cpu-only-for-vm-tests-2.11.1
checking for references to /build in /nix/store/n1as7i1l9jjrhqp95f0bklysqfnr8q5d-qemu-host-cpu-only-for-vm-tests-2.11.1...
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/n1as7i1l9jjrhqp95f0bklysqfnr8q5d-qemu-host-cpu-only-for-vm-tests-2.11.1

@@ -13870,6 +13870,7 @@ with pkgs;
qemu_xen_4_10-light = lowPrio (qemu.override { hostCpuOnly = true; xenSupport = true; xen = xen_4_10-light; });

qemu_test = lowPrio (qemu.override { hostCpuOnly = true; nixosTestRunner = true; });
qemu_test_gtk = lowPrio (qemu.override { hostCpuOnly = true; nixosTestRunner = true; gtkSupport = true; });
Copy link
Member

Choose a reason for hiding this comment

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

Why do you change qemu_test = instead of qemu?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

qemu_test is the variant used by nixos tests and nixos-build-vms, so it is convenient to have a prebuilt version of this with gtk support. Of course one could add qemu_gtk and qemu_kvm_gtk but I didn't want to create too many variants in all_packages.nix.

Copy link
Contributor Author

@xeji xeji Apr 14, 2018

Choose a reason for hiding this comment

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

Instead of creating more variants, we could also consider enabling gtk support by default. Probably just a question of closure size...
Edit: building with gtk support increases qemu_test closure size from 240MB to 349MB.

Copy link
Member

Choose a reason for hiding this comment

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

So the only thing, which qemu_test, but not qemu is a patch for 9p. If that would be added there as well, one could just use qemu in place for system.build.qemu. If then gtk3 support is enabled as well in qemu, there would be no need for a separate qemu_gtk.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That patch overrides some 9p permission checks and should not be used in production for security reasons, so we do need a separate qemu_test. Anyway, why don't we keep it simple and enable gtk3 support by default (except for qemu-xen which never needs graphics and should be kept small)? We can add variants later as needed.

@xeji
Copy link
Contributor Author

xeji commented Apr 15, 2018

Updated to enable gtk3 support by default except for qemu_xen. This way no additional variants need to be added to top-level/all-packages.nix.

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: qemu

Partial log (click to expand)

  CC      ppc-linux-user/target/ppc/cpu-models.o
  CC      mipsel-linux-user/linux-user/strace.o
  CC      or1k-softmmu/target/openrisc/gdbstub.o
  CC      mips-linux-user/target/mips/lmi_helper.o
  CC      aarch64-softmmu/hw/display/virtio-gpu.o
  CC      ppc-softmmu/hw/virtio/virtio.o
  CC      mips-linux-user/target/mips/helper.o
  CC      hppa-linux-user/target/hppa/helper.o
building of '/nix/store/scski0wi610bq7srckycxkds9b41z1l1-qemu-2.11.1.drv' timed out after 3600 seconds
�[31;1merror:�[0m build of '/nix/store/scski0wi610bq7srckycxkds9b41z1l1-qemu-2.11.1.drv' failed

@xeji
Copy link
Contributor Author

xeji commented Apr 16, 2018

@GrahamcOfBorg build qemu_kvm

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: qemu_kvm

Partial log (click to expand)

strip is /nix/store/j7d4mr0ikv974ig7yzhknpsq288js4bs-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/xjijv7s7d6s5801ckh1r44rmik0y825m-qemu-host-cpu-only-2.11.1/libexec  /nix/store/xjijv7s7d6s5801ckh1r44rmik0y825m-qemu-host-cpu-only-2.11.1/bin
patching script interpreter paths in /nix/store/xjijv7s7d6s5801ckh1r44rmik0y825m-qemu-host-cpu-only-2.11.1
checking for references to /build in /nix/store/xjijv7s7d6s5801ckh1r44rmik0y825m-qemu-host-cpu-only-2.11.1...
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/xjijv7s7d6s5801ckh1r44rmik0y825m-qemu-host-cpu-only-2.11.1

@xeji
Copy link
Contributor Author

xeji commented Apr 16, 2018

Don't understand why ofborg didn't build this on x86_64-linux, so try again.
@GrahamcOfBorg build qemu_kvm

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: qemu_kvm

Partial log (click to expand)

/nix/store/xjijv7s7d6s5801ckh1r44rmik0y825m-qemu-host-cpu-only-2.11.1

@xeji
Copy link
Contributor Author

xeji commented Apr 16, 2018

@grahamc looks like ofborg stopped building PRs on x86_64-linux about a day ago.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: qemu_kvm

Partial log (click to expand)

strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1/libexec  /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1/bin
patching script interpreter paths in /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1
checking for references to /build in /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1...
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: qemu_kvm

Partial log (click to expand)

strip is /nix/store/j75dgadrff2d1fyc4fczmcgqkid2imdx-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1/libexec  /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1/bin
patching script interpreter paths in /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1
checking for references to /build in /nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1...
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
cannot find section .dynamic
/nix/store/yf2q1pf2x8bf8p02nd6n6sdcr1i5vql7-qemu-host-cpu-only-2.11.1

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: qemu

Partial log (click to expand)

  CC      ppc-softmmu/hw/ppc/mpc8544ds.o
  CC      ppc-softmmu/hw/ppc/e500plat.o
  CC      ppc-softmmu/hw/ppc/mpc8544_guts.o
  CC      ppc-softmmu/hw/ppc/ppce500_spin.o
  CC      ppc-softmmu/hw/ppc/virtex_ml507.o
  CC      ppc-softmmu/target/ppc/cpu-models.o
  CC      ppc-softmmu/target/ppc/cpu.o
  CC      ppc-softmmu/target/ppc/translate.o
building of '/nix/store/shnl0r8hbxpz4iqm1xazi47z62wivlfa-qemu-2.11.1.drv' timed out after 3600 seconds
error: build of '/nix/store/shnl0r8hbxpz4iqm1xazi47z62wivlfa-qemu-2.11.1.drv' failed

@xeji
Copy link
Contributor Author

xeji commented Apr 17, 2018

Failures of full qemu build are timeouts - builds locally but takes a while.

@Mic92 Mic92 merged commit f21e931 into NixOS:master Apr 17, 2018
@xeji xeji deleted the qemu-gtk branch April 17, 2018 11:46
@oxij
Copy link
Member

oxij commented Apr 22, 2018 via email

@xeji
Copy link
Contributor Author

xeji commented Apr 22, 2018

??? this was merged 5 days ago...

@oxij
Copy link
Member

oxij commented Apr 22, 2018

Ah, sorry. Github or email bugged out, I guess. I didn't get the merge notification and my local patch tracker (which parses github mail) still marks this as unmerged. I wonder how many more "open" issues are actually closed... =/

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