Skip to content

Commit e787b2d

Browse files
committed
Merge branch 'master' into check-fragmentation-immixspace
2 parents d56c3b9 + 0b3ec9b commit e787b2d

File tree

224 files changed

+11621
-3434
lines changed

Some content is hidden

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

224 files changed

+11621
-3434
lines changed

.github/scripts/ci-common.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
arch=`rustc --print cfg | grep target_arch | cut -f2 -d"\""`
2-
os=`rustc --print cfg | grep target_os | cut -f2 -d"\""`
1+
# Note: cargo-rustc is influenced by the environment variable CARGO_BUILD_TARGET
2+
# which is specified in minimal-tests-core.yml
3+
arch=`cargo rustc -- --print cfg | grep target_arch | cut -f2 -d"\""`
4+
os=`cargo rustc -- --print cfg | grep target_os | cut -f2 -d"\""`
35

46
project_root=$(dirname "$0")/../..
57

68
cargo_toml=$project_root/Cargo.toml
79

10+
dummyvm_toml=$project_root/docs/dummyvm/Cargo.toml
11+
12+
# Pin certain deps for our MSRV
13+
cargo update -p [email protected] --precise 0.5.5 # This can be removed once we move to Rust 1.81 or newer
14+
815
# Repeat a command for all the features. Requires the command as one argument (with double quotes)
916
for_all_features() {
1017
# without mutually exclusive features

.github/scripts/ci-doc.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ if ! cat $project_root/src/plan/mod.rs | grep -q "pub mod mygc;"; then
2222
fi
2323
cargo build
2424

25-
# Install mdbook using the stable toolchain
26-
cargo +stable install mdbook
25+
# Check dummyvm in portingguide
26+
cargo build --manifest-path $dummyvm_toml
27+
28+
# Install mdbook using the stable toolchain and the default target
29+
unset CARGO_BUILD_TARGET
30+
cargo +stable install mdbook mdbook-admonish mdbook-hide
2731
mdbook build $project_root/docs/userguide

.github/scripts/ci-style.sh

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,63 @@
22

33
export RUSTFLAGS="-D warnings -A unknown-lints"
44

5+
# --- Check format ---
6+
cargo fmt -- --check
7+
cargo fmt --manifest-path=macros/Cargo.toml -- --check
8+
59
# Workaround the clippy issue on Rust 1.72: https://github.com/mmtk/mmtk-core/issues/929.
610
# If we are not testing with Rust 1.72, or there is no problem running the following clippy checks, we can remove this export.
711
CLIPPY_VERSION=$(cargo clippy --version)
812
if [[ $CLIPPY_VERSION == "clippy 0.1.72"* ]]; then
913
export CARGO_INCREMENTAL=0
1014
fi
1115

16+
if [[ $CLIPPY_VERSION == "clippy 0.1.77"* && $CARGO_BUILD_TARGET == "x86_64-apple-darwin" ]]; then
17+
export SKIP_CLIPPY=1
18+
fi
19+
1220
# --- Check main crate ---
1321

14-
# check base
15-
cargo clippy
16-
# check all features
17-
for_all_features "cargo clippy"
18-
# check release
19-
for_all_features "cargo clippy --release"
20-
# check for tests
21-
for_all_features "cargo clippy --tests"
22-
23-
# target-specific features
24-
if [[ $arch == "x86_64" && $os == "linux" ]]; then
25-
cargo clippy --features perf_counter
26-
cargo clippy --release --features perf_counter
27-
cargo clippy --tests --features perf_counter
28-
fi
22+
if [[ $SKIP_CLIPPY == 1 ]]; then
23+
echo "Skipping clippy version $CLIPPY_VERSION on $CARGO_BUILD_TARGET"
24+
else
25+
# check base
26+
cargo clippy
27+
# check all features
28+
for_all_features "cargo clippy"
29+
# check release
30+
for_all_features "cargo clippy --release"
31+
# check for tests
32+
for_all_features "cargo clippy --tests"
2933

30-
# mock tests
31-
cargo clippy --features mock_test
32-
cargo clippy --features mock_test --tests
33-
cargo clippy --features mock_test --benches
34+
# target-specific features
35+
if [[ $arch == "x86_64" && $os == "linux" ]]; then
36+
cargo clippy --features perf_counter
37+
cargo clippy --release --features perf_counter
38+
cargo clippy --tests --features perf_counter
39+
fi
40+
41+
# mock tests
42+
cargo clippy --features mock_test
43+
cargo clippy --features mock_test --tests
44+
cargo clippy --features mock_test --benches
45+
46+
# non-mock benchmarks
47+
cargo clippy --features test_private --benches
48+
fi
3449

3550
# --- Check auxiliary crate ---
3651

3752
style_check_auxiliary_crate() {
3853
crate_path=$1
3954

40-
cargo clippy --manifest-path=$crate_path/Cargo.toml
41-
cargo fmt --manifest-path=$crate_path/Cargo.toml -- --check
55+
if [[ $SKIP_CLIPPY == 1 ]]; then
56+
echo "Skipping clippy test for $crate_path"
57+
else
58+
cargo clippy --manifest-path=$crate_path/Cargo.toml
59+
cargo fmt --manifest-path=$crate_path/Cargo.toml -- --check
60+
fi
4261
}
4362

4463
style_check_auxiliary_crate macros
64+
style_check_auxiliary_crate docs/dummyvm

.github/scripts/ci-test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ find ./src ./tests -type f -name "mock_test_*" | while read -r file; do
3737
env MMTK_PLAN=$MMTK_PLAN cargo test --features mock_test,"$FEATURES" -- $t;
3838
done
3939
done
40+
41+
# Test the dummy VM
42+
cargo test --manifest-path $dummyvm_toml

.github/workflows/api-check.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,43 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout mmtk-core
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323
with:
2424
# Full git history needed
2525
fetch-depth: 0
2626

27-
# cargo-public-api can be built with the latest stable toolchain.
28-
- name: Install stable Rust toolchain
29-
uses: actions-rs/toolchain@v1
30-
with:
31-
toolchain: stable
32-
profile: minimal
33-
# make it the active toolchain
34-
override: true
35-
3627
# cargo-public-api needs a nightly toolchain installed in order to work.
3728
# It does not have to be the active toolchain.
3829
- name: Install nightly Rust toolchain
39-
uses: actions-rs/toolchain@v1
40-
with:
41-
toolchain: nightly
42-
profile: minimal
30+
run: rustup toolchain install nightly
4331

32+
# Show the Rust toolchain we are actually using
33+
- run: rustup show
4434
- run: cargo --version
4535
- run: cargo +nightly --version
4636

4737
- name: Install cargo-public-api
48-
run: cargo install cargo-public-api
38+
run: cargo +nightly install cargo-public-api
4939
- name: API Diff
50-
run: cargo public-api diff origin/${GITHUB_BASE_REF}..${{ github.event.pull_request.head.sha }} --deny=all
40+
run: cargo +nightly public-api diff origin/${GITHUB_BASE_REF}..${{ github.event.pull_request.head.sha }} --deny=all
41+
42+
check-api-migration-update:
43+
needs: check-public-api-changes
44+
runs-on: ubuntu-latest
45+
if: ${{ always() && needs.check-public-api-changes.result == 'failure'}}
46+
env:
47+
MIGRATION_GUIDE_PATH: 'docs/userguide/src/migration/**'
48+
steps:
49+
# Check if migration guide is updated.
50+
- name: Get the update status for the migration guide.
51+
uses: tj-actions/changed-files@v44
52+
id: migration-guide-status
53+
with:
54+
files: ${{ env.MIGRATION_GUIDE_PATH }}
55+
# If the api check failed but the migration is not updated, we fail here
56+
- name: Report if the migration guide is not updated.
57+
if: ${{ steps.migration-guide-status.outputs.any_changed == 'false' }}
58+
uses: actions/github-script@v7
59+
with:
60+
script: |
61+
core.setFailed('Public API is changed, but the migration guide (${{ env.MIGRATION_GUIDE_PATH }}) is not updated. If the bindings need to be updated for the API change, the migration guide needs to be updated as well.')

.github/workflows/auto-merge-inner.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
ref:
1616
required: true
1717
type: string
18+
# The upstream branch where the binding PR is targeting, such as master, dev
19+
base_ref:
20+
required: true
21+
type: string
1822
# The core commit hash that the binding should be using.
1923
core_commit:
2024
required: true
@@ -35,7 +39,7 @@ jobs:
3539
- name: Check input conditions
3640
id: check-input
3741
run: |
38-
if [[ "${{ inputs.repo }}" == ${{ inputs.base_repo }} ]] && [[ "${{ inputs.ref }}" == "master" ]]; then
42+
if [[ "${{ inputs.repo }}" == ${{ inputs.base_repo }} ]] && [[ "${{ inputs.ref }}" == "${{ inputs.base_ref }}" ]]; then
3943
echo "Conditions not met"
4044
echo "skip=true" >> $GITHUB_OUTPUT
4145
else
@@ -44,13 +48,13 @@ jobs:
4448
shell: bash
4549

4650
- name: Checkout MMTk Core
47-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
4852
if: steps.check-input.outputs.skip == 'false'
4953
with:
5054
path: ${{ env.MMTK_CORE_WORK_DIR }}
5155
- name: Checkout repository
5256
if: steps.check-input.outputs.skip == 'false'
53-
uses: actions/checkout@v3
57+
uses: actions/checkout@v4
5458
with:
5559
repository: ${{ inputs.repo }}
5660
path: ${{ env.BINDING_WORK_DIR }}

.github/workflows/auto-merge.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
needs: [get-merged-pr, binding-refs]
3737
with:
3838
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
39-
base_repo: mmtk/mmtk-openjdk
39+
base_repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo_default }}
4040
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
41+
base_ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref_default }}
4142
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
4243
update_lockfile: cargo build
4344
secrets: inherit
@@ -47,8 +48,9 @@ jobs:
4748
needs: [get-merged-pr, binding-refs]
4849
with:
4950
repo: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo }}
50-
base_repo: mmtk/mmtk-jikesrvm
51+
base_repo: ${{ needs.binding-refs.outputs.jikesrvm_binding_repo_default }}
5152
ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref }}
53+
base_ref: ${{ needs.binding-refs.outputs.jikesrvm_binding_ref_default }}
5254
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
5355
# `cargo generate-lockfile` will update other dependencies. We avoid using it for the bindings.
5456
# But we do not have a good option for JikesRVM. The Rust project in JikesRVM needs some source files
@@ -62,8 +64,9 @@ jobs:
6264
needs: [get-merged-pr, binding-refs]
6365
with:
6466
repo: ${{ needs.binding-refs.outputs.v8_binding_repo }}
65-
base_repo: mmtk/mmtk-v8
67+
base_repo: ${{ needs.binding-refs.outputs.v8_binding_repo_default }}
6668
ref: ${{ needs.binding-refs.outputs.v8_binding_ref }}
69+
base_ref: ${{ needs.binding-refs.outputs.v8_binding_ref_default }}
6770
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
6871
update_lockfile: cargo build --features nogc
6972
secrets: inherit
@@ -73,19 +76,24 @@ jobs:
7376
needs: [get-merged-pr, binding-refs]
7477
with:
7578
repo: ${{ needs.binding-refs.outputs.julia_binding_repo }}
76-
base_repo: mmtk/mmtk-julia
79+
base_repo: ${{ needs.binding-refs.outputs.julia_binding_repo_default }}
7780
ref: ${{ needs.binding-refs.outputs.julia_binding_ref }}
81+
base_ref: ${{ needs.binding-refs.outputs.julia_binding_ref_default }}
7882
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
79-
update_lockfile: cargo build --features immix
83+
# `cargo generate-lockfile` will update other dependencies. We avoid using it for the bindings.
84+
# mmtk-julia uses bindgen during building and requires the Julia repo. This is a similar situation
85+
# as mmtk-jikesrvm. To make thigns simpler, we just use `cargo generate-lockfile`.
86+
update_lockfile: cargo generate-lockfile
8087
secrets: inherit
8188

