Skip to content
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

Continue if xcode-select fails building SDL #1389

Closed
wants to merge 1 commit into from

Conversation

jcm93
Copy link
Contributor

@jcm93 jcm93 commented Feb 13, 2024

The build-SDL.sh script I added was not fit for local builds because it selects specific Xcode builds that are only normally present on CI machines. This PR changes the script to continue if those commands fail, allowing ./buildSDL.sh to work without modifications for users building locally.

@LukeUsher
Copy link
Member

wouldn't a better solution be doing something like xcode-select --print-path to get the current path before changing it, then restoring it after the build?

@jcm93
Copy link
Contributor Author

jcm93 commented Feb 13, 2024

It would, though the Xcode_14.2.app naming conventions are only used by GitHub Actions, so these are basically set up to fail on any local machines anyway.

Honestly it would be better to just not touch xcode-select in any way unless we know we are on CI. I might look into a better way to handle this in general.

@jcm93 jcm93 marked this pull request as draft February 13, 2024 18:08
@jcm93
Copy link
Contributor Author

jcm93 commented Feb 13, 2024

Going to close this for now while I do a bunch of tests on this branch so I don't spam anyone with notifications. Will open a new one later.

@jcm93 jcm93 closed this Feb 13, 2024
LukeUsher pushed a commit that referenced this pull request Mar 27, 2024
Resubmission of #1389 with
improvements.

Now the SDL build script will not call `xcode-select`, which can have
undesired effects on the user build environment, unless it is on CI
(detected with the `$GITHUB_ACTIONS` env var).

It will also not call ``cmake --install .``, which would previously
replace the user's SDL installation.

This second change required some minor changes to ruby's makefile. We
now include the header directory from the cloned SDL source, and inform
the linker correctly of the location of the SDL .dylib.

Also added the cloned SDL repository and .dylib to the .gitignore for
easier development workflow.

To ensure compatibility with
#1390, the
`MACOS_COMPILED_SDL` flag is added so we can include the proper "SDL.h"
header for compiled builds and `<SDL2/SDL.h>` header for system builds.

Co-authored-by: jcm <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants