Skip to content

Commit e7143b9

Browse files
authored
Stop using the deprecated set-output in our CI configs (#1059)
This closes #927. This PR also includes a few changes to make style check pass for the stable Rust 1.75.
1 parent 0fb1acf commit e7143b9

File tree

9 files changed

+43
-45
lines changed

9 files changed

+43
-45
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ jobs:
3737
run: |
3838
if [[ "${{ inputs.repo }}" == ${{ inputs.base_repo }} ]] && [[ "${{ inputs.ref }}" == "master" ]]; then
3939
echo "Conditions not met"
40-
echo "::set-output name=skip::true"
40+
echo "skip=true" >> $GITHUB_OUTPUT
4141
else
42-
echo "::set-output name=skip::false"
42+
echo "skip=false" >> $GITHUB_OUTPUT
4343
fi
4444
shell: bash
4545

@@ -63,7 +63,7 @@ jobs:
6363
id: get-pr
6464
run: |
6565
PR_NUMBER=$(gh pr list --head ${{ inputs.ref }} --repo ${{ inputs.base_repo }} --json number --jq '.[0].number')
66-
echo "::set-output name=pr_number::$PR_NUMBER"
66+
echo "pr_number=$PR_NUMBER" >> $GITHUB_OUTPUT
6767
shell: bash
6868
env:
6969
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/perf-compare-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ jobs:
6161
return res.data.head.sha
6262
- id: print
6363
run: |
64-
echo "::set-output name=mmtk_repo::${{ steps.core-repo.outputs.result }}"
65-
echo "::set-output name=mmtk_ref::${{ steps.core-ref.outputs.result }}"
64+
echo "mmtk_repo=${{ steps.core-repo.outputs.result }}" >> $GITHUB_OUTPUT
65+
echo "mmtk_ref=${{ steps.core-ref.outputs.result }}" >> $GITHUB_OUTPUT
6666
6767
# Run perf compare for JikesRVM
6868
jikesrvm-perf-compare:

.github/workflows/perf-regression-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
sed -i 's/^#[[:space:]]mmtk/mmtk/g' mmtk-jikesrvm/mmtk/Cargo.toml
6262
- id: branch
6363
# we cannot use env vars in action input (the deploy step). So put the env var to this step's outputs.
64-
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
64+
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_OUTPUT
6565
# run
6666
- name: Performance Run
6767
run: |
@@ -137,7 +137,7 @@ jobs:
137137
sed -i 's/^#[[:space:]]mmtk/mmtk/g' mmtk-openjdk/mmtk/Cargo.toml
138138
- id: branch
139139
# we cannot use env vars in action input (the deploy step). So put the env var to this step's outputs.
140-
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
140+
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_OUTPUT
141141
# run
142142
- name: Performance Run
143143
run: |
@@ -207,7 +207,7 @@ jobs:
207207
rm -rf mmtk-openjdk/repos/openjdk/build
208208
- id: branch
209209
# we cannot use env vars in action input (the deploy step). So put the env var to this step's outputs.
210-
run: echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')"
210+
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//_/g')" >> $GITHUB_OUTPUT
211211
- name: Setup
212212
run: |
213213
./ci-perf-kit/scripts/history-run-setup.sh

.github/workflows/pr-binding-refs.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ jobs:
8989
default_env: 'OPENJDK_BINDING_REPO=mmtk/mmtk-openjdk,OPENJDK_BINDING_REF=master,JIKESRVM_BINDING_REPO=mmtk/mmtk-jikesrvm,JIKESRVM_BINDING_REF=master,V8_BINDING_REPO=mmtk/mmtk-v8,V8_BINDING_REF=master,JULIA_BINDING_REPO=mmtk/mmtk-julia,JULIA_BINDING_REF=master,RUBY_BINDING_REPO=mmtk/mmtk-ruby,RUBY_BINDING_REF=master'
9090
- id: print
9191
run: |
92-
echo "::set-output name=openjdk_binding_repo::${{ env.OPENJDK_BINDING_REPO }}"
93-
echo "::set-output name=openjdk_binding_ref::${{ env.OPENJDK_BINDING_REF }}"
94-
echo "::set-output name=jikesrvm_binding_repo::${{ env.JIKESRVM_BINDING_REPO }}"
95-
echo "::set-output name=jikesrvm_binding_ref::${{ env.JIKESRVM_BINDING_REF }}"
96-
echo "::set-output name=v8_binding_repo::${{ env.V8_BINDING_REPO }}"
97-
echo "::set-output name=v8_binding_ref::${{ env.V8_BINDING_REF }}"
98-
echo "::set-output name=julia_binding_repo::${{ env.JULIA_BINDING_REPO }}"
99-
echo "::set-output name=julia_binding_ref::${{ env.JULIA_BINDING_REF }}"
100-
echo "::set-output name=ruby_binding_repo::${{ env.RUBY_BINDING_REPO }}"
101-
echo "::set-output name=ruby_binding_ref::${{ env.RUBY_BINDING_REF }}"
92+
echo "openjdk_binding_repo=${{ env.OPENJDK_BINDING_REPO }}" >> $GITHUB_OUTPUT
93+
echo "openjdk_binding_ref=${{ env.OPENJDK_BINDING_REF }}" >> $GITHUB_OUTPUT
94+
echo "jikesrvm_binding_repo=${{ env.JIKESRVM_BINDING_REPO }}" >> $GITHUB_OUTPUT
95+
echo "jikesrvm_binding_ref=${{ env.JIKESRVM_BINDING_REF }}" >> $GITHUB_OUTPUT
96+
echo "v8_binding_repo=${{ env.V8_BINDING_REPO }}" >> $GITHUB_OUTPUT
97+
echo "v8_binding_ref=${{ env.V8_BINDING_REF }}" >> $GITHUB_OUTPUT
98+
echo "julia_binding_repo=${{ env.JULIA_BINDING_REPO }}" >> $GITHUB_OUTPUT
99+
echo "julia_binding_ref=${{ env.JULIA_BINDING_REF }}" >> $GITHUB_OUTPUT
100+
echo "ruby_binding_repo=${{ env.RUBY_BINDING_REPO }}" >> $GITHUB_OUTPUT
101+
echo "ruby_binding_ref=${{ env.RUBY_BINDING_REF }}" >> $GITHUB_OUTPUT

.github/workflows/pre-review-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
export MSRV=`cargo read-manifest | python -c 'import json,sys; print(json.load(sys.stdin)["rust_version"])'`
2828
export TEST=`cat rust-toolchain`
29-
echo "::set-output name=array::[\"$MSRV\", \"$TEST\", \"stable\"]"
29+
echo "array=[\"$MSRV\", \"$TEST\", \"stable\"]" >> $GITHUB_OUTPUT
3030
3131
pre-code-review-checks:
3232
needs: setup-test-matrix

macros/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn get_field_attribute<'f>(field: &'f Field, attr_name: &str) -> Option<&'f
1212
abort! { second_attr.path().span(), "Duplicated attribute: #[{}]", attr_name }
1313
};
1414

