Skip to content

python312Packages.pygame: mark as broken on darwin#399467

Merged
GaetanLepage merged 1 commit intoNixOS:masterfrom
GaetanLepage:pygame
Apr 17, 2025
Merged

python312Packages.pygame: mark as broken on darwin#399467
GaetanLepage merged 1 commit intoNixOS:masterfrom
GaetanLepage:pygame

Conversation

@GaetanLepage
Copy link
Contributor

Things done

cc @emilytrau @LordGrimmauld

  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Apr 17, 2025
@github-actions github-actions bot added 6.topic: python Python is a high-level, general-purpose programming language. 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 Apr 17, 2025
Comment on lines +125 to +128
badPlatforms = [
# Several tests segfault
lib.systems.inspect.patterns.isDarwin
];
Copy link
Contributor

Choose a reason for hiding this comment

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

What happened to the good ol' broken = stdenv.hostPlatform.isDarwin 😄 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is functionally the same but provides a slightly more helpful error message. It is thus preferred AFAIK.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference in error message?

@GaetanLepage
Copy link
Contributor Author

  • meta.badPlatforms
Details
       error: Package ‘python3.12-pygame-2.6.1’ in /home/gaetan/nix/nixpkgs/pkgs/development/python-modules/pygame/default.nix:119 is not available on the requested hostPlatform:
         hostPlatform.config = "arm64-apple-darwin"
         package.meta.platforms = [
           "i686-cygwin"
           "x86_64-cygwin"
           "x86_64-darwin"
           "aarch64-darwin"
           "i686-freebsd"
           "x86_64-freebsd"
           "aarch64-freebsd"
           "x86_64-solaris"
           "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"
           "aarch64-netbsd"
           "armv6l-netbsd"
           "armv7a-netbsd"
           "armv7l-netbsd"
           "i686-netbsd"
           "m68k-netbsd"
           "mipsel-netbsd"
           "powerpc-netbsd"
           "riscv32-netbsd"
           "riscv64-netbsd"
           "x86_64-netbsd"
           "i686-openbsd"
           "x86_64-openbsd"
           "x86_64-redox"
         ]
         package.meta.badPlatforms = [
           {
             kernel = {
               families = {
                 darwin = {
                   _type = "exec-format";
                   name = "darwin";
                 };
               };
             };
           }
         ]
       , refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
  • meta.broken
Details
       error: Package ‘python3.12-pygame-2.6.1’ in /home/gaetan/nix/nixpkgs/pkgs/development/python-modules/pygame/default.nix:119 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.

@doronbehar
Copy link
Contributor

You like how the message states that it is broken only for Darwin?

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

I totally agree that we should make an effort to make such evaluation errors more informative, and there are many common reasons one may encounter and that it'd have been nice if we could have use Nix to declare them etc. But that's a topic for an RFC.

@GaetanLepage GaetanLepage merged commit ede1419 into NixOS:master Apr 17, 2025
24 of 28 checks passed
@GaetanLepage GaetanLepage deleted the pygame branch April 17, 2025 15:36
@LordGrimmauld
Copy link
Contributor

Would have been nice to link an issue or hydra log of this failing, if only just for better searchability later

@GaetanLepage
Copy link
Contributor Author

Would have been nice to link an issue or hydra log of this failing, if only just for better searchability later

Sure! Opened #399729.

I was not able to get hydra logs as I am getting 500 errors.

@LordGrimmauld LordGrimmauld mentioned this pull request Apr 20, 2025
13 tasks
@Rhys-T
Copy link
Contributor

Rhys-T commented Apr 20, 2025

It looks like the pygame-ce package needs this as well.

I'm currently bisecting pygame to try and figure out what's going on with this.

@GaetanLepage
Copy link
Contributor Author

GaetanLepage commented Apr 20, 2025

It looks like the pygame-ce package needs this as well.

Sure. I opened #400378 and #400379.

@Rhys-T
Copy link
Contributor

Rhys-T commented Apr 20, 2025

…I may have just told you the wrong thing. I thought it was having the same problem, since it was getting a segfault during the tests. However, according to Hydra, pygame-ce is failing that way on every platform right now. So I'm no longer sure it's the same thing. Sorry for the confusion.

@LordGrimmauld
Copy link
Contributor

…I may have just told you the wrong thing. I thought it was having the same problem, since it was getting a segfault during the tests. However, according to Hydra, pygame-ce is failing that way on every platform right now. So I'm no longer sure it's the same thing. Sorry for the confusion.

Yes, you want 1435e1e from #400338 to unbrick pygame-ce. Try your darwin tests against that PR, see if that fixes it - it does fix linux platforms.

@GaetanLepage
Copy link
Contributor Author

Yes, you want 1435e1e from #400338 to unbrick pygame-ce. Try your darwin tests against that PR, see if that fixes it - it does fix linux platforms.

I have tried it just now.
It fixes the double-free error, but pygame-ce remains broken on darwin:

loading pygame.tests.font_test
/nix/store/mrvg4qq09d51w5s95v15y4ym05q009fd-stdenv-darwin/setup: line 1771: 78342 Segmentation fault: 11

This error is unrelated and we should merge your PR nonetheless.

@Rhys-T
Copy link
Contributor

Rhys-T commented Apr 20, 2025

font_test was the one that the original pygame was segfaulting on. Sounds to me like pygame-ce has both that issue and the surface_test double-free one.

Edit: Still working on tracking down the issue - git bisect is being weird and returning a commit that does nothing but bump the version numbers, even though I can confirm that a previous commit has the issue too. I think the merges are confusing it or something…

Edit 2: Nope, it was just failing earlier than I thought. This may take a while…

@GaetanLepage
Copy link
Contributor Author

font_test was the one that the original pygame was segfaulting on. Sounds to me like pygame-ce has both that issue and the surface_test double-free one.

Yes exactly.

@Rhys-T
Copy link
Contributor

Rhys-T commented Apr 21, 2025

Update: I'm getting the font_test crash even in pygame 2.5.2, which was previously working. So now it kinda looks like one of the dependencies must have changed something.

To reproduce:

$ git clone https://github.com/NixOS/nixpkgs
[...]
$ cd nixpkgs
$ git checkout 623c61704e5f642d85f94757ee1f63343768c34c pkgs/development/python-modules/pygame
Updated 2 paths from 2becbb829bc6
$ sed -E -i.bak '
quote> /"/! s/SDL2($|[^_])/_classic\1/g
quote> s/AppKit/apple-sdk/g
quote> ' pkgs/development/python-modules/pygame/default.nix
$ nix-build -A python3Packages.pygame
[many lines of output, followed by a segfault in pygame.tests.font_test]

I tried nix-build --checking the working 2.5.2 derivation from 623c617, in case something had changed in macOS that was causing the build to fail, but that one still works fine.

Continuing to investigate…

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

Labels

6.topic: darwin Running or building packages on Darwin 6.topic: python Python is a high-level, general-purpose programming language. 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.

4 participants