Skip to content

Commit 134c343

Browse files
authored
Merge pull request #40702 from JuliaLang/backports-release-1.6
Backports for Julia-1.6.2
2 parents dd12291 + 85b9752 commit 134c343

File tree

94 files changed

+1078
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1078
-318
lines changed

.buildkite/0_webui.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file represents what is put into the webUI.
2+
# It is purely for keeping track of the changes we make to the webUI configuration; modifying this file has no effect.
3+
# We use the `cryptic` buildkite plugin to provide secrets management, which requires some integration into the WebUI's steps.
4+
agents:
5+
queue: "julia"
6+
sandbox.jl: "true"
7+
8+
steps:
9+
- label: ":unlock: Unlock secrets, launch pipelines"
10+
plugins:
11+
- staticfloat/cryptic:
12+
# Our list of pipelines that should be launched (but don't require a signature)
13+
# These pipelines can be modified by any contributor and CI will still run.
14+
# Build secrets will not be available in these pipelines (or their children)
15+
# but some of our signed pipelines can wait upon the completion of these unsigned
16+
# pipelines.
17+
unsigned_pipelines:
18+
- .buildkite/pipeline.yml
19+
20+
# Our signed pipelines must have a `signature` or `signature_file` parameter that
21+
# verifies the treehash of the pipeline itself and the inputs listed in `inputs`
22+
signed_pipelines:
23+
- pipeline: .buildkite/signed_pipeline_test.yml
24+
signature: "U2FsdGVkX18aZgryp6AJTArgD2uOnVWyFFGVOP5qsY4WbGQ/LVAcYiMEp9cweV+2iht+vmEF949CuuGTeQPA1fKlhPwkG3nZ688752DUB6en9oM2nuL31NoDKWHhpygZ"
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Cryptic repository keys
2+
3+
This folder contains RSA-encrypted symmetric AES keys.
4+
These are used by buildkite agents to decrypt the secrets embedded within this repository.
5+
Each buildkite agent contains an RSA secret key that is used to unlock the symmetric AES key that was used to encrypt the secrets within this repository.
6+
For more information, see the [`cryptic` buildkite plugin repository](https://github.com/staticfloat/cryptic-buildkite-plugin).
256 Bytes
Binary file not shown.

.buildkite/llvm_passes.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# These steps should only run on `sandbox.jl` machines, not `docker`-isolated ones
2+
# since we need nestable sandboxing. The rootfs images being used here are built from
3+
# the `.buildkite/rootfs_images/llvm-passes.jl` file.
4+
agents:
5+
queue: "julia"
6+
# Only run on `sandbox.jl` machines (not `docker`-isolated ones) since we need nestable sandboxing
7+
sandbox.jl: "true"
8+
os: "linux"
9+
10+
steps:
11+
- label: "analyzegc"
12+
plugins:
13+
- JuliaCI/julia#v1:
14+
version: 1.6
15+
- staticfloat/sandbox#v1:
16+
rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v1/llvm-passes.tar.gz
17+
rootfs_treehash: "f3ed53f159e8f13edfba8b20ebdb8ece73c1b8a8"
18+
commands: |
19+
echo "--- Install in-tree LLVM dependencies"
20+
make -j 6 -C deps install-llvm install-clang install-llvm-tools install-libuv install-utf8proc install-unwind
21+
echo "+++ run clangsa/analyzegc"
22+
make -j 6 -C test/clangsa
23+
make -j 6 -C src analyzegc
24+
timeout_in_minutes: 60
25+
26+
- label: "llvmpasses"
27+
plugins:
28+
- JuliaCI/julia#v1:
29+
version: 1.6
30+
- staticfloat/sandbox#v1:
31+
rootfs_url: https://github.com/JuliaCI/rootfs-images/releases/download/v1/llvm-passes.tar.gz
32+
rootfs_treehash: "f3ed53f159e8f13edfba8b20ebdb8ece73c1b8a8"
33+
uid: 1000
34+
gid: 1000
35+
commands: |
36+
echo "+++ run llvmpasses"
37+
make -j 6 release
38+
make -j 6 -C src install-analysis-deps
39+
make -j 6 -C test/llvmpasses
40+
timeout_in_minutes: 60

.buildkite/pipeline.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file launches all the build jobs that _don't_ require secrets access.
2+
# These jobs can pass their output off to jobs that do require secrets access,
3+
# but those privileged steps require signing before they can be run.
4+
#
5+
# Yes, this is creating another layer of indirection; the flow now looks like:
6+
#
7+
# [webui] -> pipeline.yml -> llvm_passes.yml
8+
#
9+
# when we could theoretically just have the `webui` launch `llvm_passes.yml`,
10+
# however this raises the bar for contributors to add new (unsigned) steps to
11+
# our CI configuration, so I'd rather live with an extra layer of indirection
12+
# and only need to touch the webui configuration when we need to alter
13+
# something about the privileged steps.
14+
steps:
15+
- label: ":buildkite: Launch unsigned pipelines"
16+
commands: |
17+
buildkite-agent pipeline upload .buildkite/llvm_passes.yml
18+
agents:
19+
queue: julia
+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[ArgTools]]
4+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
5+
6+
[[Artifacts]]
7+
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
8+
9+
[[Base64]]
10+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
11+
12+
[[Dates]]
13+
deps = ["Printf"]
14+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
15+
16+
[[Downloads]]
17+
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
18+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
19+
20+
[[InteractiveUtils]]
21+
deps = ["Markdown"]
22+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
23+
24+
[[JLLWrappers]]
25+
deps = ["Preferences"]
26+
git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e"
27+
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
28+
version = "1.3.0"
29+
30+
[[LibCURL]]
31+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
32+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
33+
34+
[[LibCURL_jll]]
35+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
36+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
37+
38+
[[LibGit2]]
39+
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
40+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
41+
42+
[[LibSSH2_jll]]
43+
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
44+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
45+
46+
[[Libdl]]
47+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
48+
49+
[[Logging]]
50+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
51+
52+
[[Markdown]]
53+
deps = ["Base64"]
54+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
55+
56+
[[MbedTLS_jll]]
57+
deps = ["Artifacts", "Libdl"]
58+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
59+
60+
[[MozillaCACerts_jll]]
61+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
62+
63+
[[NetworkOptions]]
64+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
65+
66+
[[Pkg]]
67+
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
68+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
69+
70+
[[Preferences]]
71+
deps = ["TOML"]
72+
git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a"
73+
uuid = "21216c6a-2e73-6563-6e65-726566657250"
74+
version = "1.2.2"
75+
76+
[[Printf]]
77+
deps = ["Unicode"]
78+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
79+
80+
[[REPL]]
81+
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
82+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
83+
84+
[[Random]]
85+
deps = ["Serialization"]
86+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
87+
88+
[[SHA]]
89+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
90+
91+
[[Scratch]]
92+
deps = ["Dates"]
93+
git-tree-sha1 = "0b4b7f1393cff97c33891da2a0bf69c6ed241fda"
94+
uuid = "6c6a2e73-6563-6170-7368-637461726353"
95+
version = "1.1.0"
96+
97+
[[Serialization]]
98+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
99+
100+
[[Sockets]]
101+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
102+
103+
[[TOML]]
104+
deps = ["Dates"]
105+
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
106+
107+
[[Tar]]
108+
deps = ["ArgTools", "SHA"]
109+
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
110+
111+
[[UUIDs]]
112+
deps = ["Random", "SHA"]
113+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
114+
115+
[[Unicode]]
116+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
117+
118+
[[Zlib_jll]]
119+
deps = ["Libdl"]
120+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
121+
122+
[[ghr_jll]]
123+
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
124+
git-tree-sha1 = "f5c8cb306d4fe2d1fff90443a088fc5ba536c134"
125+
uuid = "07c12ed4-43bc-5495-8a2a-d5838ef8d533"
126+
version = "0.13.0+1"
127+
128+
[[nghttp2_jll]]
129+
deps = ["Artifacts", "Libdl"]
130+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
131+
132+
[[p7zip_jll]]
133+
deps = ["Artifacts", "Libdl"]
134+
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

.buildkite/rootfs_images/Project.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
3+
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
4+
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
5+
ghr_jll = "07c12ed4-43bc-5495-8a2a-d5838ef8d533"

.buildkite/rootfs_images/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Rootfs images
2+
3+
Our CI setup makes use of rootfs images that contain our build tools.
4+
These rootfs images are built using the fairly simple scripts held within this directory.
5+
Most images are based on Debian, making use of `debootstrap` to provide a quick and easy rootfs with packages installed through an initial `apt` invocation.
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env julia
2+
3+
## This rootfs includes enough of a host toolchain to build the LLVM passes.
4+
## Eventually, this image will probably be replaced with the actual builder image,
5+
## as that will have the necessary toolchains as well, but that image is not built yet.
6+
7+
include("rootfs_utils.jl")
8+
9+
# Build debian-based image with the following extra packages:
10+
packages = [
11+
"build-essential",
12+
"libatomic1",
13+
"python",
14+
"python3",
15+
"gfortran",
16+
"perl",
17+
"wget",
18+
"m4",
19+
"cmake",
20+
"pkg-config",
21+
"curl",
22+
"git",
23+
]
24+
tarball_path = debootstrap("llvm-passes"; packages)
25+
26+
# Upload it
27+
upload_rootfs_image(tarball_path)
+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/usr/bin/env julia
2+
3+
# This is an example invocation of `debootstrap` to generate a Debian/Ubuntu-based rootfs
4+
using Scratch, Pkg, Pkg.Artifacts, ghr_jll, SHA, Dates
5+
6+
# Utility functions
7+
getuid() = ccall(:getuid, Cint, ())
8+
getgid() = ccall(:getgid, Cint, ())
9+
10+
function debootstrap(name::String; release::String="buster", variant::String="minbase",
11+
packages::Vector{String}=String[], force::Bool=false)
12+
if Sys.which("debootstrap") === nothing
13+
error("Must install `debootstrap`!")
14+
end
15+
16+
tarball_path = joinpath(@get_scratch!("rootfs-images"), "$(name).tar.gz")
17+
if !force && isfile(tarball_path)
18+
@error("Refusing to overwrite tarball without `force` set", tarball_path)
19+
error()
20+
end
21+
22+
artifact_hash = create_artifact() do rootfs
23+
packages_string = join(push!(packages, "locales"), ",")
24+
@info("Running debootstrap", release, variant, packages)
25+
run(`sudo debootstrap --variant=$(variant) --include=$(packages_string) $(release) "$(rootfs)"`)
26+
27+
# Remove special `dev` files
28+
@info("Cleaning up `/dev`")
29+
for f in readdir(joinpath(rootfs, "dev"); join=true)
30+
# Keep the symlinks around (such as `/dev/fd`), as they're useful
31+
if !islink(f)
32+
run(`sudo rm -rf "$(f)"`)
33+
end
34+
end
35+
36+
# take ownership of the entire rootfs
37+
@info("Chown'ing rootfs")
38+
run(`sudo chown $(getuid()):$(getgid()) -R "$(rootfs)"`)
39+
40+
# Write out rootfs-info to contain a minimally-identifying string
41+
open(joinpath(rootfs, "etc", "rootfs-info"), write=true) do io
42+
write(io, """
43+
rootfs_type=debootstrap
44+
release=$(release)
45+
variant=$(variant)
46+
packages=$(packages_string)
47+
build_date=$(Dates.now())
48+
""")
49+
end
50+
51+
# Write out a reasonable default resolv.conf
52+
open(joinpath(rootfs, "etc", "resolv.conf"), write=true) do io
53+
write(io, """
54+
nameserver 1.1.1.1
55+
nameserver 8.8.8.8
56+
""")
57+
end
58+
59+
# Remove `_apt` user so that `apt` doesn't try to `setgroups()`
60+
@info("Removing `_apt` user")
61+
open(joinpath(rootfs, "etc", "passwd"), write=true, read=true) do io
62+
filtered_lines = filter(l -> !startswith(l, "_apt:"), readlines(io))
63+
truncate(io, 0)
64+
seek(io, 0)
65+
for l in filtered_lines
66+
println(io, l)
67+
end
68+
end
69+
70+
# Set up the one true locale
71+
@info("Setting up UTF-8 locale")
72+
open(joinpath(rootfs, "etc", "locale.gen"), "a") do io
73+
println(io, "en_US.UTF-8 UTF-8")
74+
end
75+
run(`sudo chroot --userspec=$(getuid()):$(getgid()) $(rootfs) locale-gen`)
76+
end
77+
78+
# Archive it into a `.tar.gz` file
79+
@info("Archiving", tarball_path, artifact_hash)
80+
archive_artifact(artifact_hash, tarball_path)
81+
82+
return tarball_path
83+
end
84+
85+
function upload_rootfs_image(tarball_path::String; github_repo::String="JuliaCI/rootfs-images")
86+
# Upload it to `github_repo`
87+
tag_name = "v1"
88+
tarball_url = "https://github.com/$(github_repo)/releases/download/$(tag_name)/$(basename(tarball_path))"
89+
@info("Uploading to $(github_repo)@$(tag_name)", tarball_url)
90+
run(`$(ghr_jll.ghr()) -u $(dirname(github_repo)) -r $(basename(github_repo)) -replace $(tag_name) $(tarball_path)`)
91+
return tarball_url
92+
end

.buildkite/signed_pipeline_test.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
agents:
2+
queue: "julia"
3+
os: "linux"
4+
5+
## pipeline that showcases decryption of environment variable
6+
steps:
7+
- label: ":lock: :rocket: Signed pipeline test"
8+
plugins:
9+
- staticfloat/cryptic#v1:
10+
variables:
11+
- SECRET_KEY="U2FsdGVkX18tb7st0SuQAvh4Yv4xENxOAu8q9XkmOeDVKBNY4FngEwK3xmiKUqaS"
12+
commands: |
13+
echo "SECRET_KEY: $${SECRET_KEY}"
14+
15+
# We must accept the signed job id secret in order to propagate secrets
16+
env:
17+
BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET: ${BUILDKITE_PLUGIN_CRYPTIC_BASE64_SIGNED_JOB_ID_SECRET?}

base/abstractset.jl

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ end
8181
max_values(::Type) = typemax(Int)
8282
max_values(T::Union{map(X -> Type{X}, BitIntegerSmall_types)...}) = 1 << (8*sizeof(T))
8383
# saturated addition to prevent overflow with typemax(Int)
84-
max_values(T::Union) = max(max_values(T.a), max_values(T.b), max_values(T.a) + max_values(T.b))
84+
function max_values(T::Union)
85+
a = max_values(T.a)::Int
86+
b = max_values(T.b)::Int
87+
return max(a, b, a + b)
88+
end
8589
max_values(::Type{Bool}) = 2
8690
max_values(::Type{Nothing}) = 1
8791

0 commit comments

Comments
 (0)