Skip to content
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

"duplicate symbol for architecture x86_64" when compiling 1.0.0 wheel on Mac OS X 10.14+ #963

Closed
jemcclin opened this issue Dec 9, 2019 · 3 comments

Comments

@jemcclin
Copy link

jemcclin commented Dec 9, 2019

Installing pygit2 version 1.0.0 fails on building the wheel with the following error on Mac OS X 10.14 Mojave with Python 3.7:

        build/temp.macosx-10.14-x86_64-3.7/src/odb.o
        build/temp.macosx-10.14-x86_64-3.7/src/odb_backend.o
    ld: 1 duplicate symbol for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'clang' failed with exit status 1

The build fails with a near-identical error on Catalina as well--just different OS X version numbers in the path.

This error occurs when installing through pip3 install pygit2==1.0.0 or through python3 setup.py install run from a fresh copy of master cloned from the git repo.

pip3 install pygit2==0.28.2 still compiles, installs, and works as expected. libgit2 0.28.3 is installed (from Homebrew) on all of the machines I've been able to test with.

The full output of the setup.py run from Mac OS X 10.15 Catalina running Python 3.7:

warning: no previously-included files found matching 'setup.pyc'
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
pycparser.ply.__pycache__.lex.cpython-37: module references __file__
pycparser.ply.__pycache__.lex.cpython-37: module MAY be using inspect.getsourcefile
pycparser.ply.__pycache__.yacc.cpython-37: module references __file__
pycparser.ply.__pycache__.yacc.cpython-37: module MAY be using inspect.getsourcefile
pycparser.ply.__pycache__.yacc.cpython-37: module MAY be using inspect.stack
pycparser.ply.__pycache__.ygen.cpython-37: module references __file__

Installed /Users/jemcclin/pygit2/.eggs/pycparser-2.19-py3.7.egg
running install
running bdist_egg
running egg_info
creating pygit2.egg-info
writing pygit2.egg-info/PKG-INFO
writing dependency_links to pygit2.egg-info/dependency_links.txt
writing requirements to pygit2.egg-info/requires.txt
writing top-level names to pygit2.egg-info/top_level.txt
writing manifest file 'pygit2.egg-info/SOURCES.txt'
reading manifest file 'pygit2.egg-info/SOURCES.txt'
writing manifest file 'pygit2.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.15-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.7
creating build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/config.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/index.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/credentials.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/remote.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/__init__.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/_build.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/refspec.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/submodule.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/utils.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/blame.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/settings.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/errors.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/_run.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/repository.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
copying pygit2/ffi.py -> build/lib.macosx-10.15-x86_64-3.7/pygit2
creating build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/oid.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/index.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/attr.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/blame.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/pack.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/revert.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/net.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/config.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/types.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/repository.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/clone.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/submodule.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/errors.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/merge.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/graph.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/describe.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/stash.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/remote.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/strarray.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/buffer.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/diff.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/common.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/proxy.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/refspec.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/transport.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
copying pygit2/decl/checkout.h -> build/lib.macosx-10.15-x86_64-3.7/pygit2/decl
running build_ext
generating cffi module 'build/temp.macosx-10.15-x86_64-3.7/pygit2._libgit2.c'
creating build/temp.macosx-10.15-x86_64-3.7
building '_pygit2' extension
creating build/temp.macosx-10.15-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/blob.c -o build/temp.macosx-10.15-x86_64-3.7/src/blob.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/branch.c -o build/temp.macosx-10.15-x86_64-3.7/src/branch.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/commit.c -o build/temp.macosx-10.15-x86_64-3.7/src/commit.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/diff.c -o build/temp.macosx-10.15-x86_64-3.7/src/diff.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/error.c -o build/temp.macosx-10.15-x86_64-3.7/src/error.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/mailmap.c -o build/temp.macosx-10.15-x86_64-3.7/src/mailmap.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/note.c -o build/temp.macosx-10.15-x86_64-3.7/src/note.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/object.c -o build/temp.macosx-10.15-x86_64-3.7/src/object.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/odb.c -o build/temp.macosx-10.15-x86_64-3.7/src/odb.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/odb_backend.c -o build/temp.macosx-10.15-x86_64-3.7/src/odb_backend.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/oid.c -o build/temp.macosx-10.15-x86_64-3.7/src/oid.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/options.c -o build/temp.macosx-10.15-x86_64-3.7/src/options.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/patch.c -o build/temp.macosx-10.15-x86_64-3.7/src/patch.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/pygit2.c -o build/temp.macosx-10.15-x86_64-3.7/src/pygit2.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/reference.c -o build/temp.macosx-10.15-x86_64-3.7/src/reference.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/repository.c -o build/temp.macosx-10.15-x86_64-3.7/src/repository.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/signature.c -o build/temp.macosx-10.15-x86_64-3.7/src/signature.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/tag.c -o build/temp.macosx-10.15-x86_64-3.7/src/tag.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/tree.c -o build/temp.macosx-10.15-x86_64-3.7/src/tree.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/treebuilder.c -o build/temp.macosx-10.15-x86_64-3.7/src/treebuilder.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/utils.c -o build/temp.macosx-10.15-x86_64-3.7/src/utils.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/walker.c -o build/temp.macosx-10.15-x86_64-3.7/src/walker.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/worktree.c -o build/temp.macosx-10.15-x86_64-3.7/src/worktree.o
clang -bundle -undefined dynamic_lookup -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk build/temp.macosx-10.15-x86_64-3.7/src/blob.o build/temp.macosx-10.15-x86_64-3.7/src/branch.o build/temp.macosx-10.15-x86_64-3.7/src/commit.o build/temp.macosx-10.15-x86_64-3.7/src/diff.o build/temp.macosx-10.15-x86_64-3.7/src/error.o build/temp.macosx-10.15-x86_64-3.7/src/mailmap.o build/temp.macosx-10.15-x86_64-3.7/src/note.o build/temp.macosx-10.15-x86_64-3.7/src/object.o build/temp.macosx-10.15-x86_64-3.7/src/odb.o build/temp.macosx-10.15-x86_64-3.7/src/odb_backend.o build/temp.macosx-10.15-x86_64-3.7/src/oid.o build/temp.macosx-10.15-x86_64-3.7/src/options.o build/temp.macosx-10.15-x86_64-3.7/src/patch.o build/temp.macosx-10.15-x86_64-3.7/src/pygit2.o build/temp.macosx-10.15-x86_64-3.7/src/reference.o build/temp.macosx-10.15-x86_64-3.7/src/repository.o build/temp.macosx-10.15-x86_64-3.7/src/signature.o build/temp.macosx-10.15-x86_64-3.7/src/tag.o build/temp.macosx-10.15-x86_64-3.7/src/tree.o build/temp.macosx-10.15-x86_64-3.7/src/treebuilder.o build/temp.macosx-10.15-x86_64-3.7/src/utils.o build/temp.macosx-10.15-x86_64-3.7/src/walker.o build/temp.macosx-10.15-x86_64-3.7/src/worktree.o -L/usr/local/lib -L/usr/local/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/sqlite/lib -lgit2 -o build/lib.macosx-10.15-x86_64-3.7/_pygit2.cpython-37m-darwin.so
duplicate symbol '_OdbBackendType' in:
    build/temp.macosx-10.15-x86_64-3.7/src/odb.o
    build/temp.macosx-10.15-x86_64-3.7/src/odb_backend.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
@svenKautlenbach
Copy link

svenKautlenbach commented Dec 10, 2019

+1, having exactly the same problem.
What appears is that either odb.c or odb_backend.c should declare type variable with different name or either of those modules should make it static. Root is the pygit2.c that references this extern variable.
Output of the git grep OdbBackendType

src/odb.c:38:PyTypeObject OdbBackendType;
src/odb.c:258:    if (!PyObject_IsInstance((PyObject *)backend, (PyObject *)&OdbBackendType)) {
src/odb_backend.c:125:PyTypeObject OdbBackendType = {
src/odb_backend.c:169:    OdbBackend *py_odb_backend = PyObject_New(OdbBackend, &OdbBackendType);
src/odb_backend.c:239:    &OdbBackendType,                           /* tp_base           */
src/odb_backend.c:336:    &OdbBackendType,                           /* tp_base           */
src/pygit2.c:45:extern PyTypeObject OdbBackendType;
src/pygit2.c:315:    INIT_TYPE(OdbBackendType, NULL, NULL)
src/pygit2.c:317:    INIT_TYPE(OdbBackendPackType, &OdbBackendType, PyType_GenericNew)
src/pygit2.c:319:    INIT_TYPE(OdbBackendLooseType, &OdbBackendType, PyType_GenericNew)

@jdavid jdavid closed this as completed in 19874e2 Dec 14, 2019
@jdavid
Copy link
Member

jdavid commented Dec 14, 2019

Should be fixed, please verify (I cannot reproduce the error in Linux, maybe there're other variables to declare extern).

@justindesilets
Copy link

I can confirm that I was able to successfully build the library on Mac OS 10.15.1 in a python 3.7.5 virtual environment. Libgit2-0.28.3 was installed via brew.

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

No branches or pull requests

4 participants