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

edk2: Support build on macOS #85603

Merged
merged 4 commits into from May 4, 2020
Merged

edk2: Support build on macOS #85603

merged 4 commits into from May 4, 2020

Conversation

parthy
Copy link
Contributor

@parthy parthy commented Apr 20, 2020

Motivation for this change

Booting qemu tests with OVMF firmware on macOS requires the firmware files provided by these packages. With this change, the package builds out of the box. My first attempt was to use clang everywhere, but unfortunately, there are some assumptions in the edk2 build system that caused the clang build on Linux to fail.

Note: There seems to be an issue with temporary directories (AF_UNIX path name too long) on macOS, I had to run TMPDIR=/tmp nix-build default.nix -A OVMF .

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

In order to use OVMF firmware with e.g. qemu on macOS, these packages
needed to be made macOS ready. This meant choosing the clang build in
this case, because it is the only one working on macOS.

Unfortunately, just using clang on all platforms doesn't work because
there are hardcoded assumptions in the edk2 build system.
@tfc tfc requested review from abbradar, Ericson2314 and dezgeg and removed request for abbradar April 20, 2020 08:02
@tfc
Copy link
Contributor

tfc commented Apr 20, 2020

Tested this on Mac, LGTM.

@tfc
Copy link
Contributor

tfc commented Apr 24, 2020

@Mic92 can you have another look please?

@Mic92
Copy link
Member

Mic92 commented Apr 29, 2020

@GrahamcOfBorg build edk2

@@ -57,6 +57,6 @@ edk2.mkDerivation projectDscPath {
description = "Sample UEFI firmware for QEMU and KVM";
homepage = https://github.com/tianocore/tianocore.github.io/wiki/OVMF;
Copy link
Member

Choose a reason for hiding this comment

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

Please put the URL in the homepage field into quotes (RFC45).

@@ -38,15 +63,15 @@ edk2 = stdenv.mkDerivation {

enableParallelBuilding = true;

meta = with stdenv.lib; {
meta = with lib; {
description = "Intel EFI development kit";
homepage = https://sourceforge.net/projects/edk2/;
Copy link
Member

Choose a reason for hiding this comment

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

Please put the URL in the homepage field into quotes (RFC45).

@parthy parthy requested a review from prusnak May 4, 2020 14:01
@Mic92
Copy link
Member

Mic92 commented May 4, 2020

Result of nixpkgs-review pr 85603 1

@Mic92 Mic92 merged commit 2b08905 into NixOS:master May 4, 2020
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