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

[SR-6537] SRP source breakage: Fatal error: Duplicate values for key: 'BigInt' #4848

Closed
lplarson opened this issue Dec 5, 2017 · 8 comments
Assignees
Labels

Comments

@lplarson
Copy link
Member

lplarson commented Dec 5, 2017

Previous ID SR-6537
Radar rdar://problem/35888688
Original Reporter @lplarson
Type Bug
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee @DougGregor
Priority Medium

md5: 493c65f8d98f9c48ae1c716def3e97ec

duplicates:

  • SR-5918 SwiftPM should error out when there are two products with same name

Issue Description:

To reproduce:

  1. Install latest GM/Beta Xcode
  2. $ git clone git@github.com:apple/swift-source-compat-suite.git
  3. $ cd swift-source-compat-suite

To build Swift from scratch before testing:
4. $ ./reproduce.py master --project-path SRP --assertions

Or if you've already built Swift:
4. $ ./reproduce.py master --project-path SRP --assertions --swiftc path/to/swiftc

https://ci.swift.org/job/swift-PR-source-compat-suite-test-macOS/51/artifact/swift-source-compat-suite/FAIL_BuildSwiftPackage_SRP.log

Fatal error: Duplicate values for key: 'BigInt': file /Users/buildnode/jenkins/workspace-private/swift-PR-source-compat-suite-test-macOS/build/compat_macos/swift-macosx-x86_64/stdlib/public/core/8/HashedCollections.swift, line 8100
Current stack trace:
0    libswiftCore.dylib                 0x0000000102da17c0 _swift_stdlib_reportFatalErrorInFile + 224
1    libswiftCore.dylib                 0x0000000102a329d0 closure #​1 in closure #​1 in closure #​1 in _assertionFailure(_:_:file:line:flags:) + 320
2    libswiftCore.dylib                 0x0000000102d3c640 partial apply for closure #​1 in closure #​1 in closure #​1 in _assertionFailure(_:_:file:line:flags:) + 34
3    libswiftCore.dylib                 0x0000000102a31e70 specialized StaticString.withUTF8Buffer<A>(_:) + 58
4    libswiftCore.dylib                 0x0000000102d3c210 partial apply for closure #&#8203;1 in _assertionFailure(_:_:file:line:flags:) + 565
5    libswiftCore.dylib                 0x0000000102a31e70 specialized StaticString.withUTF8Buffer<A>(_:) + 58
6    libswiftCore.dylib                 0x0000000102c1f340 specialized _assertionFailure(_:_:file:line:flags:) + 144
7    libswiftCore.dylib                 0x0000000102cd2d50 specialized _VariantDictionaryBuffer.nativeMerge<A>(_:uniquingKeysWith:) + 4656
8    libswiftCore.dylib                 0x0000000102ab01d0 Dictionary.init<A>(uniqueKeysWithValues:) + 586
9    swift-build                        0x000000010245b370 Array.createDictionary<A, B>(_:) + 252
10   swift-build                        0x00000001025ef7c0 specialized createResolvedPackages(allManifests:manifestToPackage:rootManifestSet:diagnostics:) + 9560
11   swift-build                        0x00000001025d5c90 PackageGraphLoader.load(root:externalManifests:diagnostics:fileSystem:shouldCreateMultipleTestProducts:) + 5667
12   swift-build                        0x00000001027527c0 specialized Workspace.loadPackageGraph(root:createMultipleTestProducts:diagnostics:) + 965
13   swift-build                        0x00000001027320d0 Workspace.loadPackageGraph(root:createMultipleTestProducts:diagnostics:) + 36
14   swift-build                        0x000000010255da30 specialized SwiftTool.loadPackageGraph() + 124
15   swift-build                        0x0000000102572bd0 specialized SwiftTool.loadPackageGraph() + 9
16   swift-build                        0x00000001025305a0 SwiftBuildTool.runImpl() + 1208
17   swift-build                        0x000000010255d3d0 SwiftTool.run() + 135
18   swift-build                        0x00000001027aecb0 main + 272
19   libdyld.dylib                      0x00007fffbe8bb234 start + 1
@ankitspd
Copy link
Member

ankitspd commented Dec 6, 2017

@swift-ci create

@ankitspd
Copy link
Member

ankitspd commented Dec 6, 2017

#1411

@Bouke
Copy link
Contributor

Bouke commented Dec 17, 2017

The error message now throws a warning about the duplicate, but it's not clear from the error message where the original is defined (swift-4.1-DEVELOPMENT-SNAPSHOT-2017-12-16-a):

swift package show-dependencies
.
├── Cryptor<https://github.com/IBM-Swift/BlueCryptor.git@0.8.16>
│ └── CommonCrypto<https://github.com/IBM-Swift/CommonCrypto.git@0.1.5>
└── BigInt<https://github.com/lorentey/BigInt.git@3.0.0>
  └── SipHash<https://github.com/attaswift/SipHash@1.2.0>
'BigInt' /Users/bouke/Library/Mobile Documents/com~apple~CloudDocs/Developer/SRP/.build/checkouts/BigInt.git--5127040856227023039: warning: Ignoring duplicate product 'BigInt' (static)

After a short investigation I found that BigInt itself has two products named BigInt (one static, one dynamic). While that resolves the error in SwiftPM, it now results in another breaking change for BigInt. Mostly around some integers not conforming to protocol 'BidirectionalCollection'.

@ankitspd
Copy link
Member

Thats weird, this change shouldn't trigger a compiler issue. I'll investigate.

@ankitspd
Copy link
Member

SRP compiles successfully for me after this change.

@Bouke
Copy link
Contributor

Bouke commented Dec 19, 2017

BigInt (dependency of SRP) doesn't build for me against a recent 4.1 snapshot, the build error can be found here: attaswift/BigInt#38 I haven't investigated why, but it looks like a source breaking change in 4.1.

@DougGregor
Copy link
Member

swiftpm has been fixed (thanks Ankit!), and BigInt is fixed by apple/swift#13567

@Bouke
Copy link
Contributor

Bouke commented Dec 23, 2017

Thank you all. The build succeeds and the tests pass. 👍

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants