Skip to content

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Feb 8, 2024

Without the change the build fails on staging-next as https://hydra.nixos.org/build/248863953/nixlog/2/tail:

/build/edk2-unvendored-src/CryptoPkg/Library/OpensslLib/openssl/crypto/property/property_parse.c:107:19: error: ‘INT64_MAX’ undeclared (first use in this function)
  107 |         if (v > ((INT64_MAX - (*s - '0')) / 10)) {
      |                   ^~~~~~~~~

The unbundled version of openssl nixpkgs injects into edk2 started using INT64_MAX that edk2's <stdint.h> does not provide and relies on openssl to define as a fallback.

Let's pull in openssl's own definition of those.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Without the change the build fails on `staging-next` as
https://hydra.nixos.org/build/248863953/nixlog/2/tail:

    /build/edk2-unvendored-src/CryptoPkg/Library/OpensslLib/openssl/crypto/property/property_parse.c:107:19: error: ‘INT64_MAX’ undeclared (first use in this function)
      107 |         if (v > ((INT64_MAX - (*s - '0')) / 10)) {
          |                   ^~~~~~~~~

The unbundled version of `openssl` `nixpkgs` injects into `edk2` started
using `INT64_MAX` that `edk2`'s `<stdint.h>` does not provide and relies
on `openssl` to define as a fallback.

Let's pull in `openssl`'s own definition of those.
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 8, 2024

# Fix missing INT64_MAX include that edk2 explicitly does not provide
# via it's own <stdint.h>. Let's pull in openssl's definition instead:
sed -i $out/CryptoPkg/Library/OpensslLib/openssl/crypto/property/property_parse.c \
Copy link
Member

Choose a reason for hiding this comment

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

Thank you <3.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 8, 2024
@adamcstephens
Copy link
Contributor

@ofborg test incus.virtual-machine

@delroth delroth added 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Feb 8, 2024
@vcunat vcunat merged commit f732e14 into NixOS:staging-next Feb 9, 2024
@trofi trofi deleted the OVMF-openssl-fix branch February 9, 2024 09:07
@github-actions
Copy link
Contributor

Successfully created backport PR for release-23.11:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants