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 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 Apr 20, 2020
@tfc
tfc approved these changes Apr 20, 2020
@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
Contributor

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;

This comment has been minimized.

Copy link
@prusnak

prusnak May 2, 2020

Member

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/;

This comment has been minimized.

Copy link
@prusnak

prusnak May 2, 2020

Member

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

@parthy parthy requested a review from prusnak May 4, 2020
@Mic92
Copy link
Contributor

Mic92 commented May 4, 2020

Result of nixpkgs-review pr 85603 1

@Mic92 Mic92 merged commit 2b08905 into NixOS:master May 4, 2020
16 checks passed
16 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
edk2, edk2.passthru.tests on aarch64-linux Success
Details
edk2, edk2.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="faf984d"; rev="faf984d12de03cba018fe3099a1de1d607c038da"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.