Skip to content

tauon: 7.9.0 -> 8.0.1#405753

Merged
pbsds merged 2 commits intoNixOS:masterfrom
jansol:tauon
May 16, 2025
Merged

tauon: 7.9.0 -> 8.0.1#405753
pbsds merged 2 commits intoNixOS:masterfrom
jansol:tauon

Conversation

@jansol
Copy link
Copy Markdown
Contributor

@jansol jansol commented May 10, 2025

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/)
  • 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.

@github-actions github-actions Bot added the 6.topic: python Python is a high-level, general-purpose programming language. label May 10, 2025
@jansol jansol mentioned this pull request May 10, 2025
13 tasks
@nix-owners nix-owners Bot requested a review from natsukium May 10, 2025 01:42
@jansol jansol mentioned this pull request May 10, 2025
28 tasks
@github-actions github-actions 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 May 10, 2025
Comment thread pkgs/development/python-modules/pysdl3/default.nix Outdated
Comment thread pkgs/development/python-modules/pysdl3/default.nix Outdated
Comment thread pkgs/development/python-modules/pysdl3/default.nix Outdated
Comment thread pkgs/development/python-modules/pysdl3/default.nix Outdated
Comment thread pkgs/development/python-modules/pysdl3/default.nix Outdated
Comment thread pkgs/development/python-modules/pysdl3/default.nix Outdated
@jansol
Copy link
Copy Markdown
Contributor Author

jansol commented May 12, 2025

Eventually it to work with setupHook instead of patching. Still feels kind of brittle but eh 🤷.

At least tauon seems to be happy and in a nix develop nixpkgs#tauon shell importing sdl3 and calling sdl3.SDL_CreateWindow works as expected. (with a warning about a mismatch in the minor version of libSDL3_ttf but it'll have to live with that)

Copy link
Copy Markdown
Contributor

@marcin-serwin marcin-serwin left a comment

Choose a reason for hiding this comment

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

Thanks, it looks better now in my opinion. Just some minor changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add a comment above that explains the reason for this setupHook? Something like

Suggested change
setupHook = ./setup-hook.sh;
# PySDL3 downloads SDL binaries itself by default so we set env variables to make it use the ones from nixpkgs
# See https://pysdl3.readthedocs.io/en/latest/install.html#the-environment-variable-method
setupHook = ./setup-hook.sh;

Comment thread pkgs/development/python-modules/pysdl3/setup-hook.sh Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"";
throw "Unsupported system: ${stdenv.hostPlatform.system}";

@jansol
Copy link
Copy Markdown
Contributor Author

jansol commented May 13, 2025

(Oh right, dynamic libraries have different suffixes on different platforms)

Comment on lines +45 to +48
docfile = fetchurl {
url = "https://github.com/Aermoss/PySDL3/releases/download/v${version}/${stdenv.hostPlatform.uname.system}-Docs.py";
hash = "${dochash}";
};
Copy link
Copy Markdown
Member

@pbsds pbsds May 14, 2025

Choose a reason for hiding this comment

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

rather than fetching this generated asset, please generate it in the derivation if possible. The procedure seems to be in https://github.com/Aermoss/PySDL3/blob/main/.github/workflows/generate_docs.yml.

If we do have to fetch it, then we should set meta.sourceProvenance accordingly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The generator attempts to first download the file from the github release so that would not really change anything. If downloading it from the github release fails, it starts scraping docs from libsdl.org which I'm also not a huge fan of (it mostly seems like a great way to get our CI machines IP blocked these days).

Ideally we'd generate the docs from our own SDL3 build. I was going to propose supporting that case to upstream but didn't manage to get nixpkgs SDL3 to generate its documentation...

Copy link
Copy Markdown
Member

@pbsds pbsds May 14, 2025

Choose a reason for hiding this comment

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

sounds like a big can of worms, i'm not against fetching it in the meanwhile 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What shoud meta.sourceProvenance be set to in this case? binaryBytecode?

@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 14, 2025

on darwin ofborg:

OSError: dlopen(/nix/store/vywskmfkwb412cm7r6ryq1my809vis1i-python3.12-pysdl3-0.9.8b1/lib/python3.12/site-packages/sdl3/bin/libSDL3_ttf.dylib, 0x0006): Library not loaded: /opt/homebrew/opt/harfbuzz/lib/libharfbuzz.0.dylib
  Referenced from: <0C7CE85E-DE89-38C3-BCE5-6F34F347BE98> /nix/store/vywskmfkwb412cm7r6ryq1my809vis1i-python3.12-pysdl3-0.9.8b1/lib/python3.12/site-packages/sdl3/bin/libSDL3_ttf.dylib
  Reason: tried: '/opt/homebrew/opt/harfbuzz/lib/libharfbuzz.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/harfbuzz/lib/libharfbuzz.0.dylib' (no such file), '/opt/homebrew/opt/harfbuzz/lib/libharfbuzz.0.dylib' (no such file)

@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 14, 2025

On further inspection this seems to be a sdl3_ttf issue not pysdl3 issue, and i'm unable to recreate it on the darwin community builder indicating that the harfbuzz package is not guaranteed to be present on a given darwin machine

