diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index 3c4028b3..f6bcf43a 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -12,7 +12,7 @@ fi build_type=$1 # plan to use plan=$2 -# moving vs non-moving +# max-moving vs non-moving is_moving=$3 # helloworld.jl @@ -27,10 +27,14 @@ fi plan_feature=${plan,,} moving_feature=${is_moving,,} -if [ "$is_moving" == "moving" ]; then +if [ "$moving_feature" == "max_moving" ]; then MOVING=1 + ALWAYS_MOVING=1 + MAX_MOVING=1 else MOVING=0 + ALWAYS_MOVING=0 + MAX_MOVING=0 fi cd $JULIA_PATH @@ -39,6 +43,6 @@ make cleanall # This will build the binding in MMTK_JULIA_DIR (defined in common.sh), and link it # when building Julia, instead of using the set version defined in Julia itself cp $BINDING_PATH/.github/scripts/Make.user $JULIA_PATH/ -MMTK_MOVING=$MOVING MMTK_PLAN=$plan MMTK_BUILD=$build_type make +MMTK_MOVING=$MOVING MMTK_ALWAYS_MOVING=$ALWAYS_MOVING MMTK_MAX_MOVING=$MAX_MOVING MMTK_PLAN=$plan MMTK_BUILD=$build_type make # Run hello world $JULIA_PATH/julia $HELLO_WORLD_JL diff --git a/.github/scripts/ci-test-LinearAlgebra.sh b/.github/scripts/ci-test-LinearAlgebra.sh index ef6c1434..93f4b73d 100755 --- a/.github/scripts/ci-test-LinearAlgebra.sh +++ b/.github/scripts/ci-test-LinearAlgebra.sh @@ -17,5 +17,9 @@ total_mem_restricted=$((total_mem- mem_threshold)) num_workers=2 export JULIA_TEST_MAXRSS_MB=$((total_mem_restricted/ num_workers)) +# max-moving vs non-moving +is_moving=$2 +moving_feature=${is_moving,,} + echo "-> Run single threaded" -ci_run_jl_test "LinearAlgebra" 2 +ci_run_jl_test "LinearAlgebra" 2 $moving_feature diff --git a/.github/scripts/ci-test-other.sh b/.github/scripts/ci-test-other.sh index 662ad292..14945913 100755 --- a/.github/scripts/ci-test-other.sh +++ b/.github/scripts/ci-test-other.sh @@ -13,6 +13,10 @@ CHOOSE_TESTS_JL_CONTENT=`cat $CHOOSE_TESTS_JL_PATH` REGEX_PATTERN='.*const TESTNAMES = \[([^\[]*)^\].*' +# max-moving vs non-moving +is_moving=$2 +moving_feature=${is_moving,,} + if [[ $CHOOSE_TESTS_JL_CONTENT =~ $REGEX_PATTERN ]]; then RAW_TEST_NAMES=${BASH_REMATCH[1]} @@ -40,7 +44,7 @@ if [[ $CHOOSE_TESTS_JL_CONTENT =~ $REGEX_PATTERN ]]; then fi echo "-> Run" - ci_run_jl_test $test + ci_run_jl_test $test 1 $moving_feature fi done else diff --git a/.github/scripts/ci-test-stdlib.sh b/.github/scripts/ci-test-stdlib.sh index 40d151da..401b8b9b 100755 --- a/.github/scripts/ci-test-stdlib.sh +++ b/.github/scripts/ci-test-stdlib.sh @@ -51,6 +51,10 @@ if [ $(find $stdlib_path -mindepth 1 -maxdepth 1 | wc -l) -ne 1 ]; then exit 1 fi +# max-moving vs non-moving +is_moving=$2 +moving_feature=${is_moving,,} + for dir in $(find $stdlib_version_path -depth -mindepth 1 -type d -o -type l) do # if there is a runtests.jl, we run it. @@ -67,16 +71,16 @@ do if [[ "${tests_with_multi_workers[@]}" =~ "$test" ]]; then echo "-> Run multi threaded" - ci_run_jl_test $test 2 + ci_run_jl_test $test 2 $moving_feature continue fi if [[ "${tests_with_single_worker[@]}" =~ "$test" ]]; then echo "-> Run single threaded" - ci_run_jl_test $test 1 + ci_run_jl_test $test 1 $moving_feature continue fi - ci_run_jl_test $test + ci_run_jl_test $test 1 $moving_feature fi done diff --git a/.github/scripts/common.sh b/.github/scripts/common.sh index 7b10c356..f046b375 100644 --- a/.github/scripts/common.sh +++ b/.github/scripts/common.sh @@ -17,6 +17,18 @@ export JULIA_TEST_MAXRSS_MB=$total_mem ci_run_jl_test() { test=$1 threads=$2 + moving_feature=$3 + + + if [ "$moving_feature" == "max_moving" ]; then + MOVING=1 + ALWAYS_MOVING=1 + MAX_MOVING=1 + else + MOVING=0 + ALWAYS_MOVING=0 + MAX_MOVING=0 + fi # if no argument is given, use 2 as default if [ -z "$threads" ]; then @@ -30,5 +42,5 @@ ci_run_jl_test() { # $JULIA_PATH/julia $JULIA_TEST_ARGS $JULIA_PATH/test/runtests.jl --exit-on-error $test # Run with their build script - make test-$test + MMTK_MOVING=$MOVING MMTK_ALWAYS_MOVING=$ALWAYS_MOVING MMTK_MAX_MOVING=$MAX_MOVING make test-$test } diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 403fcdf8..085486e8 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -39,51 +39,52 @@ jobs: run: | ./.github/scripts/ci-style.sh - build-debug-regen-ffi: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v2 - - name: Setup environments - run: | - ./.github/scripts/ci-checkout.sh ${{ inputs.julia_repo }} ${{ inputs.julia_ref }} - ./.github/scripts/ci-setup.sh - # removing these as they cause a conflict within bindgen - sudo rm -rf /usr/lib/llvm-14 - sudo rm -rf /usr/lib/llvm-13 - - name: Check FFI bindings - run: | - ./.github/scripts/ci-ffi.sh - - name: Build Julia (Debug) - run: | - ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} - - name: Print Julia version info - run: | - JULIA_PATH=$(realpath $(dirname "$0"))/../mmtk-julia/mmtk-julia/vm/julia - $JULIA_PATH/julia --project=. -e "using InteractiveUtils; versioninfo()" - - name: Style check - run: | - ./.github/scripts/ci-style.sh +# Commenting these out since they shouldn't be needed in the mmtk-support-moving-upstream branch + # build-debug-regen-ffi: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v2 + # - name: Setup environments + # run: | + # ./.github/scripts/ci-checkout.sh ${{ inputs.julia_repo }} ${{ inputs.julia_ref }} + # ./.github/scripts/ci-setup.sh + # # removing these as they cause a conflict within bindgen + # sudo rm -rf /usr/lib/llvm-14 + # sudo rm -rf /usr/lib/llvm-13 + # - name: Check FFI bindings + # run: | + # ./.github/scripts/ci-ffi.sh + # - name: Build Julia (Debug) + # run: | + # ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} + # - name: Print Julia version info + # run: | + # JULIA_PATH=$(realpath $(dirname "$0"))/../mmtk-julia/mmtk-julia/vm/julia + # $JULIA_PATH/julia --project=. -e "using InteractiveUtils; versioninfo()" + # - name: Style check + # run: | + # ./.github/scripts/ci-style.sh - check-ffi: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v2 - - name: Setup environments - run: | - ./.github/scripts/ci-checkout.sh ${{ inputs.julia_repo }} ${{ inputs.julia_ref }} - ./.github/scripts/ci-setup.sh - # removing these as they cause a conflict within bindgen - sudo rm -rf /usr/lib/llvm-14 - sudo rm -rf /usr/lib/llvm-13 - - name: Regenerate FFI bindings - run: | - ./.github/scripts/ci-ffi.sh - - run: | - MMTK_JULIA_DIR=$(realpath $(dirname "$0"))/../mmtk-julia/mmtk-julia - if ! git diff --exit-code $MMTK_JULIA_DIR/mmtk/src/julia_types.rs; then - echo "Rust FFI bindings in \`julia_types.rs\` are outdated. Run \`make regen-bindgen-ffi\` from the mmtk-julia directory and make sure to include the updated file in the pull request." - exit 1 - fi + # check-ffi: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v2 + # - name: Setup environments + # run: | + # ./.github/scripts/ci-checkout.sh ${{ inputs.julia_repo }} ${{ inputs.julia_ref }} + # ./.github/scripts/ci-setup.sh + # # removing these as they cause a conflict within bindgen + # sudo rm -rf /usr/lib/llvm-14 + # sudo rm -rf /usr/lib/llvm-13 + # - name: Regenerate FFI bindings + # run: | + # ./.github/scripts/ci-ffi.sh + # - run: | + # MMTK_JULIA_DIR=$(realpath $(dirname "$0"))/../mmtk-julia/mmtk-julia + # if ! git diff --exit-code $MMTK_JULIA_DIR/mmtk/src/julia_types.rs; then + # echo "Rust FFI bindings in \`julia_types.rs\` are outdated. Run \`make regen-bindgen-ffi\` from the mmtk-julia directory and make sure to include the updated file in the pull request." + # exit 1 + # fi build-test-other: runs-on: ubuntu-22.04 @@ -109,7 +110,7 @@ jobs: $JULIA_PATH/julia --project=. -e "using InteractiveUtils; versioninfo()" - name: Test Julia run: | - ./.github/scripts/ci-test-other.sh ${{ inputs.gc_plan }} + ./.github/scripts/ci-test-other.sh ${{ inputs.gc_plan }} ${{ inputs.moving }} build-test-stdlib: runs-on: ubuntu-22.04 @@ -135,7 +136,7 @@ jobs: $JULIA_PATH/julia --project=. -e "using InteractiveUtils; versioninfo()" - name: Test Julia run: | - ./.github/scripts/ci-test-stdlib.sh ${{ inputs.gc_plan }} + ./.github/scripts/ci-test-stdlib.sh ${{ inputs.gc_plan }} ${{ inputs.moving }} build-test-LinearAlgebra: runs-on: ubuntu-22.04 @@ -158,4 +159,4 @@ jobs: $JULIA_PATH/julia --project=. -e "using InteractiveUtils; versioninfo()" - name: Test Julia run: | - ./.github/scripts/ci-test-LinearAlgebra.sh ${{ inputs.gc_plan }} + ./.github/scripts/ci-test-LinearAlgebra.sh ${{ inputs.gc_plan }} ${{ inputs.moving }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e45266e..54b088f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,7 @@ on: - v1.8.2\+RAI - v1.9.2\+RAI - dev + - mmtk-support-moving-upstream concurrency: # Cancels pending runs when a PR gets updated. @@ -17,8 +18,8 @@ jobs: julia-version: runs-on: ubuntu-latest env: - JULIA_REPO_DEFAULT: JuliaLang/julia - JULIA_REF_DEFAULT: master + JULIA_REPO_DEFAULT: mmtk/julia + JULIA_REF_DEFAULT: mmtk-support-moving-upstream outputs: julia_repo: ${{ steps.print.outputs.julia_repo }} julia_ref: ${{ steps.print.outputs.julia_ref }} @@ -40,7 +41,7 @@ jobs: fail-fast: false matrix: gc_plan: [Immix] - moving: [Non_Moving, Moving] + moving: [Non_Moving, Max_Moving] uses: ./.github/workflows/binding-tests.yml with: gc_plan: ${{ matrix.gc_plan }} diff --git a/Makefile b/Makefile index 6ef803e6..01ce4c29 100644 --- a/Makefile +++ b/Makefile @@ -61,7 +61,7 @@ release: @cd $(MMTK_JULIA_DIR)mmtk && $(PROJECT_DIRS) cargo build --features $(CARGO_FEATURES) --release debug: - @echo "Building the Rust project in $(MMTK_JULIA_DIR) using a debug build"; + @echo "Building the Rust project in $(MMTK_JULIA_DIR)mmtk using a debug build with MMTK_VARS: $(MMTK_VARS)"; @cd $(MMTK_JULIA_DIR)mmtk && $(PROJECT_DIRS) cargo build --features $(CARGO_FEATURES) # Build the Julia project (which will build the binding as part of their deps build)