Bug 420351 - Grantlee fails to package under macOS due to a dot in lib/granglee/major.minor folder name
Summary: Grantlee fails to package under macOS due to a dot in lib/granglee/major.mino...
Status: RESOLVED FIXED
Alias: None
Product: grantlee
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other macOS
: NOR normal
Target Milestone: 0.2
Assignee: Stephen Kelly
URL:
Keywords:
Depends on:
Blocks: 419272
  Show dependency treegraph
 
Reported: 2020-04-20 19:08 UTC by Dawid Wróbel
Modified: 2020-04-27 01:04 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Wróbel 2020-04-20 19:08:25 UTC
SUMMARY

Grantle saves some of the libs in a lib/grantlee/major.minor folder. While I don't think it is a good practice on any platform, it in particular causes the macOS packaging to fail due to limitations imposed by Xcode codesign tool:

"(..) If you do do this, do not use periods in the directory names. The code signing machinery interprets directories with periods in their names as code bundles and will reject them if they don't conform to the expected code bundle layout" 
(per https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG201)

STEPS TO REPRODUCE
1. Attempt to package a blueprint that depends on grantlee (directly or indirectly), e.g. kmymoney 

OBSERVED RESULT
codesign fails to sign with "bundle format unrecognized, invalid, or unsuitable"

EXPECTED RESULT
codesign to pass properly


ADDITIONAL INFORMATION
Reported upstream: https://github.com/steveire/grantlee/issues/64
Originally reported for kmymoney: https://bugs.kde.org/show_bug.cgi?id=419272
Comment 1 Dawid Wróbel 2020-04-20 19:50:37 UTC
Please also consider updating the kdesupport/grantlee blueprint to point to https://github.com/KDE/grantlee, since it currently points to what I believe is an outdated https://github.com/steveire/grantlee repository.
Comment 2 Dawid Wróbel 2020-04-26 19:51:41 UTC
Pull request with a workaround created:

https://github.com/KDE/grantlee/pull/1
Comment 3 Dawid Wróbel 2020-04-26 20:06:49 UTC
Also a pull request for grantlee blueprint to point to current grantlee upstream git branch: https://invent.kde.org/kde/craft-blueprints-kde/-/merge_requests/3
Comment 4 Dawid Wróbel 2020-04-26 20:52:23 UTC
Git commit 2832644232c9966013f89ad545183c49140a65bd by Dawid Wróbel.
Committed on 26/04/2020 at 20:48.
Pushed by wrobelda into branch 'master'.

Change URL to a forked repo with a #420351 bugfix

Bug #420351 was reported to the upstream grantlee maintainer
but has been unresolved for quite a while now. It is causing
kmymoney macOS packages to fail to build and possibly any other
package that uses grantlee, either directly or indirectly via
kdepim.

This commit changes the upstream URL to a fork I created with a
bugfix/workaround.

It will be reverted back to original upstream URL once the
upstream maintainer merges the pull-request that contains said
bugfix or solves the issue otherwise.

M  +1    -1    kdesupport/grantlee/grantlee.py

https://invent.kde.org/kde/craft-blueprints-kde/commit/2832644232c9966013f89ad545183c49140a65bd
Comment 5 Dawid Wróbel 2020-04-26 22:40:37 UTC
Git commit e4f50336e0ed3adfd7748089877676b7e3c03840 by Dawid Wróbel.
Committed on 26/04/2020 at 22:35.
Pushed by wrobelda into branch 'master'.

grantlee: fix macOS packaging issue with a patch

Bug #420351 was reported to the upstream grantlee maintainer
but has been unresolved for quite a while now. It is causing
kmymoney macOS packages to fail to build and possibly any other
package that uses grantlee, either directly or indirectly via
kdepim.

This commit enables a patch that works around the issue on
macOS platform.

M  +4    -0    kdesupport/grantlee/grantlee.py

https://invent.kde.org/kde/craft-blueprints-kde/commit/e4f50336e0ed3adfd7748089877676b7e3c03840
Comment 6 Dawid Wróbel 2020-04-27 01:04:55 UTC
Git commit 86f05b3009a622ce5ce90cdcfd32e52c875c8cae by Dawid Wróbel.
Committed on 27/04/2020 at 01:04.
Pushed by wrobelda into branch 'master'.

grantlee: fix macOS packaging issue with a patch

Add a missing patch file.

A  +36   -0    kdesupport/grantlee/0001-Don-t-use-dot-in-folder-name-to-prevent-macOS-issues.patch

https://invent.kde.org/kde/craft-blueprints-kde/commit/86f05b3009a622ce5ce90cdcfd32e52c875c8cae