Closed stephencelis closed 4 years ago
@swift-ci create
@stephencelis Is there a way we can reproduce the issue?
Assuming you have Docker installed you could do the following:
git clone https://github.com/pointfreeco/pointfreeco
cd pointfreeco
git checkout e45923a36dc9dde5784c3d5206dcc279cf91315e
make bootstrap
make linux-start
Taking a look at this. Going to try to repro with docker.
@stephencelis can you restore the branch? When I clone the repo I get that the specified hash is not a reference. I want to try with your exact hash.
On another note, I tried your master branch with swift-5.3 asserts nightly snapshot and I hit a type checker error! So that might be the bug, but I need that specific hash in order to be 100% sure.
For anyone listening in, all I did was take the master branch, changed the docker file such that the base image was:
FROM swiftlang/swift:nightly-5.3-bionic as build
instead of
FROM swift:5.2.3 as build
and deleted all text at the beginning of the FROM that creates the runtime environment from the slim image. This one can then just do docker build . and you should reproduce the crasher. I am going to clone the this for the type checker if it is not the same crasher.
Score: 13 1 0 0 0 0 1 0 0 0 0 0 0
Contextual Type: (@escaping Middleware<StatusLineOpen, ResponseEnded, A, Data>) -> Middleware<StatusLineOpen, ResponseEnded, A, Data>
Type Variables:
$T574 [lvalue allowed] [noescape allowed] as ($T575, ($T575) -> $T576) -> $T576 @ locator@0xa184b70 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:15]
$T575 as FreeNearSemiring<$T2557> @ locator@0xa184bc0 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:15 -> generic parameter 'A']
$T576 as FreeNearSemiring<$T2558> @ locator@0xa184c10 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:15 -> generic parameter 'B']
$T582 [lvalue allowed] [noescape allowed] as (@escaping ($T2557) -> $T2558) -> (FreeNearSemiring<$T2557>) -> FreeNearSemiring<$T2558> @ locator@0xa1853f0 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18]
$T583 [lvalue allowed] [noescape allowed] as (WritableKeyPath<$T2496, $T2497>, $T2497) -> ($T2496) -> $T2496 @ locator@0xa181268 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:29]
$T584 as <<unresolvedtype>> @ locator@0xa181408 [KeyPath@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:22 -> key path root]
$T585 [lvalue allowed] [noescape allowed] as String @ locator@0xa1814a8 [KeyPath@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:22 -> key path component #​0 -> key path component result]
$T586 as String @ locator@0xa181570 [KeyPath@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:22 -> key path value]
$T587 [noescape allowed] as WritableKeyPath<$T2496, $T2497> @ locator@0xa181630 [KeyPath@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:22 -> key path type]
$T589 [noescape allowed] as ($T2496) -> $T2496 @ locator@0xa1817c0 [Binary@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:29 -> function result]
$T590 [noescape allowed] as (FreeNearSemiring<$T2557>) -> FreeNearSemiring<$T2558> @ locator@0xa181928 [Call@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18 -> function result]
$T591 [noescape allowed] equivalent to $T576 @ locator@0xa181ac0 [Binary@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:15 -> function result]
$T2496 equivalent to $T584 @ locator@0xa196e00 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:29 -> generic parameter 'Root']
$T2497 equivalent to $T586 @ locator@0xa196e50 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:29 -> generic parameter 'Value']
$T2557 as <<unresolvedtype>> @ locator@0xa197638 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18 -> generic parameter 'A']
$T2558 as <<unresolvedtype>> @ locator@0xa197690 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18 -> generic parameter 'B']
Active Constraints:
Inactive Constraints:
$T587 key path from $T584 -> $T586 [[locator@0xa181428 [KeyPath@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:22]]];
Resolved overloads:
selected overload set choice conn: $T519 == $T517
selected overload set choice ^: $T533 == (KeyPath<$T534, $T535>) -> ($T534) -> $T535
selected overload set choice middleware: $T547 == $T513
selected overload set choice conn: $T548 == $T517
selected overload set choice Conn<StatusLineOpen, A>.request: $T520 == URLRequest
selected overload set choice URLRequest.url: $T521 == URL?
selected overload set choice URL?.filter: $T522 == (@escaping ($T553) -> Bool) -> Optional<$T553>
selected overload set choice Optional<URL>.flatMap: $T527 == (($T554) throws -> $T555?) throws -> $T555?
selected overload set choice $T555?.flatMap: $T532 == (($T556) throws -> $T557?) throws -> $T557?
selected overload set choice $T557?.map: $T542 == (($T558) throws -> $T559) throws -> $T559?
selected overload set choice ??: $T518 == ($T572?, @autoclosure () throws -> $T572) throws -> $T572
selected overload set choice |>: $T574 == ($T575, ($T575) -> $T576) -> $T576
selected overload set choice $0: $T577 == $T573
selected overload set choice canonicalHost: $T588 == String
selected overload set choice .~: $T583 == (WritableKeyPath<$T2496, $T2497>, $T2497) -> ($T2496) -> $T2496
selected overload set choice URLComponents.Type.init: $T580 == () -> URLComponents
selected overload set choice map: $T582 == (@escaping ($T2557) -> $T2558) -> (FreeNearSemiring<$T2557>) -> FreeNearSemiring<$T2558>
selected overload set choice |>: $T2602 == ($T2603, ($T2603) -> $T2604) -> $T2604
selected overload set choice conn: $T2605 == $T517
selected overload set choice redirect: $T2606 == (String, Status, @escaping (Conn<HeadersOpen, $T2607>) -> IO<Conn<HeadersOpen, $T2607>>) -> (Conn<StatusLineOpen, $T2607>) -> IO<Conn<ResponseEnded, Data>>
selected overload set choice $0: $T2608 == $T2601
Opened types:
locator@0xa17a110 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:102:20] opens τ_0_1 -> $T535, τ_0_0 -> $T534
locator@0xa15dfc0 [UnresolvedDot@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:96:14 -> member] opens τ_0_1 -> $T552, τ_0_0 -> $T551
locator@0xa15e140 [UnresolvedDot@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:97:12 -> member] opens τ_0_0 -> $T553
locator@0xa15e510 [UnresolvedDot@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:98:12 -> member] opens τ_1_0 -> $T555, τ_0_0 -> $T554
locator@0xa17a050 [UnresolvedDot@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:102:12 -> member] opens τ_1_0 -> $T557, τ_0_0 -> $T556
locator@0xa17a948 [UnresolvedDot@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:103:12 -> member] opens τ_1_0 -> $T559, τ_0_0 -> $T558
locator@0xa15ddd0 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:104:11] opens τ_0_0 -> $T572
locator@0xa184b70 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:15] opens τ_0_1 -> $T576, τ_0_0 -> $T575
locator@0xa181268 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:29] opens τ_0_1 -> $T2497, τ_0_0 -> $T2496
locator@0xa1853f0 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18] opens τ_0_1 -> $T2558, τ_0_0 -> $T2557
locator@0xa19a8a0 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:103:23] opens τ_0_1 -> $T2604, τ_0_0 -> $T2603
locator@0xa19aaa0 [DeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:103:26] opens τ_0_0 -> $T2607
Defaulted constraints: locator@0xa197638 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18 -> generic parameter 'A']
Fixes:
[fix: remove extraneous argument(s)] @ locator@0xa185210 [Call@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:99:13 -> apply argument]
[fix: allow argument to parameter type conversion mismatch] @ locator@0xa181ba0 [Binary@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:15 -> apply argument -> comparing call argument #​0 to parameter #​0]
[fix: default generic argument 'A' to 'Any'] @ locator@0xa1853f0 [OverloadedDeclRef@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:100:18]
<unknown>:0: error: fatal error encountered during compilation; please file a bug report with your project and the crash log
<unknown>:0: note: Inactive constraints left over?
Stack dump:
0. Program arguments: /usr/bin/swift -frontend -c /build/.build/checkouts/swift-web/Sources/HttpPipeline/Conn.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/Method.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/Middleware.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/NIO.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/Response.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/SignedCookies.swift /build/.build/checkouts/swift-web/Sources/HttpPipeline/Status.swift -supplementary-output-file-map /tmp/supplementaryOutputs-5a1b48 -target x86_64-unknown-linux-gnu -disable-objc-interop -I /build/.build/x86_64-unknown-linux-gnu/release -I /build/.build/checkouts/swift-nio-extras/Sources/CNIOExtrasZlib/include -I /build/.build/checkouts/swift-nio/Sources/CNIOHTTPParser/include -I /build/.build/checkouts/swift-nio/Sources/CNIOSHA1/include -I /build/.build/checkouts/swift-nio/Sources/CNIOAtomics/include -I /build/.build/checkouts/swift-nio/Sources/CNIODarwin/include -I /build/.build/checkouts/swift-nio/Sources/CNIOLinux/include -enable-testing -g -module-cache-path /build/.build/x86_64-unknown-linux-gnu/release/ModuleCache -swift-version 5 -O -D SWIFT_PACKAGE -Xcc -fmodule-map-file=/build/.build/x86_64-unknown-linux-gnu/release/CNIOExtrasZlib.build/module.modulemap -Xcc -fmodule-map-file=/build/.build/x86_64-unknown-linux-gnu/release/CNIOHTTPParser.build/module.modulemap -Xcc -fmodule-map-file=/build/.build/x86_64-unknown-linux-gnu/release/CNIOSHA1.build/module.modulemap -Xcc -fmodule-map-file=/build/.build/x86_64-unknown-linux-gnu/release/CNIOAtomics.build/module.modulemap -Xcc -fmodule-map-file=/build/.build/x86_64-unknown-linux-gnu/release/CNIODarwin.build/module.modulemap -Xcc -fmodule-map-file=/build/.build/x86_64-unknown-linux-gnu/release/CNIOLinux.build/module.modulemap -Xcc -fmodule-map-file=/build/.build/checkouts/OpenSSL/Sources/OpenSSL/module.modulemap -parse-as-library -module-name HttpPipeline -num-threads 8 -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/Conn.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/Method.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/Middleware.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/NIO.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/Response.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/SharedMiddlewareTransformers.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/SignedCookies.swift.o -o /build/.build/x86_64-unknown-linux-gnu/release/HttpPipeline.build/Status.swift.o
1. Swift version 5.3-dev (LLVM 6855d3af88, Swift d33ecd327b)
2. While evaluating request TypeCheckSourceFileRequest(source_file "/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift")
3. While evaluating request TypeCheckFunctionBodyUntilRequest(HttpPipeline.(file).redirectUnrelatedHosts(isAllowedHost:canonicalHost:)@/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:87:13, )
4. While type-checking statement at [/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:92:57 - line:107:1] RangeText="{
return { middleware in
{ conn in
conn.request.url
.filter { !isAllowedHost($0.host ?? "") }
.flatMap {
URLComponents(url: $0, resolvingAgainstBaseURL: false)
|> map(\.host .~ canonicalHost)
}
.flatMap(^\.url)
.map { conn |> redirect(to: $0.absoluteString, status: .movedPermanently) }
?? middleware(conn)
}
}
"
5. While type-checking statement at [/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:94:5 - line:106:5] RangeText="return { middleware in
{ conn in
conn.request.url
.filter { !isAllowedHost($0.host ?? "") }
.flatMap {
URLComponents(url: $0, resolvingAgainstBaseURL: false)
|> map(\.host .~ canonicalHost)
}
.flatMap(^\.url)
.map { conn |> redirect(to: $0.absoluteString, status: .movedPermanently) }
?? middleware(conn)
}
"
6. While type-checking expression at [/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:94:12 - line:106:5] RangeText="{ middleware in
{ conn in
conn.request.url
.filter { !isAllowedHost($0.host ?? "") }
.flatMap {
URLComponents(url: $0, resolvingAgainstBaseURL: false)
|> map(\.host .~ canonicalHost)
}
.flatMap(^\.url)
.map { conn |> redirect(to: $0.absoluteString, status: .movedPermanently) }
?? middleware(conn)
}
"
/usr/bin/swift[0x51d1234]
/usr/bin/swift[0x51cee2e]
/usr/bin/swift[0x51d150c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f329e01b890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f329c686e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f329c688801]
/usr/bin/swift[0x56199a]
/usr/bin/swift[0x51257a4]
/usr/bin/swift[0x512569f]
/usr/bin/swift[0x12d5f57]
/usr/bin/swift[0x12bf312]
/usr/bin/swift[0x133998a]
/usr/bin/swift[0x12c0c2a]
/usr/bin/swift[0x13ab9b0]
/usr/bin/swift[0x13ab74e]
/usr/bin/swift[0x14639b1]
/usr/bin/swift[0x146413f]
/usr/bin/swift[0x1462bca]
/usr/bin/swift[0x145fc0f]
/usr/bin/swift[0x145ed72]
/usr/bin/swift[0x146704e]
/usr/bin/swift[0x1466b60]
/usr/bin/swift[0x1466a6e]
/usr/bin/swift[0x145f680]
/usr/bin/swift[0x145e85f]
/usr/bin/swift[0x1492fd6]
/usr/bin/swift[0x1494f30]
/usr/bin/swift[0x1494c97]
/usr/bin/swift[0x1494bde]
/usr/bin/swift[0x1492c0e]
/usr/bin/swift[0x1492be4]
/usr/bin/swift[0x6b6f9a]
/usr/bin/swift[0x6b288a]
/usr/bin/swift[0x6b1e20]
/usr/bin/swift[0x55fa07]
/usr/bin/swift[0x55e469]
/usr/bin/swift[0x4e8458]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f329c669b97]
/usr/bin/swift[0x4e7ffa]
The command '/bin/sh -c swift build --configuration release --enable-test-discovery --product Server -Xswiftc -g && swift build --configuration release --enable-test-discovery --product Runner -Xswiftc -g' returned a non-zero code: 1
gottesmm@borel pointfreeco % >....
"
6. While type-checking expression at [/build/.build/checkouts/swift-web/Sources/HttpPipeline/SharedMiddlewareTransformers.swift:94:12 - line:106:5] RangeText="{ middleware in
{ conn in
conn.request.url
.filter { !isAllowedHost($0.host ?? "") }
.flatMap {
URLComponents(url: $0, resolvingAgainstBaseURL: false)
|> map(\.host .~ canonicalHost)
}
.flatMap(^\.url)
.map { conn |> redirect(to: $0.absoluteString, status: .movedPermanently) }
?? middleware(conn)
}
"
/usr/bin/swift[0x51d1234]
/usr/bin/swift[0x51cee2e]
/usr/bin/swift[0x51d150c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f329e01b890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f329c686e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f329c688801]
/usr/bin/swift[0x56199a]
/usr/bin/swift[0x51257a4]
/usr/bin/swift[0x512569f]
/usr/bin/swift[0x12d5f57]
/usr/bin/swift[0x12bf312]
/usr/bin/swift[0x133998a]
/usr/bin/swift[0x12c0c2a]
/usr/bin/swift[0x13ab9b0]
/usr/bin/swift[0x13ab74e]
/usr/bin/swift[0x14639b1]
/usr/bin/swift[0x146413f]
/usr/bin/swift[0x1462bca]
/usr/bin/swift[0x145fc0f]
/usr/bin/swift[0x145ed72]
/usr/bin/swift[0x146704e]
/usr/bin/swift[0x1466b60]
/usr/bin/swift[0x1466a6e]
/usr/bin/swift[0x145f680]
/usr/bin/swift[0x145e85f]
/usr/bin/swift[0x1492fd6]
/usr/bin/swift[0x1494f30]
/usr/bin/swift[0x1494c97]
/usr/bin/swift[0x1494bde]
/usr/bin/swift[0x1492c0e]
/usr/bin/swift[0x1492be4]
/usr/bin/swift[0x6b6f9a]
/usr/bin/swift[0x6b288a]
/usr/bin/swift[0x6b1e20]
/usr/bin/swift[0x55fa07]
/usr/bin/swift[0x55e469]
/usr/bin/swift[0x4e8458]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7f329c669b97]
/usr/bin/swift[0x4e7ffa][B
The diff:
diff --git a/Dockerfile b/Dockerfile
index 10ad4e24..574c41b4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM swift:5.2.3 as build
+FROM swiftlang/swift:nightly-5.3-bionic as build
RUN apt-get update
RUN apt-get install -y cmake libpq-dev libssl-dev libz-dev openssl
@@ -15,18 +15,5 @@ RUN git clone https://github.com/commonmark/cmark \
RUN make -C cmark INSTALL_PREFIX=/usr
RUN make -C cmark install
-RUN swift build --configuration release --enable-pubgrub-resolver --enable-test-discovery --product Server -Xswiftc -g \
- && swift build --configuration release --enable-pubgrub-resolver --enable-test-discovery --product Runner -Xswiftc -g
-
-FROM swift:5.2.3-slim
-
-RUN apt-get update
-RUN apt-get install -y libpq-dev libssl-dev libz-dev openssl
-
-WORKDIR /app
-
-COPY --from=build /usr/include/cmark* /usr/include/
-COPY --from=build /usr/lib/libcmark* /usr/lib/
-COPY --from=build /build/.build/release/Server /usr/bin
-COPY --from=build /build/.build/release/Runner /usr/bin
-CMD Server
+RUN swift build --configuration release --enable-test-discovery --product Server -Xswiftc -g \
+ && swift build --configuration release --enable-test-discovery --product Runner -Xswiftc -g
Sorry about that! Thought GitHub kept branches more "alive". I pressed the "restore" button here: https://github.com/pointfreeco/pointfreeco/pull/640
Does that give you enough to work with?
Should be fixed by https://github.com/apple/swift/pull/31829 for master, cherry-picked to 5.3 by https://github.com/apple/swift/pull/31862.
Please verify using the next available nightly master and 5.3 snapshots from https://swift.org/download/#snapshots, and close the issue if satisfied.
Environment
Swift 5.2 LinuxAdditional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: fc962e9ebe5c06359c517a2618f8e63bIssue Description:
While trying to upgrade our server project to 5.2 we encountered the following error
The full build log is available from here: https://github.com/pointfreeco/pointfreeco/pull/640/checks?check_run_id=540418176