Skip to content

Commit

Permalink
Merge branch 'JuliaWeb:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona authored Nov 26, 2024
2 parents d60bb5e + 4a0bf01 commit 0b15da4
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 22 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,48 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- 'min'
- 'lts'
- '1.9' # test because we know there was a precompilation issue on 1.9 issues/1202
- '1' # automatically expands to the latest stable 1.x release of Julia
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- default
include:
- os: windows-latest
version: '1'
arch: x86
exclude:
- os: windows-latest
version: '1.6'
- os: macOS-latest
version: 'min' # no apple silicon support for Julia 1.6
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v3
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
env:
PIE_SOCKET_API_KEY: ${{ secrets.PIE_SOCKET_API_KEY }}
JULIA_VERSION: ${{ matrix.version }}
JULIA_NUM_THREADS: 2
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v5
with:
file: lcov.info
files: lcov.info
token: ${{ secrets.GITHUB_TOKEN }}
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- run: |
Expand Down
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "HTTP"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
authors = ["Jacob Quinn", "contributors: https://github.com/JuliaWeb/HTTP.jl/graphs/contributors"]
version = "1.10.10"
version = "1.10.12"

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

[targets]
test = ["BufferedStreams", "Deno_jll", "Distributed", "InteractiveUtils", "JSON", "Test", "Unitful", "NetworkOptions"]
5 changes: 5 additions & 0 deletions src/HTTP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -631,4 +631,9 @@ function Base.parse(::Type{T}, str::AbstractString)::T where T <: Message
return m
end

# only run if precompiling
if VERSION >= v"1.9.0-0" && ccall(:jl_generating_output, Cint, ()) == 1
include("precompile.jl")
end

end # module
40 changes: 40 additions & 0 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using PrecompileTools: @setup_workload, @compile_workload

@setup_workload begin
# These need to be safe to call here and bake into the pkgimage, i.e. called twice.
Connections.__init__()
MultiPartParsing.__init__()
Parsers.__init__()

# Doesn't seem to be needed here, and might not be safe to call twice (here and during runtime)
# ConnectionRequest.__init__()

gzip_data(data::String) = read(GzipCompressorStream(IOBuffer(data)))

# random port in the dynamic/private range (49152–65535) which are are
# least likely to be used by well-known services
_port = 57813

cert, key = joinpath.(@__DIR__, "../test", "resources", ("cert.pem", "key.pem"))
sslconfig = MbedTLS.SSLConfig(cert, key)

server = HTTP.serve!("0.0.0.0", _port; verbose = -1, listenany=true, sslconfig=sslconfig) do req
HTTP.Response(200, ["Content-Encoding" => "gzip"], gzip_data("dummy response"))
end
# listenany allows changing port if that one is already in use, so check the actual port
_port = HTTP.port(server)
url = "https://localhost:$_port"

env = ["JULIA_NO_VERIFY_HOSTS" => "localhost",
"JULIA_SSL_NO_VERIFY_HOSTS" => nothing,
"JULIA_ALWAYS_VERIFY_HOSTS" => nothing]
withenv(env...) do
@compile_workload begin
HTTP.get(url);
end
end

HTTP.forceclose(server)
yield() # needed on 1.9 to avoid some issue where it seems a task doesn't stop before serialization
server = nothing
end

0 comments on commit 0b15da4

Please sign in to comment.