brokenhandsio / vapor-oauth

OAuth2 Provider Library for Vapor
MIT License
133 stars 17 forks source link

Compilation fatal error / VaporOAuth/RouteHandlers/AuthorizeGetHandler #19

Closed mynona closed 10 months ago

mynona commented 11 months ago
222.7 [951/952] Compiling Vapor Application.swift
222.7 /build/.build/checkouts/vapor/Sources/Vapor/Request/Request.swift:5:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'RoutingKit'
222.7 import RoutingKit
222.7 ^
222.7 @preconcurrency 
222.7 /build/.build/checkouts/vapor/Sources/Vapor/Routing/Route.swift:2:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'RoutingKit'
222.7 import RoutingKit
222.7 ^
222.7 @preconcurrency 
223.8 [953/956] Compiling VaporOAuth EmptyAuthorizationHandler.swift
223.8 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:22: error: cannot find 'SecRandomCopyBytes' in scope
223.8         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
223.8                      ^~~~~~~~~~~~~~~~~~
223.8 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:41: error: cannot find 'kSecRandomDefault' in scope
223.8         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
223.8                                         ^~~~~~~~~~~~~~~~~
223.8 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:57:25: error: cannot find 'errSecSuccess' in scope
223.8         guard status == errSecSuccess else {
223.8                         ^~~~~~~~~~~~~
223.8 error: fatalError
223.8 /build/.build/checkouts/fluent/Sources/Fluent/Fluent+Sessions.swift:4:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'FluentKit'
223.8 import FluentKit
223.8 ^
223.8 @preconcurrency 
------
failed to solve: process "/bin/sh -c swift build -c release" did not complete successfully: exit code: 1
mynona commented 11 months ago

Routing kits needs:

.package(url: "https://github.com/vapor/routing-kit.git", from: "4.8.2"),

Next build issue is with Fluent Kit

bumping it manually up to didn't fix the issue: .package(url: "https://github.com/vapor/fluent-kit.git", from: "1.45.0"),

184.2 [953/956] Compiling VaporOAuth EmptyAuthorizationHandler.swift
184.2 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:22: error: cannot find 'SecRandomCopyBytes' in scope
184.2         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
184.2                      ^~~~~~~~~~~~~~~~~~
184.2 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:41: error: cannot find 'kSecRandomDefault' in scope
184.2         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
184.2                                         ^~~~~~~~~~~~~~~~~
184.2 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:57:25: error: cannot find 'errSecSuccess' in scope
184.2         guard status == errSecSuccess else {
184.2                         ^~~~~~~~~~~~~
184.2 error: fatalError
184.2 /build/.build/checkouts/fluent/Sources/Fluent/Fluent+Sessions.swift:4:1: remark: add '@preconcurrency' to suppress 'Sendable'-related warnings from module 'FluentKit'
184.2 import FluentKit
184.2 ^
184.2 @preconcurrency 
------
failed to solve: process "/bin/sh -c swift build -c release" did not complete successfully: exit code: 1
mynona commented 11 months ago

Tried to use vapor_auth with the current vapor version (4.89.1). Sorry for bringing this topic up but I wanted to use this repository but it fails during build time.

mynona commented 11 months ago

Tried also to build in debug mode

// build -c release build

This also didn't fix the issue. It is weird though, that it runs in Xcode and that the fatal error only shows up when it is build.

mynona commented 11 months ago

This is the error when it is build for debug → no difference:

101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:22: error: cannot find 'SecRandomCopyBytes' in scope
101.5         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
101.5                      ^~~~~~~~~~~~~~~~~~
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:41: error: cannot find 'kSecRandomDefault' in scope
101.5         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
101.5                                         ^~~~~~~~~~~~~~~~~
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:57:25: error: cannot find 'errSecSuccess' in scope
101.5         guard status == errSecSuccess else {
101.5                         ^~~~~~~~~~~~~
101.5 [2277/2286] Compiling VaporOAuth UserManager.swift
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:22: error: cannot find 'SecRandomCopyBytes' in scope
101.5         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
101.5                      ^~~~~~~~~~~~~~~~~~
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:41: error: cannot find 'kSecRandomDefault' in scope
101.5         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
101.5                                         ^~~~~~~~~~~~~~~~~
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:57:25: error: cannot find 'errSecSuccess' in scope
101.5         guard status == errSecSuccess else {
101.5                         ^~~~~~~~~~~~~
101.5 [2278/2286] Compiling VaporOAuth AuthorizeGetHandler.swift
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:22: error: cannot find 'SecRandomCopyBytes' in scope
101.5         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
101.5                      ^~~~~~~~~~~~~~~~~~
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:55:41: error: cannot find 'kSecRandomDefault' in scope
101.5         let status = SecRandomCopyBytes(kSecRandomDefault, 32, &bytes)
101.5                                         ^~~~~~~~~~~~~~~~~
101.5 /build/.build/checkouts/vapor-oauth/Sources/VaporOAuth/RouteHandlers/AuthorizeGetHandler.swift:57:25: error: cannot find 'errSecSuccess' in scope
101.5         guard status == errSecSuccess else {
101.5                         ^~~~~~~~~~~~~
102.0 [2280/2290] Wrapping AST for Leaf for debugging
102.0 [2282/2290] Compiling Fluent PageLimit.swift
102.3 [2284/2292] Compiling VaporOAuth CodeValidator.swift
102.3 [2285/2292] Compiling VaporOAuth ResourceServerAuthenticator.swift
102.3 [2286/2292] Compiling VaporOAuth ScopeValidator.swift
102.4 error: fatalError
mynona commented 11 months ago

Can it be connected to the issue that was fixed by this commit by @Brett-Best but unfortunately never merged?

Bildschirmfoto 2023-12-09 um 16 05 05

mynona commented 10 months ago

Fixed in this repo: https://github.com/vamsii777/vapor-oauth/releases