Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Duplicate symbol _blake2b_init_key causes build failure on OS X Sierra #7

Closed
conor10 opened this issue Dec 21, 2016 · 3 comments
Closed

Comments

@conor10
Copy link
Contributor

conor10 commented Dec 21, 2016

Constellation will not build on OS X Sierra. This is due to both Argon2 and cryptonite exporting the same blake2b.c library symbols.

Details are available in the following threads:

haskell-crypto/cryptonite#109
haskell-hvr/argon2#10

Details of my setup are below.

  • haskell-stack 1.3.0 (which installed ghc-8.0.1)
  • berkeley-db-6.1.26
  • libsodium-1.0.11
$ stack install
constellation-0.1.0.0: build (lib + exe)
Preprocessing library constellation-0.1.0.0...
Preprocessing executable 'constellation-enclave-keygen' for
constellation-0.1.0.0...
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/constellation-enclave-keygen/constellation-enclave-keygen ...
duplicate symbol _blake2b_init_key in:
    /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
    /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
duplicate symbol _blake2b_init in:
    /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
    /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
duplicate symbol _blake2b_init_param in:
    /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
    /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
duplicate symbol _blake2b_final in:
    /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
    /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
duplicate symbol _blake2b_update in:
    /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
    /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
duplicate symbol _blake2b in:
    /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
    /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
ld: 6 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)

--  While building package constellation-0.1.0.0 using:
      /Users/xxx/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:constellation exe:constellation-enclave-keygen exe:constellation-node --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

XCode GCC version:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Verbose output:

$ stack install -v
Version 1.3.0 x86_64 hpack-0.15.0
2016-12-21 11:41:17.745595: [debug] Checking for project config at: /Users/xxx/code/quorum/constellation/stack.yaml
@(Stack/Config.hs:863:9)
2016-12-21 11:41:17.747020: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:881:13)
2016-12-21 11:41:17.748878: [debug] Trying to decode /Users/xxx/.stack/build-plan-cache/x86_64-osx/lts-7.5.cache
@(Data/Store/VersionTagged.hs:68:5)
2016-12-21 11:41:17.762898: [debug] Success decoding /Users/xxx/.stack/build-plan-cache/x86_64-osx/lts-7.5.cache
@(Data/Store/VersionTagged.hs:72:13)
2016-12-21 11:41:17.767066: [debug] Using standard GHC build
@(Stack/Setup.hs:597:9)
2016-12-21 11:41:17.767507: [debug] Getting global package database location
@(Stack/GhcPkg.hs:55:5)
2016-12-21 11:41:17.767911: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:17.768039: [debug] Asking GHC for its version
@(Stack/Setup/Installed.hs:103:13)
2016-12-21 11:41:17.769079: [debug] Getting Cabal package version
@(Stack/GhcPkg.hs:170:5)
2016-12-21 11:41:17.769220: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc --numeric-version
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:17.769342: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:17.842879: [debug] Process finished in 74ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:17.848030: [debug] Process finished in 77ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:17.888978: [debug] Process finished in 119ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc --numeric-version
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:17.889178: [debug] Resolving package entries
@(Stack/Setup.hs:252:5)
2016-12-21 11:41:17.889710: [debug] Starting to execute command inside EnvConfig
@(Stack/Runners.hs:163:18)
2016-12-21 11:41:17.889807: [debug] Parsing the cabal files of the local packages
@(Stack/Build/Source.hs:298:5)
2016-12-21 11:41:17.910327: [debug] Parsing the targets
@(Stack/Build/Source.hs:235:5)
2016-12-21 11:41:17.911035: [debug] Start: getPackageFiles /Users/xxx/code/quorum/constellation/constellation.cabal
@(Stack/Package.hs:250:21)
2016-12-21 11:41:17.970499: [debug] Finished in 57ms: getPackageFiles /Users/xxx/code/quorum/constellation/constellation.cabal
@(Stack/Package.hs:250:21)
2016-12-21 11:41:17.972337: [debug] Finding out which packages are already installed
@(Stack/Build/Installed.hs:68:5)
2016-12-21 11:41:17.972640: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.020985: [debug] Process finished in 48ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.038834: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.186934: [debug] Process finished in 147ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.188323: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.229435: [debug] Process finished in 40ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --user --no-user-package-db --package-db /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/pkgdb dump --expand-pkgroot
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.238547: [debug] Constructing the build plan
@(Stack/Build/ConstructPlan.hs:159:5)
2016-12-21 11:41:18.239401: [debug] Trying to decode /Users/xxx/.stack/indices/Hackage/00-index.cache
@(Data/Store/VersionTagged.hs:68:5)
2016-12-21 11:41:18.431973: [debug] Success decoding /Users/xxx/.stack/indices/Hackage/00-index.cache
@(Data/Store/VersionTagged.hs:72:13)
2016-12-21 11:41:18.587241: [debug] Checking if we are going to build multiple executables with the same name
@(Stack/Build.hs:196:5)
2016-12-21 11:41:18.587626: [debug] Executing the build plan
@(Stack/Build/Execute.hs:454:5)
2016-12-21 11:41:18.588661: [debug] Getting global package database location
@(Stack/GhcPkg.hs:55:5)
2016-12-21 11:41:18.588813: [debug] Run process: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.627094: [debug] Process finished in 38ms: /Users/xxx/.stack/programs/x86_64-osx/ghc-8.0.1/bin/ghc-pkg --no-user-package-db list --global
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.629225: [debug] Encoding /Users/xxx/code/quorum/constellation/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/stack-build-cache
@(Data/Store/VersionTagged.hs:51:5)
2016-12-21 11:41:18.629967: [debug] Finished writing /Users/xxx/code/quorum/constellation/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/stack-build-cache
@(Data/Store/VersionTagged.hs:55:5)
2016-12-21 11:41:18.630108: [info] constellation-0.1.0.0: build (lib + exe)
@(Stack/Build/Execute.hs:826:23)
2016-12-21 11:41:18.630569: [debug] Run process: /Users/xxx/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:constellation exe:constellation-enclave-keygen exe:constellation-node --ghc-options " -ddump-hi -ddump-to-file"
@(System/Process/Read.hs:306:3)
2016-12-21 11:41:18.812676: [info] Preprocessing library constellation-0.1.0.0...
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:21.881973: [info] Preprocessing executable 'constellation-enclave-keygen' for
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:21.882177: [info] constellation-0.1.0.0...
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:22.304909: [info] Linking .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/constellation-enclave-keygen/constellation-enclave-keygen ...
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673075: [warn] duplicate symbol _blake2b_init_key in:
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673226: [warn]     /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673321: [warn]     /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673444: [warn] duplicate symbol _blake2b_init in:
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673518: [warn]     /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673584: [warn]     /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673667: [warn] duplicate symbol _blake2b_init_param in:
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673731: [warn]     /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673794: [warn]     /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673930: [warn] duplicate symbol _blake2b_final in:
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.673995: [warn]     /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.674057: [warn]     /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.674138: [warn] duplicate symbol _blake2b_update in:
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.674199: [warn]     /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.674261: [warn]     /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.674339: [warn] duplicate symbol _blake2b in:
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.674469: [warn]     /Users/xxx/.stack/snapshots/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/cryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU/libHScryptonite-0.19-G9PYO4oOEqhDTta2u9rAaU.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.675459: [warn]     /Users/xxx/code/quorum/constellation/.stack-work/install/x86_64-osx/lts-7.5/8.0.1/lib/x86_64-osx-ghc-8.0.1/argon2-1.2.0-GzhheWYu2saHa29BPiZeRb/libHSargon2-1.2.0-GzhheWYu2saHa29BPiZeRb.a(blake2b.o)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.762342: [warn] ld: 6 duplicate symbols for architecture x86_64
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.777064: [warn] clang: error: linker command failed with exit code 1 (use -v to see invocation)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.778531: [warn] `gcc' failed in phase `Linker'. (Exit code: 1)
@(Stack/Build/Execute.hs:1013:67)
2016-12-21 11:41:23.814913: [debug] Start: getPackageFiles /Users/xxx/code/quorum/constellation/constellation.cabal
@(Stack/Package.hs:250:21)
2016-12-21 11:41:23.885131: [debug] Finished in 70ms: getPackageFiles /Users/xxx/code/quorum/constellation/constellation.cabal
@(Stack/Package.hs:250:21)
2016-12-21 11:41:23.893998: [debug] Encoding /Users/xxx/code/quorum/constellation/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/stack-build-cache
@(Data/Store/VersionTagged.hs:51:5)
2016-12-21 11:41:23.896432: [debug] Finished writing /Users/xxx/code/quorum/constellation/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/stack-build-cache
@(Data/Store/VersionTagged.hs:55:5)

--  While building package constellation-0.1.0.0 using:
      /Users/xxx/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.0.0_ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build lib:constellation exe:constellation-enclave-keygen exe:constellation-node --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
@patrickmn
Copy link
Contributor

This is related to #1 which we would be able to resolve soon. Thanks for your patience.

@patrickmn
Copy link
Contributor

Resolved by #8

@hvr
Copy link

hvr commented Mar 25, 2018

Fyi, this was resolved in argon2's latest release at https://hackage.haskell.org/package/argon2-1.3.0.0 which can be considered actively maintained again effective immediately.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants