Skip to content

Commit 1641a1d

Browse files
authored
Merge pull request #42217 from JuliaLang/backports-release-1.7
release-1.7: Backports for RC-1.7
2 parents b4eeb2d + 58cbcf3 commit 1641a1d

File tree

31 files changed

+561
-331
lines changed

31 files changed

+561
-331
lines changed

.buildkite/pipelines/scheduled/0_webui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ steps:
2121
# verifies the treehash of the pipeline itself and the inputs listed in `inputs`
2222
signed_pipelines:
2323
- pipeline: .buildkite/pipelines/scheduled/coverage/coverage_linux64.yml
24-
signature: "U2FsdGVkX1+lpFo/nKzx3c6xCZPKYTAuunXpOsZG4+s4+iU5LfEpMvtNvpKQjDugRoxQxCItMqB6vr4KZN3KtKhjkLbr8ExAyaPil/N/uFhrLlpwNem9dxHbPrU2l7qo"
24+
signature: U2FsdGVkX1+FtqbbxyzoI/j0InDefRQ3OR06BAM2EWRhDG3SiwiPcOREudCTJ+1Z+AEVwVz5KTgw9lBVO1yjcWts3XePIy/W+arN4V+t97Dfuf4wsAr9ubpQ10GaoFnK

.buildkite/pipelines/scheduled/coverage/coverage_linux64.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ steps:
2929
git config --global init.defaultBranch master
3030
3131
echo "--- Run Julia tests in parallel with code coverage enabled"
32-
./julia --code-coverage=all --sysimage-native-code=no .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl
32+
export JULIA_NUM_THREADS=1
33+
export JULIA_WORKER_TIMEOUT=1200 # 1200 seconds = 20 minutes
34+
./julia -e 'import Distributed; @info "" Distributed.worker_timeout()'
35+
./julia .buildkite/pipelines/scheduled/coverage/run_tests_parallel.jl
3336
3437
echo "--- Process and upload coverage information"
3538
./julia .buildkite/pipelines/scheduled/coverage/upload_coverage.jl
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
# Important note: even if one or more tests fail, we will still exit with status code 0.
2-
2+
#
33
# The reason for this is that we always want to upload code coverage, even if some of the
44
# tests fail. Therefore, even if the `coverage_linux64` builder passes, you should not
55
# assume that all of the tests passed. If you want to know if all of the tests are passing,
66
# please look at the status of the `tester_*` builders (e.g. `tester_linux64`).
77

8-
# When running this file, make sure to set all of the following command-line flags:
9-
# 1. `--code-coverage=all`
10-
# 2. `--sysimage-native-code=no`
8+
const ncores = Sys.CPU_THREADS
9+
@info "" Sys.CPU_THREADS
10+
@info "" ncores
1111

12-
empty!(Base.DEPOT_PATH)
13-
push!(Base.DEPOT_PATH, mktempdir(; cleanup = true))
12+
script_native_yes = """
13+
Base.runtests(["cmdlineargs"]; ncores = $(ncores))
14+
"""
15+
script_native_no = """
16+
Base.runtests(["all", "--skip", "cmdlineargs"]; ncores = $(ncores))
17+
"""
1418

15-
const tests = "all"
16-
const ncores = Sys.CPU_THREADS
19+
base_cmd = `$(Base.julia_cmd()) --code-coverage=all`
20+
cmd_native_yes = `$(base_cmd) --sysimage-native-code=yes -e $(script_native_yes)`
21+
cmd_native_no = `$(base_cmd) --sysimage-native-code=no -e $(script_native_no)`
1722

18-
@info "" Sys.CPU_THREADS
19-
@info "" tests ncores
23+
@info "Running command" cmd_native_yes
24+
p1 = run(pipeline(cmd_native_yes; stdin, stdout, stderr); wait = false)
25+
wait(p1)
2026

21-
try
22-
Base.runtests(tests; ncores)
23-
catch ex
24-
@error "" exception=(ex, catch_backtrace())
25-
end
27+
@info "Running command" cmd_native_no
28+
p2 = run(pipeline(cmd_native_no; stdin, stdout, stderr); wait = false)
29+
wait(p2)

.buildkite/pipelines/scheduled/coverage/upload_coverage.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function print_coverage_summary(
9191
cov_pct = floor(Int, cov_lines/tot_lines * 100)
9292
end
9393
@info "$(description): $(cov_pct)% ($(cov_lines)/$(tot_lines))"
94-
return nothing
94+
return (; cov_pct)
9595
end
9696

9797
function buildkite_env(name::String)
@@ -198,7 +198,7 @@ end;
198198
sort!(fcs; by = fc -> fc.filename);
199199

200200
print_coverage_summary.(fcs);
201-
print_coverage_summary(fcs, "Total")
201+
const total_cov_pct = print_coverage_summary(fcs, "Total").cov_pct
202202

203203
let
204204
git_info = coveralls_buildkite_query_git_info()
@@ -217,3 +217,12 @@ let
217217
# In order to upload to Codecov, you need to have the `CODECOV_TOKEN` environment variable defined.
218218
Coverage.Codecov.submit_generic(fcs, kwargs)
219219
end
220+
221+
if total_cov_pct < 50
222+
msg = string(
223+
"The total coverage is less than 50%. This should never happen, ",
224+
"so it means that something has probably gone wrong with the code coverage job.",
225+
)
226+
@error msg total_cov_pct
227+
throw(ErrorException(msg))
228+
end

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ CODEOWNERS @JuliaLang/github-actions
22
/.github/ @JuliaLang/github-actions
33
/.buildkite/ @JuliaLang/github-actions
44

5+
/.github/workflows/retry.yml @DilumAluthge
56
/.github/workflows/statuses.yml @DilumAluthge

.github/workflows/retry.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Please ping @DilumAluthge when making any changes to this file.
2+
3+
# Here are some steps that we take in this workflow file for security reasons:
4+
# 1. We do not checkout any code.
5+
# 2. We only run actions that are defined in a repository in the `JuliaLang` GitHub organization.
6+
# 3. We do not give the `GITHUB_TOKEN` any permissions.
7+
# 4. We only give the Buildkite API token (`BUILDKITE_API_TOKEN_RETRY`) the minimum necessary
8+
# set of permissions.
9+
10+
# Important note to Buildkite maintainers:
11+
# In order to make this work, you need to tell Buildkite that it should NOT create a brand-new
12+
# build when someone closes and reopens a pull request. To do so:
13+
# 1. Go to the relevant pipeline (e.g. https://buildkite.com/julialang/julia-master).
14+
# 2. Click on the "Pipeline Settings" button.
15+
# 3. In the left sidebar, under "Pipeline Settings", click on "GitHub".
16+
# 4. In the "GitHub Settings", under "Build Pull Requests", make sure that the "Skip pull
17+
# request builds for existing commits" checkbox is checked. This is the setting that tells
18+
# Buildkite that it should NOT create a brand-new build when someone closes and reopens a
19+
# pull request.
20+
# 5. At the bottom of the page, click the "Save GitHub Settings" button.
21+
22+
name: Retry Failed Buildkite Jobs
23+
24+
on:
25+
# When using the `pull_request_target` event, all PRs will get access to secret environment
26+
# variables (such as the `BUILDKITE_API_TOKEN_RETRY` secret environment variable), even if
27+
# the PR is from a fork. Therefore, for security reasons, we do not checkout any code in
28+
# this workflow.
29+
pull_request_target:
30+
31+
# TODO: delete the following line (once we have completely transitioned from Buildbot to Buildkite)
32+
types: [ reopened, labeled ]
33+
34+
# TODO: uncomment the following line (once we have completely transitioned from Buildbot to Buildkite)
35+
# types: [ reopened ]
36+
37+
# We do not give the `GITHUB_TOKEN` any permissions.
38+
permissions:
39+
statuses: none
40+
41+
jobs:
42+
retry:
43+
name: retry
44+
runs-on: ubuntu-latest
45+
46+
# TODO: delete the following line (once we have completely transitioned from Buildbot to Buildkite)
47+
if: github.repository == 'JuliaLang/julia' && (github.event.label.name == 'Buildkite - retry failed jobs' || github.event.action == 'reopened')
48+
49+
# TODO: uncomment the following line (once we have completely transitioned from Buildbot to Buildkite)
50+
# if: github.repository == 'JuliaLang/julia'
51+
52+
steps:
53+
# For security reasons, we do not checkout any code in this workflow.
54+
- uses: JuliaLang/retry-buildkite@24e8341f74e0d6760717235eac936db639d7e9eb
55+
with:
56+
buildkite_api_token: ${{ secrets.BUILDKITE_API_TOKEN_RETRY }}
57+
buildkite_organization_slug: 'julialang'
58+
buildkite_pipeline_slug: 'julia-master'
59+
pr_number: ${{github.event.number}}

.github/workflows/statuses.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
# This is just a short-term solution until we have migrated all of CI to Buildkite.
44
#
55
# 1. TODO: delete this file once we have migrated all of CI to Buildkite.
6-
#
7-
# 2. TODO: disable GitHub Actions on the `JuliaLang/julia` repository once we have migrated all
8-
# of CI to Buildkite.
96

107
# Here are some steps that we take in this workflow file for security reasons:
118
# 1. We do not checkout any code.
129
# 2. We do not run any external actions.
13-
# 3. We only give `GITHUB_TOKEN` the minimum necessary set of permissions.
10+
# 3. We only give the `GITHUB_TOKEN` the minimum necessary set of permissions.
1411

1512
name: Statuses
1613

@@ -27,7 +24,7 @@ on:
2724
- 'master'
2825
- 'release-*'
2926

30-
# These are the permissions for the `GITHUB_TOKEN` token.
27+
# These are the permissions for the `GITHUB_TOKEN`.
3128
# We should only give the token the minimum necessary set of permissions.
3229
permissions:
3330
statuses: write
@@ -37,15 +34,12 @@ jobs:
3734
name: statuses
3835
runs-on: ubuntu-latest
3936
if: github.repository == 'JuliaLang/julia'
40-
strategy:
41-
fail-fast: false
4237
steps:
38+
# For security reasons, we do not checkout any code in this workflow.
4339
- run: echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
4440
if: github.event_name == 'pull_request_target'
45-
4641
- run: echo "SHA=${{ github.sha }}" >> $GITHUB_ENV
4742
if: github.event_name != 'pull_request_target'
48-
4943
- run: echo "The SHA is ${{ env.SHA }}"
5044

5145
# As we incrementally migrate individual jobs from Buildbot to Buildkite, we should

NEWS.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Language changes
3838
* The default random number generator has changed, so all random numbers will be different (even with the
3939
same seed) unless an explicit RNG object is used.
4040
See the section on the `Random` standard library below ([#40546]).
41-
* `Iterators.peel(itr)` now returns `nothing` when `itr` is empty instead of throwing a `BoundsError` ([#39569]).
41+
* `Iterators.peel(itr)` now returns `nothing` when `itr` is empty instead of throwing a `BoundsError` ([#39607]).
4242
* Multiple successive semicolons in an array expresion were previously ignored (e.g., `[1 ;; 2] == [1 ; 2]`).
4343
This syntax is now used to separate dimensions (see **New language features**).
4444

@@ -76,7 +76,7 @@ New library functions
7676
---------------------
7777

7878
* Two argument methods `findmax(f, domain)`, `argmax(f, domain)` and the corresponding
79-
`min` versions ([#27613]).
79+
`min` versions ([#35316]).
8080
* `isunordered(x)` returns true if `x` is a value that is normally unordered, such as
8181
`NaN` or `missing` ([#35316]).
8282
* New `keepat!(vector, inds)` function which is the inplace equivalent of `vector[inds]`
@@ -302,7 +302,6 @@ Tooling Improvements
302302

303303

304304
<!--- generated by NEWS-update.jl: -->
305-
[#27613]: https://github.com/JuliaLang/julia/issues/27613
306305
[#29901]: https://github.com/JuliaLang/julia/issues/29901
307306
[#30676]: https://github.com/JuliaLang/julia/issues/30676
308307
[#31829]: https://github.com/JuliaLang/julia/issues/31829
@@ -340,9 +339,9 @@ Tooling Improvements
340339
[#39436]: https://github.com/JuliaLang/julia/issues/39436
341340
[#39455]: https://github.com/JuliaLang/julia/issues/39455
342341
[#39463]: https://github.com/JuliaLang/julia/issues/39463
343-
[#39569]: https://github.com/JuliaLang/julia/issues/39569
344342
[#39588]: https://github.com/JuliaLang/julia/issues/39588
345343
[#39594]: https://github.com/JuliaLang/julia/issues/39594
344+
[#39607]: https://github.com/JuliaLang/julia/issues/39607
346345
[#39710]: https://github.com/JuliaLang/julia/issues/39710
347346
[#39758]: https://github.com/JuliaLang/julia/issues/39758
348347
[#39794]: https://github.com/JuliaLang/julia/issues/39794

base/multidimensional.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,14 @@ module IteratorsMD
353353
# AbstractArray implementation
354354
Base.axes(iter::CartesianIndices{N,R}) where {N,R} = map(Base.axes1, iter.indices)
355355
Base.IndexStyle(::Type{CartesianIndices{N,R}}) where {N,R} = IndexCartesian()
356-
@propagate_inbounds function Base.getindex(iter::CartesianIndices{N,R}, I::Vararg{Int, N}) where {N,R}
357-
CartesianIndex(getindex.(iter.indices, I))
356+
@inline function Base.getindex(iter::CartesianIndices{N,R}, I::Vararg{Int, N}) where {N,R}
357+
# Eagerly do boundscheck before calculating each item of the CartesianIndex so that
358+
# we can pass `@inbounds` hint to inside the map and generates more efficient SIMD codes (#42115)
359+
@boundscheck checkbounds(iter, I...)
360+
index = map(iter.indices, I) do r, i
361+
@inbounds getindex(r, i)
362+
end
363+
CartesianIndex(index)
358364
end
359365

360366
ndims(R::CartesianIndices) = ndims(typeof(R))

base/util.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ function julia_cmd(julia=joinpath(Sys.BINDIR::String, julia_exename()))
208208
if opts.startupfile == 2
209209
push!(addflags, "--startup-file=no")
210210
end
211+
if opts.use_sysimage_native_code == 0
212+
push!(addflags, "--sysimage-native-code=no")
213+
end
211214
return `$julia -C$cpu_target -J$image_file $addflags`
212215
end
213216

0 commit comments

Comments
 (0)