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

premake does not build on macOS 10.14 (Mojave) #1154

Closed
fxcoudert opened this issue Sep 3, 2018 · 12 comments
Closed

premake does not build on macOS 10.14 (Mojave) #1154

fxcoudert opened this issue Sep 3, 2018 · 12 comments

Comments

@fxcoudert
Copy link

premake does not build on macOS 10.14 (Mojave) because it contains numerous references to -mmacosx-version-min=10.4 as compiler flag… which is now unsupported. The error message is:

$ make -C build/gmake.macosx
==== Building Premake4 (release) ====
Linking Premake4
ld: library not found for -lgcc_s.10.4
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../../bin/release/premake4] Error 1
make: *** [Premake4] Error 2
@fxcoudert
Copy link
Author

Showed up during Homebrew testing: Homebrew/homebrew-core#28817

@samsinsane
Copy link
Member

Thanks for reporting this, is the issue that the 10.4 version isn't available, or that -mmacosx-version.min is no longer available?

@fxcoudert
Copy link
Author

With Xcode 10 (on High Sierra and Mojave), -mmacosx-version-min= with values lower than 10.9 leads to compilation failure. Probably, the best solution is let the software build for the current architecture, i.e. do not passe any -mmacosx-version-min= flag at all.

@samsinsane
Copy link
Member

I don't fully understand what the minimum version does on macOS, will letting it target the current version result in the binaries not running on earlier versions of macOS? Or does the minimum version just us from using certain APIs?

@fxcoudert
Copy link
Author

Yes, binaries built without will only run on later macOS versions.

@samsinsane
Copy link
Member

I'm not sure that we want to remove the minimum version if that's the case. Ideally, Premake wouldn't force users to update their OS to the latest version just to run.

@fxcoudert
Copy link
Author

Most software has no --macosx-version-min, so it does like this:

  • by default it builds for the current architecture (and will always run on later OS versions)
  • if the user (or distro) wants to build a version that can run on older OS that it is built on, they can specify --macosx-version-min themselves through the environment variable (export MACOSX_DEPLOYMENT_TARGET=10.9)

Right now, build is simply broken on macOS 10.13 and 10.14, which is 90% of macOS users.

@tdesveauxPKFX
Copy link
Contributor

I think we should remove the osx min version from our Premake script and add the define to our release process. This way, you can target whichever osx version you want when you clone and our prebuilt binaries works the same.

From the log posted in the first message, the issue seems to be with Premake4. Also, do we know who own the package? Or does it clone the repo then build?

@na-Itms
Copy link

na-Itms commented Nov 13, 2018

Hello, commit 5f57b5d removed the hardcoded value, but left it in premake4.lua, and did not change the packaging scripts. Was it a thoughtful decision regarding this issue? The change doesn't look like matching the ideal plan laid out in comments above.

We are currently hitting the bug because we are still on alpha 10, and we would like to make sure the issue is properly fixed before going through a premake upgrade.

Thank you very much!

@samsinsane
Copy link
Member

@fxcoudert I completely misread this issue initially, and I apologise for that. The snippet you've provided says Premake4, which hasn't been updated in over three years (as Premake5 is the new version), I would strongly recommend updating the package to use Premake5 instead. The commit that @na-Itms refers to happened last year and removed the minimum version which I assume resolves the problem you were experiencing? Please feel free to reach out for any help in updating!

@na-Itms The premake4.lua file is largely legacy and I think it's time we removed it. Regarding the "packaging scripts", which ones are you referring to? I can't find any reference to -mmacos-version-min in the entire repo except for the premake4.lua file. Upgrading beyond alpha10 shouldn't introduce any problems to your projects, but in any case it is resolved in alpha13. If you have any issues with alpha13, please feel free to report them.

@tdesveauxPKFX @starkos @TurkeyMan @tvandijck I'm thinking that it's time we remove the premake4.lua file, the bootstrap process is significantly better and easier to maintain. The premake4.lua requires that we know the Premake4 commands (configuration vs filter, flags vs specific APIs, etc) and will likely generate different project files, not to mention that it's not actively tested. If any of you feel strongly about keeping the premake4.lua file, I'm more than happy to discuss but it seems like it will only get us into trouble as we progress forward.

@na-Itms
Copy link

na-Itms commented Nov 19, 2018

Regarding the "packaging scripts", which ones are you referring to? I can't find any reference to -mmacos-version-min in the entire repo except for the premake4.lua file.

Sorry, I was referring to this phrase by @tdesveauxPKFX:

I think we should remove the osx min version from our Premake script and add the define to our release process.

Basically I was pointing out that the min version was removed but the commit didn't add any define in any place. I assumed your release process was carried out using packaging scripts in which defines could be added.

Upgrading beyond alpha10 shouldn't introduce any problems to your projects, but in any case it is resolved in alpha13. If you have any issues with alpha13, please feel free to report them.

We are currently in the latest stages of releasing a new version, so we will only make minimal modifications and apply commit 5f57b5d to our alpha10 copy. We will then upgrade premake ASAP. I will be sure to contact you in case we need some help 👍

na-Itms pushed a commit to 0ad/0ad that referenced this issue Dec 3, 2018
…make5 alpha10.

After the re-release of A23, premake5 will be updated to the latest alpha version, which includes this change.

This allows to build premake on macOS Mojave. See premake/premake-core#1154.

Differential Revision: https://code.wildfiregames.com/D1669
Based on patch by: trompetin17

git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@21941 3db68df2-c116-0410-a063-a993310a9797
@starkos
Copy link
Member

starkos commented Sep 7, 2021

I believe this has since been resolved, so I'm going to mark it closed. Feel free to comment if issues are still being encountered.

@starkos starkos closed this as completed Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants