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 test fails on macOS #1628

Closed
tempura-sukiyaki opened this issue May 20, 2021 · 4 comments
Closed

Premake test fails on macOS #1628

tempura-sukiyaki opened this issue May 20, 2021 · 4 comments
Labels
Milestone

Comments

@tempura-sukiyaki
Copy link
Contributor

What seems to be the problem?

When I pull the latest master branch on macOS, build it, and run Premake Test, I get the following error.

[==========] 2034 tests from 184 test suites ran. (3031 ms total)
[  PASSED  ] 2033 tests.
[  FAILED  ] 1 tests, listed below:
[  FAILED  ] base_os.findlib_FindSystemLib
/********/premake-core/tests/base/test_os.lua:31: expected true but was false

 1 FAILED TEST

What did you expect to happen?

I think all the tests should pass successfully.

What have you tried so far?

I haven't tried anything.
I looked at the source code, but I couldn't understand it.

How can we reproduce this?

Try running Premake Test on macOS.

What version of Premake are you using?

I'm using premake5 (Premake Build Script Generator) 5.0.0-dev.
I pulled the latest master branch of premake-core and built it.

@samsinsane
Copy link
Member

What version of macOS is this? Also, is this on an Intel or M1 mac?

@tempura-sukiyaki
Copy link
Contributor Author

Sorry.
I should have written down the execution environment.

  • macOS Big Sur 11.3.1
  • Mac mini (2018) / 3.2GHz 6-core Intel Core i7
  • Xcode Command Line Tools Version 12.5 (12E262)

@starkos
Copy link
Member

starkos commented May 22, 2021

I can reproduce this here, also on Big Sur. I think we're missing a search path in get_library_search_path() (os.lua). We link readline when building Premake5 so it must exist, but this test still fails for me:

function suite.findlib_FindSystemLib()
    if os.istarget("windows") then
        test.istrue(os.findlib("user32"))
    elseif os.istarget("haiku") then
        test.istrue(os.findlib("root"))
    elseif os.istarget("darwin") then -- added this clause
        test.istrue(os.findlib("readline"))
    else
        test.istrue(os.findlib("m"))
    end
end

@samsinsane
Copy link
Member

From Big Sur release notes https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes:

New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

@starkos starkos added this to the 5.0 milestone Sep 7, 2021
starkos added a commit to starkos/premake-core that referenced this issue Oct 27, 2021
starkos added a commit to starkos/premake-core that referenced this issue Oct 27, 2021
starkos added a commit to starkos/premake-core that referenced this issue Oct 28, 2021
starkos added a commit that referenced this issue Oct 29, 2021
Fix #1628 failing macOS os.findlib() test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants