Skip to content

Conversation

oddbookworm
Copy link
Member

Another precursor PR to #3477
The reason I want to remove so much static linkage is because you can't test functions that aren't visible to you (not even worth putting those declarations in the header, since anyone that includes the header would need to provide their own implementation to call them).

@oddbookworm oddbookworm requested a review from a team as a code owner June 8, 2025 00:36
oddbookworm added a commit that referenced this pull request Jun 9, 2025
@gresm
Copy link
Contributor

gresm commented Jun 9, 2025

You could also do in base_test.c:

#include "base.c"

[...]

But that'll make building tests messy...

@oddbookworm
Copy link
Member Author

You could also do in base_test.c:

#include "base.c"

Absolutely not

That begs for linker problems that would be a pain to solve, and ultimately, having a header with all the declarations is just cleaner IMO. Including a source file is just plain nasty

Copy link
Member

@pmp-p pmp-p left a comment

Choose a reason for hiding this comment

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

there are problems that could be solved i thing by simply merging static and base ( ie when wasm loading pygame_base static could be set to pygame.base by pygame/__init__.py

@pmp-p
Copy link
Member

pmp-p commented Jul 1, 2025

last commit won't do it : wasm at runtime says that pgExc_SDLError needs to be globally exported for dynamic loading.

@pmp-p
Copy link
Member

pmp-p commented Jul 20, 2025

That PR (minus last commit) would unlock further work on meson wasm build. it is already viable for non cython files( _sdl2 )

Copy link
Member

@pmp-p pmp-p left a comment

Choose a reason for hiding this comment

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

mixer.c should only use MODINIT_DEFINE(mixer)

#if BUILD_STATIC

because now sdl2 mixer init has been renamed

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

I am approving all the non-wasm/non-static changes of this PR, I trust pmp-p has reviewed the wasm/static specific bits.

@ankith26 ankith26 merged commit c6e81a0 into pygame-community:main Aug 3, 2025
26 of 29 checks passed
@ankith26 ankith26 added this to the 2.5.6 milestone Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants