Skip to content

Linking: Remove link_SDL2* methods, update README, and fix race condition #26

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

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

mjakeman
Copy link
Contributor

@mjakeman mjakeman commented Aug 5, 2025

I've split this out from #25 to compare/contrast the approach.

Changes:

  • Fix race condition in build.zig: The run step did not depend on install step, causing the tests to be run from zig-cache instead of zig-out. That meant that even with a correct rpath, it would still fail.
  • Remove link_SDL2* methods: The methods cause a compile error when used directing the user to the readme.
  • README Changes: Contains instructions on how to properly link SDL, and moves the RPath parts to the prebuilt section (where it's particularly relevant, as system libraries/frameworks will be installed in global search paths).

When using any of the old link_SDL2* methods, the user will see this:

image

To Do:

  • Test this with a brand new repo

@mjakeman
Copy link
Contributor Author

mjakeman commented Aug 5, 2025

Race condition seems like the same issue as: ziglang/zig#22117

@hazeycode hazeycode requested a review from Copilot August 5, 2025 17:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes deprecated SDL linking methods and fixes a race condition in the test execution. The main purpose is to improve the build system reliability and guide users toward proper SDL linking practices.

  • Replaces deprecated link_SDL2* methods with compile errors directing users to the README
  • Fixes race condition by ensuring test runs depend on install step
  • Updates README with comprehensive SDL linking instructions and prebuilt library setup

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
build.zig Removes public linking methods, adds compile errors for deprecated functions, fixes test dependency race condition
README.md Adds detailed SDL linking examples and reorganizes prebuilt library documentation

Copy link
Member

@hazeycode hazeycode left a comment

Choose a reason for hiding this comment

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

Thanks!

@hazeycode hazeycode merged commit a764b0e into zig-gamedev:main Aug 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants