Skip to content

Don't use dot in folder name to prevent macOS issues#66

Open
wrobelda wants to merge 1 commit intosteveire:masterfrom
wrobelda:master
Open

Don't use dot in folder name to prevent macOS issues#66
wrobelda wants to merge 1 commit intosteveire:masterfrom
wrobelda:master

Conversation

@wrobelda
Copy link
Copy Markdown

Grantlee5_MAJOR_MINOR_VERSION_STRING uses a dot between major
and minor component, which results in the lib/ subfolder
having the same name. This in turn causes an issue when bundling
grantlee with any software under macOS.

See following for reference:
https://bugs.kde.org/show_bug.cgi?id=420351
https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG201

This commit implements a proposed workaround replacing
'.' (dot) with '_'.

Fixes #64

Grantlee5_MAJOR_MINOR_VERSION_STRING uses a dot between major
and minor component, which results in the lib/ subfolder
having the same name. This in turn causes an issue when bundling
grantlee with any software under macOS.

See following for reference:
https://bugs.kde.org/show_bug.cgi?id=420351
https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG201

This commit implements a  proposed workaround replacing
 '.' (dot) with '_'.
@steveire
Copy link
Copy Markdown
Owner

@wrobelda Am I right to think that the issue comes up because of the line

set( PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/grantlee/${Grantlee5_MAJOR_MINOR_VERSION_STRING} )

? ie, plugins are installed to a dir with a dot?

What do other projects do? Eg on my system I have

/usr/lib/x86_64-linux-gnu/osgPlugins-3.6.4/osgdb_ffmpeg.so

I'm sure I can find others using dots in names. Are you telling me that none of them can be bundled on macOS? Or do they special-case mac to use underscore there and dot everywhere else?

Your change causes

templates/lib/grantlee_version.h

to have different content. What is the impact of that?

@wrobelda
Copy link
Copy Markdown
Author

wrobelda commented Nov 15, 2022

Sorry for a late reply, this completely escaped me.

? ie, plugins are installed to a dir with a dot?

Correct. Because of that line, plugins end up in a dir containing version number with a dot.

What do other projects do? Eg on my system I have

/usr/lib/x86_64-linux-gnu/osgPlugins-3.6.4/osgdb_ffmpeg.so

Yes, but that's linux, and on macOS this would inevitably cause identical issue as this one.

I'm sure I can find others using dots in names.

Possibly, but as long as I live and use Linux (20+ years), the convention is to version the actual library files (.so), not the folders they are stored in. I'd argue that your approach is rather unorthodox and unusual.

Are you telling me that none of them can be bundled on macOS? Or do they special-case mac to use underscore there and dot everywhere else?

I can only assume that they simply do not install their libraries to a folder with a version number on macOS and rely on the library file itself including the version number. Or perhaps their CMake usage is more vanilla, allowing CMake to handle the folder naming?

Your change causes
templates/lib/grantlee_version.h
to have different content. What is the impact of that?

OK, that's not good. I suppose the alternative is to simply not install in a subfolder here:
set( PLUGIN_INSTALL_DIR ${LIB_INSTALL_DIR}/grantlee/${Grantlee5_MAJOR_MINOR_VERSION_STRING} )

EDIT: looking at other Qt/KDE code, they tend to do something like set (KTORRENT_PLUGIN_INSTALL_DIR ${PLUGIN_INSTALL_DIR}/ktorrent), with PLUGIN_INSTALL_DIR defined by ECM.

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.

saving libs in grantlee/major.minor/ folder causes packaging issues on macOS

2 participants