Kitura / BlueECC

Elliptic-curve cryptography for Swift
Apache License 2.0
92 stars 35 forks source link

Swift-JWT fails to compile #25

Closed conwyn-flavell closed 4 years ago

conwyn-flavell commented 4 years ago

When using Colab

%install '.package(url: "https://github.com/IBM-Swift/Swift-JWT.git", from: "3.0.0")' SwiftJWT

It appears to be using Swift version 5.3-dev rather than 5.2. I know 5.3 is being announced this week.

Details below. This was working late 2019.

[4/24] Merging module Logging SIL verification failed: return with stack allocs that haven't been deallocated: state.Stack.empty() Verifying instruction: %18 = struct $EllipticCurve (%0 : $EllipticCurve.InternalRepresentation, %1 : $Optional, %2 : $Int32, %6 : $@callee_guaranteed (Optional<UnsafePointer>, Int, Optional<UnsafeMutablePointer>) -> Optional<UnsafeMutablePointer>, %17 : $Int, %3 : $Int) // user: %19 -> return %18 : $EllipticCurve // id: %19 In function: // EllipticCurve.init(internalRepresentation:signingAlgorithm:nativeCurve:keySize:) sil private [ossa] @$s10CryptorECC13EllipticCurveV22internalRepresentation16signingAlgorithm06nativeD07keySizeA2C08InternalF033_9ED7A968DCE1F3D03FCEF1D6E4BAB780LLO_s13OpaquePointerVSgs5Int32VSitcAILlfC : $@convention(method) (EllipticCurve.InternalRepresentation, Optional, Int32, Int, @thin EllipticCurve.Type) -> @owned EllipticCurve { // %0 // user: %18 // %1 // user: %18 // %2 // user: %18 // %3 // user: %18 bb0(%0 : $EllipticCurve.InternalRepresentation, %1 : $Optional, %2 : $Int32, %3 : $Int, %4 : $@thin EllipticCurve.Type): // functionref @nonobjc SHA256(:::) %5 = function_ref @$sSo6SHA256ySpys5UInt8VGSgSPyACGSg_SiAEtFTO : $@convention(thin) (Optional<UnsafePointer>, Int, Optional<UnsafeMutablePointer>) -> Optional<UnsafeMutablePointer> // user: %6 %6 = thin_to_thick_function %5 : $@convention(thin) (Optional<UnsafePointer>, Int, Optional<UnsafeMutablePointer>) -> Optional<UnsafeMutablePointer> to $@callee_guaranteed (Optional<UnsafePointer>, Int, Optional<UnsafeMutablePointer>) -> Optional<UnsafeMutablePointer> // user: %18 %7 = alloc_stack $Int // users: %17, %15 %8 = metatype $@thin Int.Type %9 = metatype $@thick Int.Type // user: %15 // function_ref SHA256_DIGEST_LENGTH.getter %10 = function_ref @$sSC20SHA256_DIGEST_LENGTHs5Int32Vvg : $@convention(thin) () -> Int32 // user: %11 %11 = apply %10() : $@convention(thin) () -> Int32 // user: %13 %12 = alloc_stack $Int32 // users: %16, %15, %13 store %11 to [trivial] %12 : $Int32 // id: %13 // functionref SignedInteger<>.init(:) %14 = function_ref @$sSZss17FixedWidthIntegerRzrlEyxqdcSzRdlufC : $@convention(method) <τ_0_0 where τ_0_0 : FixedWidthInteger, τ_0_0 : SignedInteger><τ_1_0 where τ_1_0 : BinaryInteger> (@in τ_1_0, @thick τ_0_0.Type) -> @out τ_0_0 // user: %15 %15 = apply %14<Int, Int32>(%7, %12, %9) : $@convention(method) <τ_0_0 where τ_0_0 : FixedWidthInteger, τ_0_0 : SignedInteger><τ_1_0 where τ_1_0 : BinaryInteger> (@in τ_1_0, @thick τ_0_0.Type) -> @out τ_0_0 dealloc_stack %12 : $Int32 // id: %16 %17 = load [trivial] %7 : $*Int // user: %18 %18 = struct $EllipticCurve (%0 : $EllipticCurve.InternalRepresentation, %1 : $Optional, %2 : $Int32, %6 : $@callee_guaranteed (Optional<UnsafePointer>, Int, Optional<UnsafeMutablePointer>) -> Optional<UnsafeMutablePointer>, %17 : $Int, %3 : $Int) // user: %19 return %18 : $EllipticCurve // id: %19 } // end sil function '$s10CryptorECC13EllipticCurveV22internalRepresentation16signingAlgorithm06nativeD07keySizeA2C08InternalF033_9ED7A968DCE1F3D03FCEF1D6E4BAB780LLO_s13OpaquePointerVSgs5Int32VSitcAILlfC'

Stack dump:

  1. Program arguments: /swift/toolchain/usr/bin/swift -frontend -c /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ASN1.swift /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/Data+Extensions.swift /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECDecryptable.swift /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECEncryptable.swift /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECError.swift /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECPrivateKey.swift -primary-file /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECPublicKey.swift -primary-file /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECSignable.swift -primary-file /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/ECSignature.swift -primary-file /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/EllipticCurve.swift -primary-file /content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/SSLPointerTricks.swift -supplementary-output-file-map /tmp/supplementaryOutputs-0d11d3 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug -enable-testing -g -module-cache-path /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/content/swift-install/package/.build/checkouts/OpenSSL/Sources/OpenSSL/module.modulemap -parse-as-library -module-name CryptorECC -o /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/CryptorECC.build/ECPublicKey.swift.o -o /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/CryptorECC.build/ECSignable.swift.o -o /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/CryptorECC.build/ECSignature.swift.o -o /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/CryptorECC.build/EllipticCurve.swift.o -o /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/CryptorECC.build/SSLPointerTricks.swift.o -index-store-path /content/swift-install/package/.build/x86_64-unknown-linux-gnu/debug/index/store -index-system-modules
  2. Swift version 5.3-dev (LLVM 5a342fdfac, Swift ec4315266b)
  3. While evaluating request SILGenSourceFileRequest(SIL Generation for file "/content/swift-install/package/.build/checkouts/BlueECC/Sources/CryptorECC/EllipticCurve.swift")
  4. While silgen emitConstructor SIL function "@$s10CryptorECC13EllipticCurveV22internalRepresentation16signingAlgorithm06nativeD07keySizeA2C08InternalF033_9ED7A968DCE1F3D03FCEF1D6E4BAB780LLO_s13OpaquePointerVSgs5Int32VSitcAILlfC".
conwyn-flavell commented 4 years ago

Tensorflow problem now OK