@pbsds pbsds mentioned this pull request May 14, 2025
13 tasks
@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 14, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 405753


x86_64-linux

✅ 6 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist
  • tauon
  • tauon.dist

aarch64-linux

✅ 6 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist
  • tauon
  • tauon.dist

x86_64-darwin

✅ 4 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist

aarch64-darwin

✅ 4 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist

@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 14, 2025

$ results/tauon-x86_64-linux/bin/tauon
2025-05-14 19:57:26 [ INFO  ] [ __main__ ] Tauon v8.0.1
2025-05-14 19:57:26 [ INFO  ] [ __main__ ] Copyright 2015-2025 Taiko2k [email protected]

Error: Failed to write docs: [Errno 30] Read-only file system: '/nix/store/81l56jnx7p2pi7xqgizxabnils8pijbn-python3.13-pysdl3-0.9.8b1/lib/python3.13/site-packages/sdl3/__doc__.py'.
Error: Invoked an unimplemented function: 'SDL_SetHint'.
Error: Invoked an unimplemented function: 'SDL_SetHint'.
Error: Invoked an unimplemented function: 'SDL_SetHint'.
Error: Invoked an unimplemented function: 'SDL_SetHint'.
Error: Invoked an unimplemented function: 'SDL_SetHint'.
2025-05-14 19:57:27 [ INFO  ] [ __main__ ] No window state file
Error: Invoked an unimplemented function: 'SDL_Init'.
Error: Invoked an unimplemented function: 'SDL_GetError'.
Error: Invoked an unimplemented function: 'SDL_CreateWindow'.
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] ERROR CREATING WINDOW! (__main__.py:332)
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] Title: b'Tauon' (__main__.py:333)
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] X: 536805376 (__main__.py:334)
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] Y: 536805376 (__main__.py:335)
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] Size 0: 1120 (__main__.py:336)
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] Size 1: 600 (__main__.py:337)
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] Flags: 1073750064 (__main__.py:338)
Error: Invoked an unimplemented function: 'SDL_GetError'.
2025-05-14 19:57:27 [ ERROR ] [ __main__ ] SDL Error: None (__main__.py:339)
2025-05-14 19:57:27 [WARNING] [ warnings ] sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/pbsds/.local/share/TauonMusicBox/program.pid' mode='w' encoding='UTF-8'>
 (warnings.py:112)

I think the doc fetching needs to be patched

@jansol
Copy link
Copy Markdown
Contributor Author

jansol commented May 14, 2025

I think the doc fetching needs to be patched

That error message is referring to a different python version than on my machine. Can you check the directory structure of the result from nix build .#python3Packages.pysdl3? There should be sdl3/__doc__.py in the relevant site-packages. If the rest of the .py files are in a different place that would explain this error and it would mean I messed up the paths in postInstall.

@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 14, 2025

Oh, i think the error was from nixpkgs-review populating the shell with multiple python versions of pysdl3 in PYTHONPATH. This is a known problem. Running it with only tauon in the shell gives me a GUI. It however print this error without crashing:

2025-05-15 00:10:24 [ ERROR ] [  t_main  ] Failed to load libXcursor.so, will try libXcursor.so.1 (t_main.py:40496)
Traceback (most recent call last):
  File "/nix/store/rdxmvih92mzdrsxxjjrcv2k1mh28w904-tauon-8.0.1/lib/python3.12/site-packages/tauon/t_modules/t_main.py", line 40494, in <module>
    xcu = ctypes.cdll.LoadLibrary("libXcursor.so")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/kjvgj2n3yn70hmjifg6y0bk9m4rf7jba-python3-3.12.10/lib/python3.12/ctypes/__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/kjvgj2n3yn70hmjifg6y0bk9m4rf7jba-python3-3.12.10/lib/python3.12/ctypes/__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libXcursor.so: cannot open shared object file: No such file or directory

Likely the LoadLibrary("libXcursor.so") needs to be patched or the bin/tauon entrypoint needs to add libXcursor to the library path

@jansol jansol force-pushed the tauon branch 2 times, most recently from 4d783cd to 180ffa2 Compare May 14, 2025 22:30
@jansol
Copy link
Copy Markdown
Contributor Author

jansol commented May 14, 2025

If that's all then the good news is that we were wrapping the main entrypoint and stuffing things into LD_LIBRARY_PATH already so adding libXcursor is a minimal change.

@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 15, 2025

TIL that fixes https://github.com/.../pull/123#issuecomment-456 will ignore the comment anchor and close the PR

@pbsds
Copy link
Copy Markdown
Member

pbsds commented May 16, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 405753


x86_64-linux

✅ 6 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist
  • tauon
  • tauon.dist

aarch64-linux

✅ 6 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist
  • tauon
  • tauon.dist

x86_64-darwin

✅ 4 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist

aarch64-darwin

✅ 4 packages built:
  • python312Packages.pysdl3
  • python312Packages.pysdl3.dist
  • python313Packages.pysdl3
  • python313Packages.pysdl3.dist

@pbsds pbsds merged commit cb9e5af into NixOS:master May 16, 2025
36 of 37 checks passed
@jansol jansol deleted the tauon branch May 16, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants