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

new apple frameworks test #6499 #6533

Merged
merged 6 commits into from Feb 19, 2020

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented Feb 12, 2020

Changelog: Bugfix: improve Apple frameworks lookups with CMake integration
Docs: omit

updated version of #6499
closes: #6416
code from https://github.com/Paultergeist/conan_apple_framework

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@SSE4
Copy link
Contributor Author

SSE4 commented Feb 12, 2020

@memsharded I got further on this, it now builds for me, however, it fails to run:

dyld: Library not loaded: @rpath/hello.framework/Versions/A/hello
  Referenced from: /private/var/folders/vq/v4_w2g4j5k1170y70pgfktzr0000gn/T/tmpns2pz_0mconans/path with spaces/test_package/build/f4c7a70248efcdb8d65e75e42ba42fadfc285e1b/bin/timer
  Reason: image not found
ERROR: mylibrary/1.0 (test package): Error in test() method, line 14
	self.run("bin/timer", run_environment=True)
	ConanException: Error -6 while executing DYLD_LIBRARY_PATH="" DYLD_FRAMEWORK_PATH="" bin/timer

this is very suspicious, as testing with real project (SFML) passes.
right now I fail to understand why run_environment doesn't see framework_paths?
it turns our that dumping such values results in incorrect things:

    def test(self):
                    self.output.info("%s" % self.deps_cpp_info["mylibrary"].frameworks)
                    self.output.info("%s" % self.deps_cpp_info["mylibrary"].framework_paths)
                    self.output.info("%s" % self.deps_cpp_info["mylibrary"].frameworkdirs)
mylibrary/1.0 (test package): Running test()
mylibrary/1.0 (test package): ['hello']
mylibrary/1.0 (test package): []
mylibrary/1.0 (test package): ['Frameworks']

somehow, framework_paths/frameworkdirs are lost in RunEnvironment generator... but values were passed correctly to the CMake generator, that puzzles me a lot.

@SSE4
Copy link
Contributor Author

SSE4 commented Feb 12, 2020

okay, it turns out problem was in txt generator (surprisingly). it misused framework_paths vs framework_dirs.

Signed-off-by: SSE4 <tomskside@gmail.com>
@SSE4 SSE4 requested a review from memsharded Feb 12, 2020
@memsharded memsharded added this to the 1.23 milestone Feb 17, 2020
Copy link
Member

@memsharded memsharded left a comment

This looks good, many thanks!

Could you please extend the test to use the cmake_find_package_multi generator? That is using a similar conan_find_apple_framework, doesn't seem affected, but would be better to have it covered.

The same test, with the same framework, but just modifying the consumer to use find_package() instead would be nice.

Many thanks!

conans/client/generators/cmake_common.py Show resolved Hide resolved
@SSE4
Copy link
Contributor Author

SSE4 commented Feb 19, 2020

the second test has been added.

@SSE4
Copy link
Contributor Author

SSE4 commented Feb 19, 2020

NOTE: this is not a regression, it wasn't working as expected from the inception.

@memsharded memsharded merged commit 3cb8d6c into conan-io:develop Feb 19, 2020
2 checks passed
@memsharded
Copy link
Member

memsharded commented Feb 19, 2020

Many thanks!

@jacobjiangwei
Copy link

jacobjiangwei commented Nov 11, 2020

hey there, I have tried latest build Conan version 1.31.1
and same issue still occurs.

I made a swift dynamic framework for our own testing purpose and installed to the test project.

The test project can import the framework and compile successfuly, but run instantly into crashes:

dyld: Library not loaded: @rpath/swiftTestFramework.framework/swiftTestFramework
Referenced from: /private/var/containers/Bundle/Application/7589D3D1-8813-4195-8FD6-6CA041AB6439/test.app/test
Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

Can you point me the right place to this issue? Thanks

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

Successfully merging this pull request may close these issues.

4 participants