15-
attrs.get(0).cloned()
15+
attrs.first().cloned()
1616
}
1717

1818
pub fn get_fields_with_attribute<'f>(fields: &'f FieldsNamed, attr_name: &str) -> Vec<&'f Field> {

src/policy/marksweepspace/malloc_ms/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ mod global;
22
mod metadata;
33

44
pub use global::*;
5-
pub use metadata::*;

src/util/rust_util/mod.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,29 @@ impl<T> std::ops::Deref for InitializeOnce<T> {
102102

103103
unsafe impl<T> Sync for InitializeOnce<T> {}
104104

105+
/// This implements `std::array::from_fn` introduced in Rust 1.63.
106+
/// We should replace this with the standard counterpart after bumping MSRV,
107+
/// but we also need to evaluate whether it would use too much stack space (see code comments).
108+
pub(crate) fn array_from_fn<T, const N: usize, F>(mut cb: F) -> [T; N]
109+
where
110+
F: FnMut(usize) -> T,
111+
{
112+
// Note on unsafety: An alternative to the unsafe implementation below is creating a fixed
113+
// array of `[0, 1, 2, ..., N-1]` and using the `.map(cb)` method to create the result.
114+
// However, the `array::map` method implemented in the standard library consumes a surprisingly
115+
// large amount of stack space. For VMs that run on confined stacks, such as JikesRVM, that
116+
// would cause stack overflow. Therefore we implement it manually using unsafe primitives.
117+
let mut result_array: MaybeUninit<[T; N]> = MaybeUninit::zeroed();
118+
let array_ptr = result_array.as_mut_ptr();
119+
for index in 0..N {
120+
let item = cb(index);
121+
unsafe {
122+
std::ptr::addr_of_mut!((*array_ptr)[index]).write(item);
123+
}
124+
}
125+
unsafe { result_array.assume_init() }
126+
}
127+
105128
#[cfg(test)]
106129
mod initialize_once_tests {
107130
use super::*;
@@ -138,26 +161,3 @@ mod initialize_once_tests {
138161
assert_eq!(INITIALIZE_COUNT.load(Ordering::SeqCst), 1);
139162
}
140163
}
141-
142-
/// This implements `std::array::from_fn` introduced in Rust 1.63.
143-
/// We should replace this with the standard counterpart after bumping MSRV,
144-
/// but we also need to evaluate whether it would use too much stack space (see code comments).
145-
pub(crate) fn array_from_fn<T, const N: usize, F>(mut cb: F) -> [T; N]
146-
where
147-
F: FnMut(usize) -> T,
148-
{
149-
// Note on unsafety: An alternative to the unsafe implementation below is creating a fixed
150-
// array of `[0, 1, 2, ..., N-1]` and using the `.map(cb)` method to create the result.
151-
// However, the `array::map` method implemented in the standard library consumes a surprisingly
152-
// large amount of stack space. For VMs that run on confined stacks, such as JikesRVM, that
153-
// would cause stack overflow. Therefore we implement it manually using unsafe primitives.
154-
let mut result_array: MaybeUninit<[T; N]> = MaybeUninit::zeroed();
155-
let array_ptr = result_array.as_mut_ptr();
156-
for index in 0..N {
157-
let item = cb(index);
158-
unsafe {
159-
std::ptr::addr_of_mut!((*array_ptr)[index]).write(item);
160-
}
161-
}
162-
unsafe { result_array.assume_init() }
163-
}

src/util/statistics/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
pub use self::counter::Counter;
21
pub use self::counter::Timer;
32

43
pub mod counter;

0 commit comments

Comments
 (0)