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

Remove suffix from framework names #466

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Treata11
Copy link
Contributor

I have updated the output name of the generated frameworks to remove the version-number suffixes, as discussed here

@cary-ilm
Copy link
Member

I may have explained it poorly, but for the regular non-iOS build, we want the version suffixes to be present. I would expect symlinks like this:

libImath-3_2.30.3.2.0.dylib - the shared library
libImath-3_2.30.dylib -> libImath-3_2.30.3.2.0.dylib
libImath-3_2.dylib -> libImath-3_2.30.dylib
libImath.dylib -> libImath-3_2.dylib

I tried building your branch, and I'm getting lib/libImath.dylib as a broken symlink to libImath-3_2.dylib. See the logs from the CI build with no cross-compilation here.

The CMake lines that construct these links are [here] in LibraryDefine.cmake. (https://github.com/Treata11/Imath/blob/a837d089dfb7010e09c51bb3a403a6f1415bbfcb/config/LibraryDefine.cmake#L117)

I'm not familiar enough with the cmake framework stuff to be much help there, unfortunately. Again, it's not entirely clear to me that the soname-versioned .dylib libraries are a useful feature on iOS, but I we shouldn't make the iOS build inconsistent unless that's clearly the right thing to do.

@Treata11
Copy link
Contributor Author

@cary-ilm, You're explanation was good, I misunderstood it

we want the version suffixes to be present. I would expect symlinks like this:
libImath-3_2.30.3.2.0.dylib - the shared library
libImath-3_2.30.dylib -> libImath-3_2.30.3.2.0.dylib
libImath-3_2.dylib -> libImath-3_2.30.dylib
libImath.dylib -> libImath-3_2.dylib

By omitting all of the OUTPUT_NAME properties, the iOS binaries would also be generated with version-suffixes and the name of the framework-directory would also match the binary file inside.

The Frameworks include an info.plist which is an XML file containing some metadata such as the version. Therefore, having a version suffix in the binary name isn't common practice for Apple frameworks, but there are no restrictions against it—it's simply a naming convention.

We can either make the suffixes conditional for all builds except for Apple frameworks or Leave it as is in every build, as initially intended.

In the previous PR, I mistakenly had the names overwritten: https://github.com/AcademySoftwareFoundation/Imath/pull/461/files#r1923205724

@cary-ilm
Copy link
Member

If the naming convention isn't common practice in this context, I'm fine not supporting it.

I tried building your branch again just now, and I'm getting lib/libImath.dylib as a broken symlink to libImath-3_2.dylib. Are you getting the same thing?

@Treata11
Copy link
Contributor Author

If the naming convention isn't common practice in this context, I'm fine not supporting it.

I'll adjust the code.

I tried building your branch again just now, and I'm getting lib/libImath.dylib as a broken symlink to libImath-3_2.dylib. Are you getting the same thing?

Yes, when I build it with IMATH_BUILD_APPLE_FRAMEWORKS ON for an iOS platform, there will be a broken symlink to libImath.dylib. It should not build any dynamic libraries for iOS platforms in the first place. I’ll look into the problem and see what I can do...

@Treata11
Copy link
Contributor Author

I made the version-suffixes conditional for Apple platforms and removed the OUTPUT_NAME properties...

Also set IMATH_INSTALL_SYM_LINK to be OFF for framework builds. It was generating a (broken) symlink to a dylib which I previously mentioned that dynamic-libs are prohibited for non-macOS targets...

@cary-ilm
Copy link
Member

Thanks I built again and the broken symlink is gone. I guessing about other requirements here since I have no experience with iOS, but is pkgconfig relevant? Should it be disabled (via IMATH_INSTALL_PKG_CONFIG=OFF)? Also, I notice that ImathConfig.h is installed under include/Imath, but it's included by Imath.framework/Headers/ImathExport.h. ImathConfig.h is generated by config/CMakeLists.txt via:

configure_file(ImathConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/ImathConfig.h)

Should that go in Imath.framework/Headers?

@Treata11
Copy link
Contributor Author

I guessing about other requirements here since I have no experience with iOS, but is pkgconfig relevant? Should it be disabled (via IMATH_INSTALL_PKG_CONFIG=OFF)?

The generated frameworks should be sufficient for iOS builds.

Also, I notice that ImathConfig.h is installed under include/Imath, but it's included by Imath.framework/Headers/ImathExport.h. ImathConfig.h is generated by config/CMakeLists.txt via:
configure_file(ImathConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/ImathConfig.h)
Should that go in Imath.framework/Headers?

I don't think that it will interfere with anything... But if it's absolutely necessary, I can exclude ImathConfig.h from the framework headers.

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.

2 participants