ruby-changes:69255
From: Noah <ko1@a...>
Date: Thu, 21 Oct 2021 08:24:22 +0900 (JST)
Subject: [ruby-changes:69255] 21e58acef3 (master): Don't enable YJIT by default. More tests on both Ubuntu and MacOS.
https://git.ruby-lang.org/ruby.git/commit/?id=21e58acef3 From 21e58acef347bb3891262ab38ac211c8d877efd7 Mon Sep 17 00:00:00 2001 From: Noah Gibbs <noah.gibbs@s...> Date: Fri, 1 Oct 2021 13:45:02 +0100 Subject: Don't enable YJIT by default. More tests on both Ubuntu and MacOS. Add RUBY_YJIT_ENABLE env var and YJIT_FORCE_ENABLE compile-time constant. Rename YJIT_STATS to RUBY_YJIT_STATS. --- .github/workflows/compilers.yml | 1 + .github/workflows/yjit-macos.yml | 69 +++++++++++++++++++++++++++++++ .github/workflows/yjit-ubuntu.yml | 86 +++++++++++++++++++++++++++++++++++++++ .github/workflows/yjit.yml | 70 ------------------------------- ruby.c | 7 +++- yjit_iface.c | 2 +- 6 files changed, 163 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/yjit-macos.yml create mode 100644 .github/workflows/yjit-ubuntu.yml delete mode 100644 .github/workflows/yjit.yml diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 6ddfba05db..e6ad9db6e2 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -167,6 +167,7 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/compilers.yml#L167 # - { key: cppflags, name: VM_DEBUG_VERIFY_METHOD_CACHE, value: '-DVM_DEBUG_VERIFY_METHOD_CACHE' } - { key: cppflags, name: MJIT_FORCE_ENABLE, value: '-DMJIT_FORCE_ENABLE' } + - { key: cppflags, name: YJIT_FORCE_ENABLE, value: '-DYJIT_FORCE_ENABLE' } name: ${{ matrix.entry.name }} runs-on: ubuntu-latest diff --git a/.github/workflows/yjit-macos.yml b/.github/workflows/yjit-macos.yml new file mode 100644 index 0000000000..be0f3c8986 --- /dev/null +++ b/.github/workflows/yjit-macos.yml @@ -0,0 +1,69 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/yjit-macos.yml#L1 +name: YJIT MacOS +on: [push, pull_request] +jobs: + make: + runs-on: macos-latest + strategy: + matrix: + test_task: [ "check", "test-bundler-parallel" ] #, "test-bundled-gems" ] + yjit_opts: [ + "--yjit", + "--yjit --yjit-call-threshold=1 --yjit-max-versions=1", + "--yjit --yjit-call-threshold=1", + "--yjit --yjit-call-threshold=2" + ] + fail-fast: false + env: + TESTOPTS: '-q --tty=no' + RUN_OPTS: '--disable-gems ${{ matrix.yjit_opts }}' + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + steps: + - run: mkdir build + working-directory: + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v2 + with: + path: src + - name: Install libraries + run: | + brew upgrade + brew install gmp libffi openssl@1... zlib autoconf automake libtool readline + working-directory: src + - name: Set ENV + run: | + echo "JOBS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV + - run: ./autogen.sh + working-directory: src + - name: Run configure + run: ../src/configure -C --disable-install-doc --with-openssl-dir=$(brew --prefix openssl@1...) --with-readline-dir=$(brew --prefix readline) + - run: make $JOBS incs + - run: make $JOBS +# - run: make leaked-globals +# if: matrix.test_task == 'check' + - run: make prepare-gems + if: ${{ matrix.test_task == 'check' }} + - run: make $JOBS -s ${{ matrix.test_task }} + timeout-minutes: 60 + env: + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "rexml" + - uses: k0kubun/action-slack@v... + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ github.workflow }} / ${{ matrix.test_task }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml new file mode 100644 index 0000000000..93e12b725f --- /dev/null +++ b/.github/workflows/yjit-ubuntu.yml @@ -0,0 +1,86 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/yjit-ubuntu.yml#L1 +name: Ubuntu +on: [push, pull_request] +jobs: + make: + strategy: + matrix: + test_task: ["check", "test-bundler-parallel", "test-bundled-gems", "test-all", "test-spec"] + os: + - ubuntu-20.04 +# - ubuntu-18.04 + yjit_opts: [ + "--yjit", + "--yjit --yjit-call-threshold=1 --yjit-max-versions=1", + "--yjit --yjit-call-threshold=1", + "--yjit --yjit-call-threshold=2" + ] + configure: ["", "cppflags=-DRUBY_DEBUG"] + include: + - test_task: "test-all TESTS=--repeat-count=2" + os: ubuntu-20.04 + configure: "" + fail-fast: false + env: + GITPULLOPTIONS: --no-tags origin ${{github.ref}} + RUN_OPTS: ${{ matrix.yjit_opts }} + RUBY_DEBUG: ci + runs-on: ${{ matrix.os }} + steps: + - run: mkdir build + working-directory: + - name: Install libraries + run: | + set -x + sudo apt-get update -q || : + sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev bison autoconf ruby + - name: git config + run: | + git config --global advice.detachedHead 0 + git config --global init.defaultBranch garbage + - uses: actions/checkout@v2 + with: + path: src + - name: Fixed world writable dirs + run: | + chmod -v go-w $HOME $HOME/.config + sudo chmod -R go-w /usr/share + sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || : + - name: Set ENV + run: | + echo "JOBS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV + - run: ./autogen.sh + working-directory: src + - name: Run configure + run: ../src/configure -C --disable-install-doc ${{ matrix.configure }} + - run: make $JOBS incs + - run: make $JOBS +# - run: make leaked-globals +# if: matrix.test_task == 'check' + - run: make prepare-gems + if: ${{ matrix.test_task == 'check' }} + - name: Create dummy files in build dir + run: | + ./miniruby -e '(("a".."z").to_a+("A".."Z").to_a+("0".."9").to_a+%w[foo bar test zzz]).each{|basename|File.write("#{basename}.rb", "raise %(do not load #{basename}.rb)")}' + if: ${{ matrix.test_task == 'check' }} + - run: make $JOBS -s ${{ matrix.test_task }} RUN_OPTS="$RUN_OPTS" + timeout-minutes: 60 + env: + RUBY_TESTOPTS: "-q --tty=no" + TEST_BUNDLED_GEMS_ALLOW_FAILURES: "" + - uses: k0kubun/action-slack@v... + with: + payload: | + { + "ci": "GitHub Actions", + "env": "${{ matrix.os }} / ${{ matrix.test_task }}${{ matrix.configure }}", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", + "commit": "${{ github.sha }}", + "branch": "${{ github.ref }}".split('/').reverse()[0] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() && github.event_name == 'push' }} + +defaults: + run: + working-directory: build diff --git a/.github/workflows/yjit.yml b/.github/workflows/yjit.yml deleted file mode 100644 index 6263e7c533..0000000000 --- a/.github/workflows/yjit.yml +++ /dev/null @@ -1,70 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/.github/workflows/yjit-ubuntu.yml#L0 -name: YJIT options -on: [push, pull_request] -jobs: - make: - strategy: - matrix: - # To make job names consistent - test_task: [ "check" ] - # Run with multiple thresholds and params to surface more bugs - yjit_opts: [ - "--yjit-call-threshold=1 --yjit-max-versions=1", - "--yjit-call-threshold=1", - "--yjit-call-threshold=2" - ] - fail-fast: false - runs-on: ubuntu-latest - env: - TESTOPTS: '-q --tty=no' - RUN_OPTS: '--disable-gems ${{ matrix.yjit_opts }}' - GITPULLOPTIONS: --no-tags origin ${{ github.ref }} - steps: - - run: mkdir build - working-directory: - - name: Install libraries - run: | - set -x - sudo apt-get update -q || : - sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev bison autoconf ruby - - name: git config - run: | - git config --global advice.detachedHead 0 - git config --global init.defaultBranch garbage - - uses: actions/checkout@v2 - with: - path: src - - name: Fixed world writable dirs - run: | - chmod -v go-w $HOME $HOME/.config - sudo chmod -R go-w /usr/share - sudo bash -c 'IFS=:; for d in '"$PATH"'; do chmod -v go-w $d; done' || : - - name: Set ENV - run: | - echo "JOBS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV - - run: ./autogen.sh - working-directory: src - - name: Run configure - run: ../src/configure -C --disable-install-doc - - run: make $JOBS incs - - run: make $JOBS - - run: sudo make $JOBS -s install - - run: sudo apt-get install gdb # (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/