Skip to content

Commit 0b15da4

Browse files
authored
Merge branch 'JuliaWeb:master' into master
2 parents d60bb5e + 4a0bf01 commit 0b15da4

File tree

4 files changed

+63
-22
lines changed

4 files changed

+63
-22
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,54 +21,48 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
version:
24-
- '1.6'
24+
- 'min'
25+
- 'lts'
26+
- '1.9' # test because we know there was a precompilation issue on 1.9 issues/1202
2527
- '1' # automatically expands to the latest stable 1.x release of Julia
2628
- 'nightly'
2729
os:
2830
- ubuntu-latest
2931
- macOS-latest
3032
- windows-latest
3133
arch:
32-
- x64
34+
- default
3335
include:
3436
- os: windows-latest
3537
version: '1'
3638
arch: x86
3739
exclude:
38-
- os: windows-latest
39-
version: '1.6'
40+
- os: macOS-latest
41+
version: 'min' # no apple silicon support for Julia 1.6
4042
steps:
41-
- uses: actions/checkout@v3
42-
- uses: julia-actions/setup-julia@v1
43+
- uses: actions/checkout@v4
44+
- uses: julia-actions/setup-julia@v2
4345
with:
4446
version: ${{ matrix.version }}
4547
arch: ${{ matrix.arch }}
46-
- uses: actions/cache@v3
47-
env:
48-
cache-name: cache-artifacts
49-
with:
50-
path: ~/.julia/artifacts
51-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
52-
restore-keys: |
53-
${{ runner.os }}-test-${{ env.cache-name }}-
54-
${{ runner.os }}-test-
55-
${{ runner.os }}-
48+
- uses: julia-actions/cache@v2
5649
- uses: julia-actions/julia-buildpkg@v1
5750
- uses: julia-actions/julia-runtest@v1
5851
env:
5952
PIE_SOCKET_API_KEY: ${{ secrets.PIE_SOCKET_API_KEY }}
6053
JULIA_VERSION: ${{ matrix.version }}
6154
JULIA_NUM_THREADS: 2
6255
- uses: julia-actions/julia-processcoverage@v1
63-
- uses: codecov/codecov-action@v1
56+
- uses: codecov/codecov-action@v5
6457
with:
65-
file: lcov.info
58+
files: lcov.info
59+
token: ${{ secrets.GITHUB_TOKEN }}
6660
docs:
6761
name: Documentation
6862
runs-on: ubuntu-latest
6963
steps:
70-
- uses: actions/checkout@v3
71-
- uses: julia-actions/setup-julia@v1
64+
- uses: actions/checkout@v4
65+
- uses: julia-actions/setup-julia@v2
7266
with:
7367
version: '1'
7468
- run: |

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HTTP"
22
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
33
authors = ["Jacob Quinn", "contributors: https://github.com/JuliaWeb/HTTP.jl/graphs/contributors"]
4-
version = "1.10.10"
4+
version = "1.10.12"
55

66
[deps]
77
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
@@ -14,6 +14,7 @@ LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
1414
MbedTLS = "739be429-bea8-5141-9913-cc70e7f3736d"
1515
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
1616
OpenSSL = "4d8831e6-92b7-49fb-bdf8-b643e874388c"
17+
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1718
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1819
SimpleBufferStream = "777ac1f9-54b0-4bf8-805c-2214025038e7"
1920
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
@@ -27,6 +28,7 @@ ExceptionUnwrapping = "0.1"
2728
LoggingExtras = "0.4.9,1"
2829
MbedTLS = "0.6.8, 0.7, 1"
2930
OpenSSL = "1.3"
31+
PrecompileTools = "1.2.1"
3032
SimpleBufferStream = "1.1"
3133
URIs = "1.3"
3234
julia = "1.6"
@@ -37,9 +39,9 @@ Deno_jll = "04572ae6-984a-583e-9378-9577a1c2574d"
3739
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
3840
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
3941
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
42+
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
4043
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4144
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
42-
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
4345

4446
[targets]
4547
test = ["BufferedStreams", "Deno_jll", "Distributed", "InteractiveUtils", "JSON", "Test", "Unitful", "NetworkOptions"]

src/HTTP.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,4 +631,9 @@ function Base.parse(::Type{T}, str::AbstractString)::T where T <: Message
631631
return m
632632
end
633633

634+
# only run if precompiling
635+
if VERSION >= v"1.9.0-0" && ccall(:jl_generating_output, Cint, ()) == 1
636+
include("precompile.jl")
637+
end
638+
634639
end # module

src/precompile.jl

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using PrecompileTools: @setup_workload, @compile_workload
2+
3+
@setup_workload begin
4+
# These need to be safe to call here and bake into the pkgimage, i.e. called twice.
5+
Connections.__init__()
6+
MultiPartParsing.__init__()
7+
Parsers.__init__()
8+
9+
# Doesn't seem to be needed here, and might not be safe to call twice (here and during runtime)
10+
# ConnectionRequest.__init__()
11+
12+
gzip_data(data::String) = read(GzipCompressorStream(IOBuffer(data)))
13+
14+
# random port in the dynamic/private range (49152–65535) which are are
15+
# least likely to be used by well-known services
16+
_port = 57813
17+
18+
cert, key = joinpath.(@__DIR__, "../test", "resources", ("cert.pem", "key.pem"))
19+
sslconfig = MbedTLS.SSLConfig(cert, key)
20+
21+
server = HTTP.serve!("0.0.0.0", _port; verbose = -1, listenany=true, sslconfig=sslconfig) do req
22+
HTTP.Response(200, ["Content-Encoding" => "gzip"], gzip_data("dummy response"))
23+
end
24+
# listenany allows changing port if that one is already in use, so check the actual port
25+
_port = HTTP.port(server)
26+
url = "https://localhost:$_port"
27+
28+
env = ["JULIA_NO_VERIFY_HOSTS" => "localhost",
29+
"JULIA_SSL_NO_VERIFY_HOSTS" => nothing,
30+
"JULIA_ALWAYS_VERIFY_HOSTS" => nothing]
31+
withenv(env...) do
32+
@compile_workload begin
33+
HTTP.get(url);
34+
end
35+
end
36+
37+
HTTP.forceclose(server)
38+
yield() # needed on 1.9 to avoid some issue where it seems a task doesn't stop before serialization
39+
server = nothing
40+
end

0 commit comments

Comments
 (0)