diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index fb48b4af62..0000000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,22 +0,0 @@ -## Code Standards - -### General Guidelines - -Don't modify testing files, instead, you should fix the compiler or library code that is causing the test to fail. - - - - -### Testing a single case - -You can run a single test case by using the command `./koch temp c -r testname`, where `testname` is the name of the test case you want to run. Don't use testament. - - -### Repository Structure - -- `compiler`: Contains the Nim compiler source code. -- `lib`: Contains standard libraries and modules. -- `tests`: Contains test cases for the compiler and standard libraries. -- `doc`: Contains documentation related to the Nim programming language. \ No newline at end of file diff --git a/.github/workflows/bisects.yml b/.github/workflows/bisects.yml index 271fd9eb6f..ef6e160a06 100644 --- a/.github/workflows/bisects.yml +++ b/.github/workflows/bisects.yml @@ -1,38 +1,38 @@ -# # See https://github.com/juancarlospaco/nimrun-action/issues/3#issuecomment-1607344901 -# name: issue comments bisects -# on: -# issue_comment: -# types: created +# See https://github.com/juancarlospaco/nimrun-action/issues/3#issuecomment-1607344901 +name: issue comments bisects +on: + issue_comment: + types: created -# jobs: -# bisects: -# if: | -# github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '!nim ') && github.event.issue.pull_request == null && github.event.comment.author_association != 'NONE' -# strategy: -# fail-fast: false -# matrix: -# platform: [ubuntu-latest, windows-latest, macos-latest] -# name: ${{ matrix.platform }}-bisects -# runs-on: ${{ matrix.platform }} -# steps: -# - uses: actions/checkout@v6 +jobs: + bisects: + if: | + github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '!nim ') && github.event.issue.pull_request == null && github.event.comment.author_association != 'NONE' + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest, windows-latest, macos-latest] + name: ${{ matrix.platform }}-bisects + runs-on: ${{ matrix.platform }} + steps: + - uses: actions/checkout@v6 -# - name: Install OpenSSL (Windows) -# if: | -# runner.os == 'Windows' -# run: choco install openssl.light --version=1.1.1.0 # OpenSSL 3.x removed SSL_library_init -# shell: 'powershell' + - name: Install OpenSSL (Windows) + if: | + runner.os == 'Windows' + run: choco install openssl.light --version=1.1.1.0 # OpenSSL 3.x removed SSL_library_init + shell: 'powershell' -# # v2 wont work here, because uses "hardcoded" nim versions, action "dynamically" finds version with bug. -# - uses: jiro4989/setup-nim-action@v1 -# with: -# nim-version: 'devel' + # v2 wont work here, because uses "hardcoded" nim versions, action "dynamically" finds version with bug. + - uses: jiro4989/setup-nim-action@v1 + with: + nim-version: 'devel' -# - uses: juancarlospaco/nimrun-action@nim -# if: | -# runner.os == 'Linux' && contains(github.event.comment.body, '-d:linux' ) || -# runner.os == 'Windows' && contains(github.event.comment.body, '-d:windows') || -# runner.os == 'macOS' && contains(github.event.comment.body, '-d:osx' ) || -# runner.os == 'Linux' && !contains(github.event.comment.body, '-d:linux') && !contains(github.event.comment.body, '-d:windows') && !contains(github.event.comment.body, '-d:osx') -# with: -# github-token: ${{ secrets.GITHUB_TOKEN }} + - uses: juancarlospaco/nimrun-action@nim + if: | + runner.os == 'Linux' && contains(github.event.comment.body, '-d:linux' ) || + runner.os == 'Windows' && contains(github.event.comment.body, '-d:windows') || + runner.os == 'macOS' && contains(github.event.comment.body, '-d:osx' ) || + runner.os == 'Linux' && !contains(github.event.comment.body, '-d:linux') && !contains(github.event.comment.body, '-d:windows') && !contains(github.event.comment.body, '-d:osx') + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index c259d1ba5d..74dd234a28 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -1,116 +1,116 @@ -# name: Nim Docs CI -# on: -# push: -# paths: -# - 'compiler/**.nim' -# - 'config/nimdoc.cfg' -# - 'doc/**.rst' -# - 'doc/**.md' -# - 'doc/nimdoc.css' -# - 'lib/**.nim' -# - 'nimdoc/testproject/expected/testproject.html' -# - 'tools/dochack/dochack.nim' -# - 'tools/kochdocs.nim' -# - '.github/workflows/ci_docs.yml' -# - 'koch.nim' +name: Nim Docs CI +on: + push: + paths: + - 'compiler/**.nim' + - 'config/nimdoc.cfg' + - 'doc/**.rst' + - 'doc/**.md' + - 'doc/nimdoc.css' + - 'lib/**.nim' + - 'nimdoc/testproject/expected/testproject.html' + - 'tools/dochack/dochack.nim' + - 'tools/kochdocs.nim' + - '.github/workflows/ci_docs.yml' + - 'koch.nim' -# pull_request: -# # Run only on changes on these files. -# paths: -# - 'compiler/**.nim' -# - 'config/nimdoc.cfg' -# - 'doc/**.rst' -# - 'doc/**.md' -# - 'doc/nimdoc.css' -# - 'lib/**.nim' -# - 'nimdoc/testproject/expected/testproject.html' -# - 'tools/dochack/dochack.nim' -# - 'tools/kochdocs.nim' -# - '.github/workflows/ci_docs.yml' -# - 'koch.nim' + pull_request: + # Run only on changes on these files. + paths: + - 'compiler/**.nim' + - 'config/nimdoc.cfg' + - 'doc/**.rst' + - 'doc/**.md' + - 'doc/nimdoc.css' + - 'lib/**.nim' + - 'nimdoc/testproject/expected/testproject.html' + - 'tools/dochack/dochack.nim' + - 'tools/kochdocs.nim' + - '.github/workflows/ci_docs.yml' + - 'koch.nim' -# concurrency: -# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} -# cancel-in-progress: true +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true -# jobs: -# build: -# strategy: -# fail-fast: false -# matrix: -# target: [linux, windows, osx] -# include: -# - target: linux -# os: ubuntu-22.04 -# - target: windows -# os: windows-latest -# - target: osx -# os: macos-15 +jobs: + build: + strategy: + fail-fast: false + matrix: + target: [linux, windows, osx] + include: + - target: linux + os: ubuntu-22.04 + - target: windows + os: windows-latest + - target: osx + os: macos-15 -# name: ${{ matrix.target }} -# runs-on: ${{ matrix.os }} -# timeout-minutes: 60 # refs bug #18178 + name: ${{ matrix.target }} + runs-on: ${{ matrix.os }} + timeout-minutes: 60 # refs bug #18178 -# steps: -# - name: 'Checkout' -# uses: actions/checkout@v6 -# with: -# fetch-depth: 2 + steps: + - name: 'Checkout' + uses: actions/checkout@v6 + with: + fetch-depth: 2 -# - name: 'Install build dependencies (macOS)' -# if: runner.os == 'macOS' -# run: brew install make + - name: 'Install build dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install make -# - name: 'Install build dependencies (Windows)' -# if: runner.os == 'Windows' -# shell: bash -# run: | -# set -e -# . ci/funs.sh -# nimInternalInstallDepsWindows -# echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + - name: 'Install build dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" -# - name: 'Add build binaries to PATH' -# shell: bash -# run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" -# - name: 'System information' -# shell: bash -# run: . ci/funs.sh && nimCiSystemInfo + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo -# - name: 'Build csourcesAny (posix)' -# # this would work on windows and other CI use this on windows, -# # but we ensure here that `ci/build_autogen.bat` keeps working on windows. -# if: runner.os != 'Windows' -# shell: bash -# run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc -# # was previously using caching via `actions/cache@v1` but this wasn't -# # used in other CI pipelines and it's unclear the added complexity -# # was worth the saving; can be revisited if needed. + - name: 'Build csourcesAny (posix)' + # this would work on windows and other CI use this on windows, + # but we ensure here that `ci/build_autogen.bat` keeps working on windows. + if: runner.os != 'Windows' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc + # was previously using caching via `actions/cache@v1` but this wasn't + # used in other CI pipelines and it's unclear the added complexity + # was worth the saving; can be revisited if needed. -# - name: 'Build csourcesAny (windows)' -# if: runner.os == 'Windows' -# shell: cmd -# run: ci/build_autogen.bat + - name: 'Build csourcesAny (windows)' + if: runner.os == 'Windows' + shell: cmd + run: ci/build_autogen.bat -# - name: 'Build koch' -# shell: bash -# run: nim c koch + - name: 'Build koch' + shell: bash + run: nim c koch -# - name: 'Build the real compiler' -# shell: bash -# run: ./koch boot -d:release + - name: 'Build the real compiler' + shell: bash + run: ./koch boot -d:release -# - name: 'Build documentation' -# shell: bash -# run: ./koch doc --git.commit:devel + - name: 'Build documentation' + shell: bash + run: ./koch doc --git.commit:devel -# - name: 'Publish documentation to Github Pages' -# if: | -# github.event_name == 'push' && github.ref == 'refs/heads/devel' && -# matrix.target == 'linux' -# uses: crazy-max/ghaction-github-pages@v4 -# with: -# build_dir: doc/html -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: 'Publish documentation to Github Pages' + if: | + github.event_name == 'push' && github.ref == 'refs/heads/devel' && + matrix.target == 'linux' + uses: crazy-max/ghaction-github-pages@v4 + with: + build_dir: doc/html + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_i386_linux.yml b/.github/workflows/ci_i386_linux.yml deleted file mode 100644 index 5caf1d8d4f..0000000000 --- a/.github/workflows/ci_i386_linux.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: i386 Linux CI - -on: - pull_request: - branches: - - '*' - workflow_dispatch: - - -jobs: - build: - strategy: - fail-fast: false - max-parallel: 20 - matrix: - branch: [devel] - target: - - os: linux - cpu: i386 - nim_branch: devel - include: - - target: - os: linux - builder: ubuntu-24.04 - - name: '${{ matrix.target.os }}-${{ matrix.target.cpu }}-nim-${{ matrix.target.nim_branch }} (${{ matrix.branch }})' - runs-on: ${{ matrix.builder }} - env: - NIM_DIR: nim-${{ matrix.target.nim_branch }}-${{ matrix.target.cpu }} - NIM_BRANCH: ${{ matrix.target.nim_branch }} - NIM_ARCH: ${{ matrix.target.cpu }} - steps: - - name: set `core.autocrlf` to false - run: | - git config --global core.autocrlf false - git config --global init.defaultBranch master - - - name: Checkout - uses: actions/checkout@v6 - with: - submodules: false - - - name: Install dependencies (Linux i386) - if: runner.os == 'Linux' && matrix.target.cpu == 'i386' - working-directory: ${{ github.workspace }} - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo DEBIAN_FRONTEND='noninteractive' apt-get install \ - --no-install-recommends -yq gcc-multilib g++-multilib \ - libssl-dev:i386 - - mkdir -p external/bin - cat << EOF > external/bin/gcc - #!/bin/bash - - exec $(which gcc) -m32 "\$@" - EOF - - cat << EOF > external/bin/g++ - #!/bin/bash - - exec $(which g++) -m32 "\$@" - EOF - - chmod 755 external/bin/gcc external/bin/g++ - - echo "$PWD/external/bin" >> "${GITHUB_PATH}" - - - name: Add repo bin to PATH - run: echo "${GITHUB_WORKSPACE}/bin" >> ${GITHUB_PATH} - - - name: Setup Nim - uses: alaviss/setup-nim@0.1.1 - with: - path: 'nim' - version: ${{ matrix.target.nim_branch }} - architecture: ${{ matrix.target.cpu }} - - # - name: Build koch using existing nim - # run: | - # nim c koch.nim - - # - name: Boot the compiler from the checked-out commit - # shell: bash - # run: | - # ./koch boot -d:release - - # - name: Show nim version and system info - # run: | - # bin/nim -v || true - # uname -a || true - - - name: Run talign test (i386) - shell: bash - run: | - set -euo pipefail - export PATH="${GITHUB_WORKSPACE}/bin:$PATH" - nim c -r --lib:lib --mm:refc -d:useGcAssert -d:useSysAssert tests/align/talign.nim - nim c -r --lib:lib --mm:refc -d:useGcAssert -d:useSysAssert tests/align/talign2.nim \ No newline at end of file diff --git a/.github/workflows/ci_packages.yml b/.github/workflows/ci_packages.yml index 2fbd9ddaeb..6cef86c28a 100644 --- a/.github/workflows/ci_packages.yml +++ b/.github/workflows/ci_packages.yml @@ -1,80 +1,80 @@ -# name: Packages CI -# on: -# pull_request: -# push: -# branches: -# - 'devel' -# - 'version-2-2' -# - 'version-2-0' -# - 'version-1-6' -# - 'version-1-2' +name: Packages CI +on: + pull_request: + push: + branches: + - 'devel' + - 'version-2-2' + - 'version-2-0' + - 'version-1-6' + - 'version-1-2' -# concurrency: -# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} -# cancel-in-progress: true +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true -# jobs: -# build: -# strategy: -# fail-fast: false -# matrix: -# os: [ubuntu-latest, macos-14] -# batch: ["allowed_failures", "0_3", "1_3", "2_3"] # list of `index_num` -# include: -# - os: ubuntu-latest -# cpu: amd64 -# - os: macos-14 -# cpu: arm64 -# name: '${{ matrix.os }} (batch: ${{ matrix.batch }})' -# runs-on: ${{ matrix.os }} -# timeout-minutes: 60 # refs bug #18178 -# env: -# NIM_TEST_PACKAGES: "1" -# NIM_TESTAMENT_BATCH: ${{ matrix.batch }} -# steps: -# - name: 'Checkout' -# uses: actions/checkout@v6 -# with: -# fetch-depth: 2 +jobs: + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-14] + batch: ["allowed_failures", "0_3", "1_3", "2_3"] # list of `index_num` + include: + - os: ubuntu-latest + cpu: amd64 + - os: macos-14 + cpu: arm64 + name: '${{ matrix.os }} (batch: ${{ matrix.batch }})' + runs-on: ${{ matrix.os }} + timeout-minutes: 60 # refs bug #18178 + env: + NIM_TEST_PACKAGES: "1" + NIM_TESTAMENT_BATCH: ${{ matrix.batch }} + steps: + - name: 'Checkout' + uses: actions/checkout@v6 + with: + fetch-depth: 2 -# - name: 'Install node.js' -# uses: actions/setup-node@v6 -# with: -# node-version: 24 + - name: 'Install node.js' + uses: actions/setup-node@v6 + with: + node-version: 24 -# - name: 'Install dependencies (Linux amd64)' -# if: runner.os == 'Linux' && matrix.cpu == 'amd64' -# run: | -# sudo apt-get update -qq -# DEBIAN_FRONTEND='noninteractive' \ -# sudo apt-get install --no-install-recommends -yq \ -# libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ -# valgrind libc6-dbg libblas-dev liblapack-dev libpcre3 xorg-dev -# - name: 'Install dependencies (macOS)' -# if: runner.os == 'macOS' -# run: brew install boehmgc make sfml gtk+3 -# # XXX can't find boehm and gtk on macos 13 -# - name: 'Install dependencies (Windows)' -# if: runner.os == 'Windows' -# shell: bash -# run: | -# set -e -# . ci/funs.sh -# nimInternalInstallDepsWindows -# echo_run echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + - name: 'Install dependencies (Linux amd64)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo apt-get update -qq + DEBIAN_FRONTEND='noninteractive' \ + sudo apt-get install --no-install-recommends -yq \ + libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ + valgrind libc6-dbg libblas-dev liblapack-dev libpcre3 xorg-dev + - name: 'Install dependencies (macOS)' + if: runner.os == 'macOS' + run: brew install boehmgc make sfml gtk+3 + # XXX can't find boehm and gtk on macos 13 + - name: 'Install dependencies (Windows)' + if: runner.os == 'Windows' + shell: bash + run: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo_run echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" -# - name: 'Add build binaries to PATH' -# shell: bash -# run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" -# - name: 'System information' -# shell: bash -# run: . ci/funs.sh && nimCiSystemInfo + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo -# - name: 'Build csourcesAny' -# shell: bash -# run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' + - name: 'Build csourcesAny' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' -# - name: 'koch, Run CI' -# shell: bash -# run: . ci/funs.sh && nimInternalBuildKochAndRunCI + - name: 'koch, Run CI' + shell: bash + run: . ci/funs.sh && nimInternalBuildKochAndRunCI diff --git a/.github/workflows/ci_publish.yml b/.github/workflows/ci_publish.yml index 67b2eea99f..44cfaf8213 100644 --- a/.github/workflows/ci_publish.yml +++ b/.github/workflows/ci_publish.yml @@ -1,79 +1,79 @@ -# name: Tracking orc-booting compiler memory usage +name: Tracking orc-booting compiler memory usage -# on: -# pull_request_target: -# types: [closed] +on: + pull_request_target: + types: [closed] -# jobs: -# build: -# if: github.event.pull_request.merged == true -# strategy: -# fail-fast: false -# matrix: -# os: [ubuntu-22.04] -# cpu: [amd64] -# name: '${{ matrix.os }}' -# runs-on: ${{ matrix.os }} -# steps: -# - name: 'Checkout' -# uses: actions/checkout@v6 -# with: -# fetch-depth: 2 +jobs: + build: + if: github.event.pull_request.merged == true + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04] + cpu: [amd64] + name: '${{ matrix.os }}' + runs-on: ${{ matrix.os }} + steps: + - name: 'Checkout' + uses: actions/checkout@v6 + with: + fetch-depth: 2 -# - name: 'Install node.js' -# uses: actions/setup-node@v6 -# with: -# node-version: 24 + - name: 'Install node.js' + uses: actions/setup-node@v6 + with: + node-version: 24 -# - name: 'Install dependencies (Linux amd64)' -# if: runner.os == 'Linux' && matrix.cpu == 'amd64' -# run: | -# sudo apt-fast update -qq -# DEBIAN_FRONTEND='noninteractive' \ -# sudo apt-fast install --no-install-recommends -yq \ -# libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ -# valgrind libc6-dbg libblas-dev xorg-dev + - name: 'Install dependencies (Linux amd64)' + if: runner.os == 'Linux' && matrix.cpu == 'amd64' + run: | + sudo apt-fast update -qq + DEBIAN_FRONTEND='noninteractive' \ + sudo apt-fast install --no-install-recommends -yq \ + libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \ + valgrind libc6-dbg libblas-dev xorg-dev -# - name: 'Add build binaries to PATH' -# shell: bash -# run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + - name: 'Add build binaries to PATH' + shell: bash + run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" -# - name: 'System information' -# shell: bash -# run: . ci/funs.sh && nimCiSystemInfo + - name: 'System information' + shell: bash + run: . ci/funs.sh && nimCiSystemInfo -# - name: 'Build csourcesAny' -# shell: bash -# run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' + - name: 'Build csourcesAny' + shell: bash + run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}' -# - name: 'Build koch' -# shell: bash -# run: nim c koch + - name: 'Build koch' + shell: bash + run: nim c koch -# - name: 'Build Nim' -# shell: bash -# run: ./koch boot -d:release -d:nimStrictMode --lib:lib + - name: 'Build Nim' + shell: bash + run: ./koch boot -d:release -d:nimStrictMode --lib:lib -# - name: 'Action' -# shell: bash -# run: nim c -r -d:release ci/action.nim + - name: 'Action' + shell: bash + run: nim c -r -d:release ci/action.nim -# - name: 'Comment' -# uses: actions/github-script@v8 -# with: -# script: | -# const fs = require('fs'); + - name: 'Comment' + uses: actions/github-script@v8 + with: + script: | + const fs = require('fs'); -# try { -# const data = fs.readFileSync('ci/nimcache/results.txt', 'utf8'); -# github.rest.issues.createComment({ -# issue_number: context.issue.number, -# owner: context.repo.owner, -# repo: context.repo.repo, -# body: data -# }) -# } catch (err) { -# console.error(err); -# } + try { + const data = fs.readFileSync('ci/nimcache/results.txt', 'utf8'); + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: data + }) + } catch (err) { + console.error(err); + } diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 586f2acfde..b918b21050 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,25 +1,25 @@ -# # https://github.com/actions/stale#usage -# name: Stale pull requests +# https://github.com/actions/stale#usage +name: Stale pull requests -# on: -# schedule: -# - cron: '0 0 * * *' # Midnight. +on: + schedule: + - cron: '0 0 * * *' # Midnight. -# jobs: -# stale: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/stale@v10 -# with: -# days-before-pr-stale: 365 -# days-before-pr-close: 30 -# days-before-issue-stale: -1 -# days-before-issue-close: -1 -# exempt-pr-labels: "ARC,bounty,Codegen,Crash,Generics,High Priority,Macros,Next release,Showstopper,Static[T]" -# exempt-issue-labels: "Showstopper,Severe,bounty,Compiler Crash,Medium Priority" -# stale-pr-message: > -# This pull request is stale because it has been open for 1 year with no activity. -# Contribute more commits on the pull request and rebase it on the latest devel, -# or it will be closed in 30 days. Thank you for your contributions. -# close-pr-message: > -# This pull request has been marked as stale and closed due to inactivity after 395 days. +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v10 + with: + days-before-pr-stale: 365 + days-before-pr-close: 30 + days-before-issue-stale: -1 + days-before-issue-close: -1 + exempt-pr-labels: "ARC,bounty,Codegen,Crash,Generics,High Priority,Macros,Next release,Showstopper,Static[T]" + exempt-issue-labels: "Showstopper,Severe,bounty,Compiler Crash,Medium Priority" + stale-pr-message: > + This pull request is stale because it has been open for 1 year with no activity. + Contribute more commits on the pull request and rebase it on the latest devel, + or it will be closed in 30 days. Thank you for your contributions. + close-pr-message: > + This pull request has been marked as stale and closed due to inactivity after 395 days. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3b5f1c9540..96e747a730 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,172 +1,172 @@ -# trigger: -# branches: -# include: -# - 'devel' -# - 'version-*' -# pr: -# branches: -# include: -# - '*' +trigger: + branches: + include: + - 'devel' + - 'version-*' +pr: + branches: + include: + - '*' -# variables: -# - name: skipci -# value: false +variables: +- name: skipci + value: false -# jobs: -# - job: packages +jobs: +- job: packages -# timeoutInMinutes: 90 # default `60` led to lots of cancelled jobs; use 0 for unlimited (may be undesirable) + timeoutInMinutes: 90 # default `60` led to lots of cancelled jobs; use 0 for unlimited (may be undesirable) -# strategy: -# matrix: -# Linux_amd64: -# vmImage: 'ubuntu-24.04' -# CPU: amd64 -# # regularly breaks, refs bug #17325 -# # Linux_i386: -# # # on 'ubuntu-16.04' (not supported anymore anyways) it errored with: -# # # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed -# # vmImage: 'ubuntu-18.04' -# # CPU: i386 -# OSX_arm64: -# vmImage: 'macos-15' -# CPU: arm64 -# OSX_arm64_cpp: -# vmImage: 'macos-15' -# CPU: arm64 -# NIM_COMPILE_TO_CPP: true -# Windows_amd64_batch0_3: -# vmImage: 'windows-2025' -# CPU: amd64 -# # see also: `NIM_TEST_PACKAGES` -# NIM_TESTAMENT_BATCH: "0_3" -# Windows_amd64_batch1_3: -# vmImage: 'windows-2025' -# CPU: amd64 -# NIM_TESTAMENT_BATCH: "1_3" -# Windows_amd64_batch2_3: -# vmImage: 'windows-2025' -# CPU: amd64 -# NIM_TESTAMENT_BATCH: "2_3" + strategy: + matrix: + Linux_amd64: + vmImage: 'ubuntu-24.04' + CPU: amd64 + # regularly breaks, refs bug #17325 +# Linux_i386: +# # on 'ubuntu-16.04' (not supported anymore anyways) it errored with: +# # g++-multilib : Depends: gcc-multilib (>= 4:5.3.1-1ubuntu1) but it is not going to be installed +# vmImage: 'ubuntu-18.04' +# CPU: i386 + OSX_arm64: + vmImage: 'macos-15' + CPU: arm64 + OSX_arm64_cpp: + vmImage: 'macos-15' + CPU: arm64 + NIM_COMPILE_TO_CPP: true + Windows_amd64_batch0_3: + vmImage: 'windows-2025' + CPU: amd64 + # see also: `NIM_TEST_PACKAGES` + NIM_TESTAMENT_BATCH: "0_3" + Windows_amd64_batch1_3: + vmImage: 'windows-2025' + CPU: amd64 + NIM_TESTAMENT_BATCH: "1_3" + Windows_amd64_batch2_3: + vmImage: 'windows-2025' + CPU: amd64 + NIM_TESTAMENT_BATCH: "2_3" -# pool: -# vmImage: $(vmImage) + pool: + vmImage: $(vmImage) -# workspace: -# clean: all + workspace: + clean: all -# steps: -# - bash: git config --global core.autocrlf false -# displayName: 'Disable auto conversion to CRLF by git (Windows-only)' -# condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) + steps: + - bash: git config --global core.autocrlf false + displayName: 'Disable auto conversion to CRLF by git (Windows-only)' + condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) -# - checkout: self -# fetchDepth: 2 # see D20210329T004830 + - checkout: self + fetchDepth: 2 # see D20210329T004830 -# - bash: | -# set -e -# . ci/funs.sh -# if nimIsCiSkip; then -# echo '##vso[task.setvariable variable=skipci]true' -# fi -# displayName: 'Check whether to skip CI' + - bash: | + set -e + . ci/funs.sh + if nimIsCiSkip; then + echo '##vso[task.setvariable variable=skipci]true' + fi + displayName: 'Check whether to skip CI' -# - task: NodeTool@0 -# inputs: -# versionSpec: '20.x' -# displayName: 'Install node.js 20.x' -# condition: and(succeeded(), eq(variables['skipci'], 'false')) + - task: NodeTool@0 + inputs: + versionSpec: '20.x' + displayName: 'Install node.js 20.x' + condition: and(succeeded(), eq(variables['skipci'], 'false')) -# - bash: | -# set -e -# . ci/funs.sh -# echo_run sudo add-apt-repository universe -# echo_run sudo apt-get update -qq -# DEBIAN_FRONTEND='noninteractive' \ -# echo_run sudo apt-get install --no-install-recommends -yq \ -# gcc-14 g++-14 libpcre3 liblapack-dev libpcre3 liblapack-dev libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg -# echo_run sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 --slave /usr/bin/g++ g++ /usr/bin/g++-14 -# displayName: 'Install dependencies (amd64 Linux)' -# condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64')) + - bash: | + set -e + . ci/funs.sh + echo_run sudo add-apt-repository universe + echo_run sudo apt-get update -qq + DEBIAN_FRONTEND='noninteractive' \ + echo_run sudo apt-get install --no-install-recommends -yq \ + gcc-14 g++-14 libpcre3 liblapack-dev libpcre3 liblapack-dev libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg + echo_run sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 60 --slave /usr/bin/g++ g++ /usr/bin/g++-14 + displayName: 'Install dependencies (amd64 Linux)' + condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64')) -# - bash: | -# set -e -# . ci/funs.sh -# echo_run sudo dpkg --add-architecture i386 -# # Downgrade llvm: -# # - llvm has to be downgraded to have 32bit version installed for sfml. + - bash: | + set -e + . ci/funs.sh + echo_run sudo dpkg --add-architecture i386 + # Downgrade llvm: + # - llvm has to be downgraded to have 32bit version installed for sfml. -# cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel -# Package: libllvm6.0 -# Pin: origin "azure.archive.ubuntu.com" -# Pin-Priority: 1001 -# EOF + cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel + Package: libllvm6.0 + Pin: origin "azure.archive.ubuntu.com" + Pin-Priority: 1001 + EOF -# # echo_run sudo apt-get update -qq -# echo_run sudo apt-get update -qq || echo "failed, see bug #17343" -# # `:i386` (e.g. in `libffi-dev:i386`) is needed otherwise you may get: -# # `could not load: libffi.so` during dynamic loading. -# DEBIAN_FRONTEND='noninteractive' \ -# echo_run sudo apt-get install --no-install-recommends --allow-downgrades -yq \ -# g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \ -# libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386 libffi-dev:i386 + # echo_run sudo apt-get update -qq + echo_run sudo apt-get update -qq || echo "failed, see bug #17343" + # `:i386` (e.g. in `libffi-dev:i386`) is needed otherwise you may get: + # `could not load: libffi.so` during dynamic loading. + DEBIAN_FRONTEND='noninteractive' \ + echo_run sudo apt-get install --no-install-recommends --allow-downgrades -yq \ + g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \ + libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386 libffi-dev:i386 -# cat << EOF > bin/gcc -# #!/bin/bash + cat << EOF > bin/gcc + #!/bin/bash -# exec $(which gcc) -m32 "\$@" -# EOF + exec $(which gcc) -m32 "\$@" + EOF -# cat << EOF > bin/g++ -# #!/bin/bash + cat << EOF > bin/g++ + #!/bin/bash -# exec $(which g++) -m32 "\$@" -# EOF + exec $(which g++) -m32 "\$@" + EOF -# echo_run chmod 755 bin/gcc -# echo_run chmod 755 bin/g++ + echo_run chmod 755 bin/gcc + echo_run chmod 755 bin/g++ -# displayName: 'Install dependencies (i386 Linux)' -# condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386')) + displayName: 'Install dependencies (i386 Linux)' + condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386')) -# - bash: brew install boehmgc make sfml -# displayName: 'Install dependencies (OSX)' -# condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Darwin')) -# # XXX can't find boehm on macos 13 + - bash: brew install boehmgc make sfml + displayName: 'Install dependencies (OSX)' + condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Darwin')) + # XXX can't find boehm on macos 13 -# - bash: | -# set -e -# . ci/funs.sh -# nimInternalInstallDepsWindows -# echo_run echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin' + - bash: | + set -e + . ci/funs.sh + nimInternalInstallDepsWindows + echo_run echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin' -# displayName: 'Install dependencies (Windows)' -# condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Windows_NT')) + displayName: 'Install dependencies (Windows)' + condition: and(succeeded(), eq(variables['skipci'], 'false'), eq(variables['Agent.OS'], 'Windows_NT')) -# - bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin' -# condition: and(succeeded(), eq(variables['skipci'], 'false')) -# displayName: 'Add build binaries to PATH' + - bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin' + condition: and(succeeded(), eq(variables['skipci'], 'false')) + displayName: 'Add build binaries to PATH' -# - bash: . ci/funs.sh && nimCiSystemInfo -# condition: and(succeeded(), eq(variables['skipci'], 'false')) -# displayName: 'System information' + - bash: . ci/funs.sh && nimCiSystemInfo + condition: and(succeeded(), eq(variables['skipci'], 'false')) + displayName: 'System information' -# - bash: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu=$(CPU) -# condition: and(succeeded(), eq(variables['skipci'], 'false')) -# displayName: 'Build csourcesAny' + - bash: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu=$(CPU) + condition: and(succeeded(), eq(variables['skipci'], 'false')) + displayName: 'Build csourcesAny' -# # this could be revived if performance justifies it (needs a few updates) -# # - task: Cache@2 -# # inputs: -# # key: 'csourcesAny | "$(Agent.OS)" | $(CPU) | $(csources_version)' -# # path: $(nim_csources) -# # condition: and(succeeded(), eq(variables['skipci'], 'false')) -# # displayName: 'Restore built csourcesAny' + # this could be revived if performance justifies it (needs a few updates) + # - task: Cache@2 + # inputs: + # key: 'csourcesAny | "$(Agent.OS)" | $(CPU) | $(csources_version)' + # path: $(nim_csources) + # condition: and(succeeded(), eq(variables['skipci'], 'false')) + # displayName: 'Restore built csourcesAny' -# - bash: . ci/funs.sh && nimInternalBuildKochAndRunCI -# # would could also show on failure: echo '##vso[task.complete result=Failed]' -# condition: and(succeeded(), eq(variables['skipci'], 'false')) -# displayName: 'koch, Run CI' -# env: -# SYSTEM_ACCESSTOKEN: $(System.AccessToken) + - bash: . ci/funs.sh && nimInternalBuildKochAndRunCI + # would could also show on failure: echo '##vso[task.complete result=Failed]' + condition: and(succeeded(), eq(variables['skipci'], 'false')) + displayName: 'koch, Run CI' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken)