Skip to content

Attempt to fix otool/gimp issue with a subdirs #10

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

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

samm-git
Copy link

Hello,

I found an issue with GIMP packaging.

To add GIMP plugins and all it dependencies i added such line to my bundle file:

 <binary>${prefix}/lib/gimp/2.0/plug-ins/*</binary>

However, i found that otool is failing because it is called with not only files but also directories (GIMP has some plugins in subdirs). Also i found that depending on SDK version otool crashing, printing warnings or just exiting with a fatal message (last SDK). This PR filtering list to files-only

@jralls
Copy link
Owner

jralls commented Oct 26, 2018

Just checking if item is a file isn't really sufficient: otool will choke on libtool .la files too, but there's no good way to check if an unspecified file is really a shared library, loadable module, or Mach-O executable.

So don't use a naked * as the glob, use *.so or *.dylib, or both in separate entries if necessary. You probably also want to say <binary recurse="True"> to traverse the subdirectories for the plugins.

@samm-git
Copy link
Author

the problem is that many plugins do not have extension (they are in fact normal binaries). I think that otool is not crashing on non-Mach-O files, just prints a warning, so it is not an issue.

@samm-git
Copy link
Author

samm-git commented Oct 26, 2018

Actually just checked:

Adding dir, otool stops early:

$ otool -L ~/tmp/  /bin/sh
/Library/Developer/CommandLineTools/usr/bin/objdump: '/Users/asamorukov/tmp/': Is a directory

Same for non-binary file, otool prints warning but works:

$ otool -L ~/tmp/sas.html  /bin/sh
/Users/builder/tmp/sas.html: is not an object file
/bin/sh:
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)

So looks like this workaround is not perfect but good enough.

@jralls jralls merged commit dab2532 into jralls:master Jan 20, 2023
@jralls
Copy link
Owner

jralls commented Jan 20, 2023

Thanks and sorry I forgot about this.

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