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

rpm: declare darwin as badPlatform #268572

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

katexochen
Copy link
Contributor

@katexochen katexochen commented Nov 19, 2023

Description of changes

Support by rpm for darwin got removed in #196350.

This will be fixed once apple_sdk > 13.0 is available and we can check for that version.

Not sure if I got every package that (transitively) depends on rpm. Is there any good way to check this?

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/)
  • 23.11 Release Notes (or backporting 23.05 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.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 19, 2023
@katexochen katexochen added the 0.kind: bug Something is broken label Nov 20, 2023
Copy link
Contributor

@reckenrode reckenrode left a comment

Choose a reason for hiding this comment

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

Looks good from a Darwin perspective.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 20, 2023
@katexochen katexochen added the 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign label Nov 20, 2023
@delroth delroth added 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people and removed 12.approvals: 1 This PR was reviewed and approved by one reputable person labels Nov 20, 2023
vcunat
vcunat previously requested changes Nov 20, 2023
Copy link
Member

@vcunat vcunat left a comment

Choose a reason for hiding this comment

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

Can we explain why this is even needed? AFAIK it's acting transitively

$ nix eval -f. --argstr system x86_64-darwin apkg.outPath
error: Package ‘rpm-4.18.1’ in pkgs/tools/package-management/rpm/default.nix:72 is not available on the requested hostPlatform:

@katexochen
Copy link
Contributor Author

katexochen commented Nov 20, 2023

@vcunat Maybe I understood things wrong. I'm trying to fix these evaluation errors thrown by hydra:
https://hydra.nixos.org/jobset/nixpkgs/trunk#tabs-errors

in job ‘libmodulemd.x86_64-darwin’:
error:
       … while calling the 'deepSeq' builtin

         at /nix/store/0555ml133awcl3gyl5v0lh93hbp3nngh-source/lib/customisation.nix:288:7:

          287|     in if drv == null then null else
          288|       lib.deepSeq drv' drv';
             |       ^
          289|

       … while evaluating the attribute 'outPath'

         at /nix/store/0555ml133awcl3gyl5v0lh93hbp3nngh-source/lib/customisation.nix:277:13:

          276|           value = commonAttrs // {
          277|             outPath = output.outPath;
             |             ^
          278|             drvPath = output.drvPath;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: Failed to evaluate rpm-4.18.1: «unsupported»: is not available on the requested hostPlatform:
         hostPlatform.config = "x86_64-apple-darwin"
         package.meta.platforms = [
           "aarch64-linux"
           "armv5tel-linux"
           "armv6l-linux"
           "armv7a-linux"
           "armv7l-linux"
           "i686-linux"
           "loongarch64-linux"
           "m68k-linux"
           "microblaze-linux"
           "microblazeel-linux"
           "mips-linux"
           "mips64-linux"
           "mips64el-linux"
           "mipsel-linux"
           "powerpc64-linux"
           "powerpc64le-linux"
           "riscv32-linux"
           "riscv64-linux"
           "s390-linux"
           "s390x-linux"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]

@vcunat
Copy link
Member

vcunat commented Nov 20, 2023

Right, the amount of eval warnings is a long-standing problem. I don't know off the top of my head what's the best approach here. Maybe this PR really is the best one.

@Artturin
Copy link
Member

Artturin commented Nov 20, 2023

This is incorrect, the proper way seems to be setting badPlatforms in rpm to make it and it's dependants not show up on hydra https://ryantm.github.io/nixpkgs/stdenv/meta/#var-meta-badPlatforms

@katexochen
Copy link
Contributor Author

This is incorrect, the proper way seems to be setting badPlatforms in rpm to make it and it's dependants not show up on hydra https://ryantm.github.io/nixpkgs/stdenv/meta/#var-meta-badPlatforms

Thanks @Artturin, this looks like the thing I want to do. Do I also need to add darwin back under platforms when setting badPlatforms = platforms.darwin; ?

@delroth delroth removed the 12.approvals: 3+ This PR was reviewed and approved by three or more reputable people label Nov 21, 2023
@katexochen katexochen changed the title tree-wide: mark rpm dependents broken on darwin rpm: declare darwin as badPlatform Nov 22, 2023
@Artturin
Copy link
Member

There should be a comment about when darwin can be readded

@Artturin Artturin merged commit 8f45e49 into NixOS:master Nov 24, 2023
21 checks passed
Copy link
Contributor

Successfully created backport PR for release-23.11:

@Artturin
Copy link
Member

Artturin commented Nov 24, 2023

Let's see if it works but we should not do this for each individual package which isn't supported on some platform. Instead, the root issue should be fixed.

@katexochen katexochen deleted the rpm/broken-darwin-dependants branch November 24, 2023 22:06
@katexochen
Copy link
Contributor Author

katexochen commented Nov 24, 2023

Let's see if it works but we should not do this for each individual package which isn't supported on some platform. Instead, the root issue should be fixed.

@Artturin So what is/was the root cause in your opinion? And how could a more general solution look like?

@katexochen
Copy link
Contributor Author

Seems like the fix didn't work, the evaluation errors are still there: https://hydra.nixos.org/eval/1802300#tabs-errors

@rb2k
Copy link
Contributor

rb2k commented Jun 4, 2024

It's been a while and I'm vaguely sorry to necromance this PR, but I am just doing some digging into what it would take to get microdnf to compile again on darwin and this is probably one of the best places for people to find this information :)

Upstream RPM can be built on darwin again starting with 4.19.1.1:
rpm-software-management/rpm#2807

So if this gets upgraded, this might be build-able again. Maybe I can convince some of my colleagues to take a look.

@reckenrode
Copy link
Contributor

It’s possible, but it may also still require a newer SDK than is available currently in nixpkgs. I’m going to be working on a refactor and update for 24.11, but that’s not ready (or started) yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants