question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] PkgConfigDeps: -F <frameworkdir> on macOS leads to "clang: error: no such file or directory:" at link time

See original GitHub issue

Environment Details (include every applicable attribute)

  • Operating System+version: macOS Monterey
  • Compiler+version: AppleClang 13
  • Conan version: 1.51.2
  • Python version: 3.9.13

Steps to reproduce (Include if Applicable)

glib build system is Meson, but it can be reproduced as well with a simple CMakeLists relying on pkg_check_modules() and a shared dependency (not tried with static).

If I tweak this PR by replacing PkgConfigDeps by pkg_config generator (also need to move these .pc files in generator folder expected by layout), the build succeeds. It fails afterwards in test_package since it also relies on PkgConfigDeps (with CMake build system).

Logs (Executed commands with output) (Include/Attach if Applicable)

[257/514] Linking target glib/libglib-2.0.0.dylib
FAILED: glib/libglib-2.0.0.dylib
clang  -o glib/libglib-2.0.0.dylib glib/libglib-2.0.0.dylib.p/deprecated_gallocator.c.o glib/libglib-2.0.0.dylib.p/deprecated_gcache.c.o glib/libglib-2.0.0.dylib.p/deprecated_gcompletion.c.o glib/libglib-2.0.0.dylib.p/deprecated_grel.c.o glib/libglib-2.0.0.dylib.p/deprecated_gthread-deprecated.c.o glib/libglib-2.0.0.dylib.p/garcbox.c.o glib/libglib-2.0.0.dylib.p/garray.c.o glib/libglib-2.0.0.dylib.p/gasyncqueue.c.o glib/libglib-2.0.0.dylib.p/gatomic.c.o glib/libglib-2.0.0.dylib.p/gbacktrace.c.o glib/libglib-2.0.0.dylib.p/gbase64.c.o glib/libglib-2.0.0.dylib.p/gbitlock.c.o glib/libglib-2.0.0.dylib.p/gbookmarkfile.c.o glib/libglib-2.0.0.dylib.p/gbytes.c.o glib/libglib-2.0.0.dylib.p/gcharset.c.o glib/libglib-2.0.0.dylib.p/gchecksum.c.o glib/libglib-2.0.0.dylib.p/gconvert.c.o glib/libglib-2.0.0.dylib.p/gdataset.c.o glib/libglib-2.0.0.dylib.p/gdate.c.o glib/libglib-2.0.0.dylib.p/gdatetime.c.o glib/libglib-2.0.0.dylib.p/gdir.c.o glib/libglib-2.0.0.dylib.p/genviron.c.o glib/libglib-2.0.0.dylib.p/gerror.c.o glib/libglib-2.0.0.dylib.p/gfileutils.c.o glib/libglib-2.0.0.dylib.p/ggettext.c.o glib/libglib-2.0.0.dylib.p/ghash.c.o glib/libglib-2.0.0.dylib.p/ghmac.c.o glib/libglib-2.0.0.dylib.p/ghook.c.o glib/libglib-2.0.0.dylib.p/ghostutils.c.o glib/libglib-2.0.0.dylib.p/giochannel.c.o glib/libglib-2.0.0.dylib.p/gkeyfile.c.o glib/libglib-2.0.0.dylib.p/glib-init.c.o glib/libglib-2.0.0.dylib.p/glib-private.c.o glib/libglib-2.0.0.dylib.p/glist.c.o glib/libglib-2.0.0.dylib.p/gmain.c.o glib/libglib-2.0.0.dylib.p/gmappedfile.c.o glib/libglib-2.0.0.dylib.p/gmarkup.c.o glib/libglib-2.0.0.dylib.p/gmem.c.o glib/libglib-2.0.0.dylib.p/gmessages.c.o glib/libglib-2.0.0.dylib.p/gnode.c.o glib/libglib-2.0.0.dylib.p/goption.c.o glib/libglib-2.0.0.dylib.p/gpattern.c.o glib/libglib-2.0.0.dylib.p/gpoll.c.o glib/libglib-2.0.0.dylib.p/gprimes.c.o glib/libglib-2.0.0.dylib.p/gqsort.c.o glib/libglib-2.0.0.dylib.p/gquark.c.o glib/libglib-2.0.0.dylib.p/gqueue.c.o glib/libglib-2.0.0.dylib.p/grand.c.o glib/libglib-2.0.0.dylib.p/grcbox.c.o glib/libglib-2.0.0.dylib.p/grefcount.c.o glib/libglib-2.0.0.dylib.p/grefstring.c.o glib/libglib-2.0.0.dylib.p/gregex.c.o glib/libglib-2.0.0.dylib.p/gscanner.c.o glib/libglib-2.0.0.dylib.p/gsequence.c.o glib/libglib-2.0.0.dylib.p/gshell.c.o glib/libglib-2.0.0.dylib.p/gslice.c.o glib/libglib-2.0.0.dylib.p/gslist.c.o glib/libglib-2.0.0.dylib.p/gstdio.c.o glib/libglib-2.0.0.dylib.p/gstrfuncs.c.o glib/libglib-2.0.0.dylib.p/gstring.c.o glib/libglib-2.0.0.dylib.p/gstringchunk.c.o glib/libglib-2.0.0.dylib.p/gstrvbuilder.c.o glib/libglib-2.0.0.dylib.p/gtestutils.c.o glib/libglib-2.0.0.dylib.p/gthread.c.o glib/libglib-2.0.0.dylib.p/gthreadpool.c.o glib/libglib-2.0.0.dylib.p/gtimer.c.o glib/libglib-2.0.0.dylib.p/gtimezone.c.o glib/libglib-2.0.0.dylib.p/gtrace.c.o glib/libglib-2.0.0.dylib.p/gtranslit.c.o glib/libglib-2.0.0.dylib.p/gtrashstack.c.o glib/libglib-2.0.0.dylib.p/gtree.c.o glib/libglib-2.0.0.dylib.p/guniprop.c.o glib/libglib-2.0.0.dylib.p/gutf8.c.o glib/libglib-2.0.0.dylib.p/gunibreak.c.o glib/libglib-2.0.0.dylib.p/gunicollate.c.o glib/libglib-2.0.0.dylib.p/gunidecomp.c.o glib/libglib-2.0.0.dylib.p/guri.c.o glib/libglib-2.0.0.dylib.p/gutils.c.o glib/libglib-2.0.0.dylib.p/guuid.c.o glib/libglib-2.0.0.dylib.p/gvariant.c.o glib/libglib-2.0.0.dylib.p/gvariant-core.c.o glib/libglib-2.0.0.dylib.p/gvariant-parser.c.o glib/libglib-2.0.0.dylib.p/gvariant-serialiser.c.o glib/libglib-2.0.0.dylib.p/gvarianttypeinfo.c.o glib/libglib-2.0.0.dylib.p/gvarianttype.c.o glib/libglib-2.0.0.dylib.p/gversion.c.o glib/libglib-2.0.0.dylib.p/gwakeup.c.o glib/libglib-2.0.0.dylib.p/gprintf.c.o glib/libglib-2.0.0.dylib.p/glib-unix.c.o glib/libglib-2.0.0.dylib.p/gspawn.c.o glib/libglib-2.0.0.dylib.p/giounix.c.o glib/libglib-2.0.0.dylib.p/gosxutils.m.o glib/libglib-2.0.0.dylib.p/gthread-posix.c.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -shared -install_name @rpath/libglib-2.0.0.dylib -compatibility_version 7304 -current_version 7304.0 -arch x86_64 -Wl,-rpath,@loader_path/../subprojects/proxy-libintl -Wl,-rpath,/Users/spaceim/.conan/data/pcre2/10.40/_/_/package/58c75cc50ae61b8beaa095a6c3595e162e692eab/lib -Wl,-rpath,/Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/lib -Wl,-rpath,/Users/spaceim/.conan/data/bzip2/1.0.8/_/_/package/3dae332ff311e1d3bde4193d43b68fb94dbb4706/lib glib/libcharset/libcharset.a subprojects/proxy-libintl/libintl.8.dylib /Users/spaceim/.conan/data/pcre2/10.40/_/_/package/58c75cc50ae61b8beaa095a6c3595e162e692eab/lib/libpcre2-8.dylib -F /Users/spaceim/.conan/data/pcre2/10.40/_/_/package/58c75cc50ae61b8beaa095a6c3595e162e692eab/Frameworks /Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/lib/libz.dylib /Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/Frameworks /Users/spaceim/.conan/data/bzip2/1.0.8/_/_/package/3dae332ff311e1d3bde4193d43b68fb94dbb4706/lib/libbz2.dylib -liconv -framework Foundation -framework CoreFoundation -framework AppKit -framework Carbon -lm
clang: error: no such file or directory: '/Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/Frameworks'

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
SSE4commented, Aug 22, 2022

