nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

sdl3: fix cross compilation

Open uninsane opened this issue 6 months ago • 9 comments

  • fixes nix-build -A pkgsCross.aarch64-multiplatform.sdl3

may require cherry-picking this ibusMinimal buildfix as sdl3 has ibusMinimal as a build input, but these PRs can be merged in any order.

Things done

  • Built on platform(s)
    • [x] 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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • [ ] (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • [ ] (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
  • [x] Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a :+1: reaction to pull requests you find important.

uninsane avatar Jun 21 '25 07:06 uninsane

cc @NixOS/sdl @getchoo

marcin-serwin avatar Jun 21 '25 08:06 marcin-serwin

testSupport feels redundant here. Why not just finalAttrs.finalPackage.doCheck?

Aleksanaa avatar Jun 21 '25 08:06 Aleksanaa

Now that I look at it, these bmp files are already installed into libexec/installed-tests/SDL3 so this line should be just removed.

marcin-serwin avatar Jun 21 '25 15:06 marcin-serwin

feedback addressed:

  • no more testSupport callarg. branch on finalAttrs.finalPackage.doCheck instead (this is distinct from the toplevel doCheck, in that it's forced false whenever stdenv.buildPlatform.canExecute stdenv.hostPlatform is false).
  • deleted the test/*.bmp postInstall line.

confirmed that tests are still installed, and the package builds for native x86_64-linux & pkgsCross.aarch64-multiplatform.sdl3

uninsane avatar Jun 21 '25 18:06 uninsane

deleted the test/*.bmp postInstall line.

This causes the testtray binary to complain about missing assets. The intention was to eventually throw that stuff into VM tests, for which installing the test assets might have made sense.

LordGrimmauld avatar Jun 22 '25 10:06 LordGrimmauld

(a symlink might be fine though)

LordGrimmauld avatar Jun 22 '25 10:06 LordGrimmauld

This causes the testtray binary to complain about missing assets.

This is an issue with the testtray test upstream, I've opened https://github.com/libsdl-org/SDL/pull/13252 to address this.

marcin-serwin avatar Jun 22 '25 10:06 marcin-serwin

Fair enough, and probably the better fix! Good find.

LordGrimmauld avatar Jun 22 '25 11:06 LordGrimmauld

This causes the testtray binary to complain about missing assets.

This is an issue with the testtray test upstream, I've opened libsdl-org/SDL#13252 to address this.

should we fetchpatch it in this PR or leave it for a followup you think?

pbsds avatar Jun 22 '25 22:06 pbsds

Either is fine - sdl3 gets somewhat frequent updates, so chances are it'll be there once i get around to writing those tests. I won't block on this anymore!

LordGrimmauld avatar Jun 23 '25 08:06 LordGrimmauld

builds when i cherry pick this and the ibus fix on master

pbsds avatar Jun 24 '25 02:06 pbsds