8289
check-merge-ruby-pr:
8390
uses: ./.github/workflows/auto-merge-inner.yml
8491
needs: [get-merged-pr, binding-refs]
8592
with:
8693
repo: ${{ needs.binding-refs.outputs.ruby_binding_repo }}
87-
base_repo: mmtk/mmtk-ruby
94+
base_repo: ${{ needs.binding-refs.outputs.ruby_binding_repo_default }}
8895
ref: ${{ needs.binding-refs.outputs.ruby_binding_ref }}
96+
base_ref: ${{ needs.binding-refs.outputs.ruby_binding_ref_default }}
8997
core_commit: ${{ needs.get-merged-pr.outputs.commit }}
9098
update_lockfile: cargo build
9199
secrets: inherit

.github/workflows/binding-tests-openjdk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Checkout MMTk Core
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2222
with:
2323
path: mmtk-core
2424
- name: Checkout OpenJDK Binding
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v4
2626
with:
2727
repository: ${{ inputs.repo }}
2828
path: mmtk-openjdk

.github/workflows/cargo-msrv.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,19 @@ jobs:
1717
msrv:
1818
runs-on: ubuntu-22.04
1919
steps:
20-
- uses: actions/checkout@v2
21-
- name: Install Rust toolchain
22-
uses: actions-rs/toolchain@v1
23-
with:
24-
toolchain: stable
25-
override: true
20+
- uses: actions/checkout@v4
21+
22+
# Show the Rust toolchain we are actually using
23+
- run: rustup show
24+
- run: cargo --version
25+
2626
- name: Install cargo-msrv
27-
run: cargo install cargo-msrv
27+
# The cargo-msrv tool sometimes requires a higher Rust version than our current rust-toolchain.
28+
run: cargo +stable install cargo-msrv
2829
# Verify the MSRV defined in Cargo.toml
2930
- name: Verify MSRV
3031
run: cargo msrv verify
3132
# If the previous step fails, find MSRV
3233
- name: Find MSRV
3334
if: failure()
34-
run: cargo msrv
35+
run: cargo msrv find

.github/workflows/cargo-publish.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ jobs:
1414
cargo-publish:
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/checkout@v2
18-
- name: Install latest nightly
19-
uses: actions-rs/toolchain@v1
20-
with:
21-
components: rustfmt, clippy
22-
target: i686-unknown-linux-gnu
23-
# This overwrites the default toolchain with the toolchain specified above.
24-
override: true
17+
- uses: actions/checkout@v4
18+
19+
# Show the Rust toolchain we are actually using
20+
- run: rustup show
21+
- run: cargo --version
22+
2523
- name: Cargo login
2624
run: cargo login ${{ secrets.CI_CARGO_LOGIN }}
2725
- name: Publish sub crates

0 commit comments

Comments
 (0)