Note: In case you consider it. To activate the “2.0” mode an empty layout() method is enough.

for the record (probably, irrelevant for this issue), this behavior might be consuming for newcomers: having an empty method doing essentially nothing, but has some important side-effects. reference also currently says nothing about that “side-effect” :https://docs.conan.io/en/latest/reference/conanfile/methods.html#layout I personally would prefer something more explicit (like attribute or method to activate new mode), but it’s probably too late to change. so at least, it would be nice to reflect in reference documentation.

1reaction
theartfulcommented, Oct 14, 2022

I don’t think the bug here is what it seems it is. Simply providing non-existing directory for “-F” won’t cause an error. The bug here is that “-F” flag and the proceeding directory are treated as different. Specifically this part:

-F /Users/spaceim/.conan/data/pcre2/10.40/_/_/package/58c75cc50ae61b8beaa095a6c3595e162e692eab/Frameworks
/Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/lib/libz.dylib
/Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/Frameworks

This should be

-F /Users/spaceim/.conan/data/pcre2/10.40/_/_/package/58c75cc50ae61b8beaa095a6c3595e162e692eab/Frameworks
/Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/lib/libz.dylib
-F /Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/Frameworks

The first line will only cause a warning, but the third line will cause the error, because it should be preceeded by “-F” flag. This happens because autotools (in my case with imagemagick), pkgconfig and apparently meson reorder the flags and remove duplicates. I opened this PR here to solve it https://github.com/conan-io/conan/pull/12307

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing files.... Apparently. | Apple Developer Forums
clang : error: no such file or directory: '__entitlements'. I've searched through my project and cannot find any mention of CoreTelephony or __entitlements....
Read more >
Clang on MacOS having problems with its includes
Verify the correct path to the SDK on your macOS/Xcode version. Reopen Terminal (sourcing the file may not work reliably). Then try your...
Read more >
Ccache news
Made ccache only reject -f(no-)color-diagnostics for a known GCC compiler. This fixes a problem when using said option with Clang on macOS.
Read more >
Clang Compiler User's Manual
Changes diagnostic output format to better match IDEs and command line tools. This option controls the output format of the filename, line number,...
Read more >
Crypto++ Library | 5.6.4 Release - CryptoPP
The bug fix and minor issue list for Crypto++ 5.6.4 follows. ... GCC, ARMv8 and "fatal error: arm_acle.h: No such file or directory"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found