Opened 13 months ago

Last modified 13 months ago

#68565 assigned defect

py-pygit2 passes arbitrary linking flags: ld: warning: directory '/usr/local/lib64' following -L not found

Reported by: barracuda156 Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: dbevans (David B. Evans)
Port: py-pygit2

Description

It does not break the build, but I guess this is still wrong:

/opt/local/bin/gcc-mp-13 -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -arch ppc -isysroot/ -I/usr/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/worktree.c -o build/temp.macosx-10.6-ppc-cpython-310/src/worktree.o
/opt/local/bin/gcc-mp-13 -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc -arch ppc -isysroot/ build/temp.macosx-10.6-ppc-cpython-310/src/blob.o build/temp.macosx-10.6-ppc-cpython-310/src/branch.o build/temp.macosx-10.6-ppc-cpython-310/src/commit.o build/temp.macosx-10.6-ppc-cpython-310/src/diff.o build/temp.macosx-10.6-ppc-cpython-310/src/error.o build/temp.macosx-10.6-ppc-cpython-310/src/mailmap.o build/temp.macosx-10.6-ppc-cpython-310/src/note.o build/temp.macosx-10.6-ppc-cpython-310/src/object.o build/temp.macosx-10.6-ppc-cpython-310/src/odb.o build/temp.macosx-10.6-ppc-cpython-310/src/odb_backend.o build/temp.macosx-10.6-ppc-cpython-310/src/oid.o build/temp.macosx-10.6-ppc-cpython-310/src/options.o build/temp.macosx-10.6-ppc-cpython-310/src/patch.o build/temp.macosx-10.6-ppc-cpython-310/src/pygit2.o build/temp.macosx-10.6-ppc-cpython-310/src/refdb.o build/temp.macosx-10.6-ppc-cpython-310/src/refdb_backend.o build/temp.macosx-10.6-ppc-cpython-310/src/reference.o build/temp.macosx-10.6-ppc-cpython-310/src/repository.o build/temp.macosx-10.6-ppc-cpython-310/src/revspec.o build/temp.macosx-10.6-ppc-cpython-310/src/signature.o build/temp.macosx-10.6-ppc-cpython-310/src/stash.o build/temp.macosx-10.6-ppc-cpython-310/src/tag.o build/temp.macosx-10.6-ppc-cpython-310/src/tree.o build/temp.macosx-10.6-ppc-cpython-310/src/treebuilder.o build/temp.macosx-10.6-ppc-cpython-310/src/utils.o build/temp.macosx-10.6-ppc-cpython-310/src/walker.o build/temp.macosx-10.6-ppc-cpython-310/src/wildmatch.o build/temp.macosx-10.6-ppc-cpython-310/src/worktree.o -L/usr/local/lib -L/usr/local/lib64 -lgit2 -o build/lib.macosx-10.6-ppc-cpython-310/pygit2/_pygit2.cpython-310-darwin.so
ld: warning: directory '/usr/local/lib64' following -L not found
building 'pygit2._libgit2' extension
creating build/temp.macosx-10.6-ppc-cpython-310/build
creating build/temp.macosx-10.6-ppc-cpython-310/build/temp.macosx-10.6-ppc-cpython-310
/opt/local/bin/gcc-mp-13 -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -pipe -Os -arch ppc -isysroot/ -I/usr/local/include -I/opt/local/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c build/temp.macosx-10.6-ppc-cpython-310/pygit2._libgit2.c -o build/temp.macosx-10.6-ppc-cpython-310/build/temp.macosx-10.6-ppc-cpython-310/pygit2._libgit2.o
/opt/local/bin/gcc-mp-13 -bundle -undefined dynamic_lookup -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc -arch ppc -isysroot/ build/temp.macosx-10.6-ppc-cpython-310/build/temp.macosx-10.6-ppc-cpython-310/pygit2._libgit2.o -L/usr/local/lib -L/usr/local/lib64 -lgit2 -o build/lib.macosx-10.6-ppc-cpython-310/pygit2/_libgit2.abi3.so
ld: warning: directory '/usr/local/lib64' following -L not found
installing to build/bdist.macosx-10.6-ppc/wheel

Change History (1)

comment:1 in reply to:  description Changed 13 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: dbevans added

Replying to barracuda156:

but I guess this is still wrong:

Definitely. -I/usr/local/include also shouldn't be there.

I haven't tried it but from the code it looks like the fix is to supply LIBGIT2 and LIBGIT2_LIB environment variables:

https://github.com/libgit2/pygit2/blob/02fea5755e07b59608c6807b209a0dbb3de140ab/pygit2/_build.py#L43-L64

Note: See TracTickets for help on using tickets.