diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml deleted file mode 100644 index 6898a80fdc661..0000000000000 --- a/.builds/freebsd.yml +++ /dev/null @@ -1,31 +0,0 @@ -# see https://man.sr.ht/builds.sr.ht/compatibility.md#freebsd -image: freebsd/latest -packages: -- databases/sqlite3 -- devel/boehm-gc-threaded -- devel/pcre -- devel/sdl20 -- devel/sfml -- www/node -- devel/gmake -sources: -- https://github.com/nim-lang/Nim -environment: - CC: /usr/bin/clang -tasks: -- setup: | - cd Nim - git clone --depth 1 -q https://github.com/nim-lang/csources.git - gmake -C csources -j $(sysctl -n hw.ncpu) - bin/nim c --skipUserCfg --skipParentCfg koch - echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv -- test: | - cd Nim - if ! ./koch runCI; then - nim c -r tools/ci_testresults.nim - exit 1 - fi -triggers: -- action: email - condition: failure - to: Andreas Rumpf diff --git a/.builds/openbsd_0.yml b/.builds/openbsd_0.yml deleted file mode 100644 index 146ad81657bcd..0000000000000 --- a/.builds/openbsd_0.yml +++ /dev/null @@ -1,34 +0,0 @@ -## do not edit directly; auto-generated by `nim r tools/ci_generate.nim` - -image: openbsd/latest -packages: -- gmake -- sqlite3 -- node -- boehm-gc -- pcre -- sfml -- sdl2 -- libffi -sources: -- https://github.com/nim-lang/Nim -environment: - NIM_TESTAMENT_BATCH: "0_2" - CC: /usr/bin/clang -tasks: -- setup: | - cd Nim - git clone --depth 1 -q https://github.com/nim-lang/csources.git - gmake -C csources -j $(sysctl -n hw.ncpuonline) - bin/nim c koch - echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv -- test: | - cd Nim - if ! ./koch runCI; then - nim c -r tools/ci_testresults.nim - exit 1 - fi -triggers: -- action: email - condition: failure - to: Andreas Rumpf diff --git a/.builds/openbsd_1.yml b/.builds/openbsd_1.yml deleted file mode 100644 index ad373400835d2..0000000000000 --- a/.builds/openbsd_1.yml +++ /dev/null @@ -1,34 +0,0 @@ -## do not edit directly; auto-generated by `nim r tools/ci_generate.nim` - -image: openbsd/latest -packages: -- gmake -- sqlite3 -- node -- boehm-gc -- pcre -- sfml -- sdl2 -- libffi -sources: -- https://github.com/nim-lang/Nim -environment: - NIM_TESTAMENT_BATCH: "1_2" - CC: /usr/bin/clang -tasks: -- setup: | - cd Nim - git clone --depth 1 -q https://github.com/nim-lang/csources.git - gmake -C csources -j $(sysctl -n hw.ncpuonline) - bin/nim c koch - echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv -- test: | - cd Nim - if ! ./koch runCI; then - nim c -r tools/ci_testresults.nim - exit 1 - fi -triggers: -- action: email - condition: failure - to: Andreas Rumpf diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml deleted file mode 100644 index 22d425b103c18..0000000000000 --- a/.github/workflows/ci_docs.yml +++ /dev/null @@ -1,141 +0,0 @@ -name: Nim Docs CI -on: - push: - paths: - - 'compiler/docgen.nim' - - 'compiler/renderverbatim.nim' - - 'config/nimdoc.cfg' - - 'doc/**.rst' - - '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/docgen.nim' - - 'compiler/renderverbatim.nim' - - 'config/nimdoc.cfg' - - 'doc/**.rst' - - 'doc/nimdoc.css' - - 'lib/**.nim' - - 'nimdoc/testproject/expected/testproject.html' - - 'tools/dochack/dochack.nim' - - 'tools/kochdocs.nim' - - '.github/workflows/ci_docs.yml' - - 'koch.nim' - -jobs: - build: - if: | - !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]') - strategy: - fail-fast: false - matrix: - target: [linux, windows, osx] - include: - - target: linux - os: ubuntu-18.04 - - target: windows - os: windows-2019 - - target: osx - os: macos-10.15 - - name: ${{ matrix.target }} - runs-on: ${{ matrix.os }} - - steps: - - name: 'Checkout' - uses: actions/checkout@v2 - - - 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: | - mkdir dist - curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z - curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip - 7z x dist/mingw64.7z -odist - 7z x dist/dlls.zip -obin - echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" - - - name: 'Add build binaries to PATH' - shell: bash - run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" - - - name: 'Get current csources version' - id: csources-version - shell: bash - run: | - sha=$(git ls-remote https://github.com/nim-lang/csources master | cut -f 1) - echo "::set-output name=sha::$sha" - - - name: 'Get prebuilt csources from cache' - id: csources-cache - uses: actions/cache@v1 - with: - path: bin - key: '${{ matrix.os }}-${{ steps.csources-version.outputs.sha }}' - - - name: 'Checkout csources' - if: steps.csources-cache.outputs.cache-hit != 'true' - uses: actions/checkout@v2 - with: - repository: nim-lang/csources - path: csources - - - name: 'Build 1-stage compiler from csources' - shell: bash - run: | - ext= - [[ '${{ runner.os }}' == 'Windows' ]] && ext=.exe - if [[ ! -x bin/nim-csources$ext ]]; then - ncpu= - case '${{ runner.os }}' in - 'Linux') - ncpu=$(nproc) - ;; - 'macOS') - ncpu=$(sysctl -n hw.ncpu) - ;; - 'Windows') - ncpu=$NUMBER_OF_PROCESSORS - ;; - esac - [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 - - make -C csources -j $ncpu CC=gcc - cp bin/nim{,-csources}$ext - else - echo 'Cache hit, using prebuilt csources' - cp bin/nim{-csources,}$ext - fi - - - name: 'Build koch' - shell: bash - run: nim c koch - - - name: 'Build the real compiler' - shell: bash - run: ./koch boot -d:release - - - 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@v1 - with: - build_dir: doc/html - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci_packages.yml b/.github/workflows/ci_packages.yml deleted file mode 100644 index dd42db0c46198..0000000000000 --- a/.github/workflows/ci_packages.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Packages CI -on: [push, pull_request] - -jobs: - build: - if: | - !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]') - strategy: - fail-fast: false - matrix: - os: [ubuntu-18.04, macos-10.15] - cpu: [amd64] - batch: ["0_3", "1_3", "2_3"] # list of `index_num` - name: '${{ matrix.os }} (batch: ${{ matrix.batch }})' - runs-on: ${{ matrix.os }} - env: - NIM_TEST_PACKAGES: "1" - NIM_TESTAMENT_BATCH: ${{ matrix.batch }} - steps: - - name: 'Checkout' - uses: actions/checkout@v2 - - name: 'Checkout csources' - uses: actions/checkout@v2 - with: - repository: nim-lang/csources - path: csources - - - name: 'Install node.js 12.x' - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - 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 (macOS)' - if: runner.os == 'macOS' - run: brew install boehmgc make sfml gtk+3 - - name: 'Install dependencies (Windows)' - if: runner.os == 'Windows' - shell: bash - run: | - mkdir dist - curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z - curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip - 7z x dist/mingw64.7z -odist - 7z x dist/dlls.zip -obin - echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" - - - name: 'Add build binaries to PATH' - shell: bash - run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" - - - name: 'Build csources' - shell: bash - run: | - ncpu= - case '${{ runner.os }}' in - 'Linux') - ncpu=$(nproc) - ;; - 'macOS') - ncpu=$(sysctl -n hw.ncpu) - ;; - 'Windows') - ncpu=$NUMBER_OF_PROCESSORS - ;; - esac - [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 - - make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.cpu }}' - - name: 'Build koch' - shell: bash - run: nim c koch - - name: 'Run CI' - shell: bash - run: ./koch runCI - - - name: 'Show failed tests' - if: failure() - shell: bash - run: nim c -r tools/ci_testresults.nim diff --git a/.github/workflows/docker.yml.disabled b/.github/workflows/docker.yml.disabled new file mode 100644 index 0000000000000..971b056132468 --- /dev/null +++ b/.github/workflows/docker.yml.disabled @@ -0,0 +1,128 @@ +name: Nim docker CI +on: [push, pull_request] + +jobs: + container: + runs-on: ubuntu-latest + # container: node:10.16-jessie + # container: ubuntu:18.04 + container: i386/ubuntu:18.04 + steps: + + # - name: 'Checkout' + # uses: actions/checkout@v2 + + # - name: 'Checkout csources' + # uses: actions/checkout@v2 + # with: + # repository: nim-lang/csources + # path: csources + + # - name: 'Install node.js 12.x' + # uses: actions/setup-node@v1 + # with: + # node-version: '12.x' + + - run: | + apt-get update -qq + apt-get install -yqq software-properties-common + add-apt-repository -yqq ppa:git-core/ppa + apt-get update -qq + apt-get install -yqq cmake make gcc g++ git curl + pwd + ls + # git clone + name: Run in container + + - uses: actions/checkout@v2 + + # vm: + # runs-on: ubuntu-latest + # steps: + # - run: | + # echo This job does not specify a container. + # echo It runs directly on the virtual machine. + # name: Run on VM + + # build: + # if: | + # !contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[skip ci]') + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-18.04, macos-10.15] + # cpu: [amd64] + # batch: ["0_3", "1_3", "2_3"] # list of `index_num` + # name: '${{ matrix.os }} (batch: ${{ matrix.batch }})' + # runs-on: ${{ matrix.os }} + # env: + # NIM_TEST_PACKAGES: "1" + # NIM_TESTAMENT_BATCH: ${{ matrix.batch }} + # steps: + # - name: 'Checkout' + # uses: actions/checkout@v2 + # - name: 'Checkout csources' + # uses: actions/checkout@v2 + # with: + # repository: nim-lang/csources + # path: csources + + # - name: 'Install node.js 12.x' + # uses: actions/setup-node@v1 + # with: + # node-version: '12.x' + # - 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 (macOS)' + # if: runner.os == 'macOS' + # run: brew install boehmgc make sfml gtk+3 + # - name: 'Install dependencies (Windows)' + # if: runner.os == 'Windows' + # shell: bash + # run: | + # mkdir dist + # curl -L https://nim-lang.org/download/mingw64.7z -o dist/mingw64.7z + # curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip + # 7z x dist/mingw64.7z -odist + # 7z x dist/dlls.zip -obin + # echo "${{ github.workspace }}/dist/mingw64/bin" >> "${GITHUB_PATH}" + + # - name: 'Add build binaries to PATH' + # shell: bash + # run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}" + + # - name: 'Build csources' + # shell: bash + # run: | + # ncpu= + # case '${{ runner.os }}' in + # 'Linux') + # ncpu=$(nproc) + # ;; + # 'macOS') + # ncpu=$(sysctl -n hw.ncpu) + # ;; + # 'Windows') + # ncpu=$NUMBER_OF_PROCESSORS + # ;; + # esac + # [[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1 + + # make -C csources -j $ncpu CC=gcc ucpu='${{ matrix.cpu }}' + # - name: 'Build koch' + # shell: bash + # run: nim c koch + # - name: 'Run CI' + # shell: bash + # run: ./koch runCI + + # - name: 'Show failed tests' + # if: failure() + # shell: bash + # run: nim c -r tools/ci_testresults.nim diff --git a/.github/workflows/docker2.yml b/.github/workflows/docker2.yml new file mode 100644 index 0000000000000..6453d11aac39f --- /dev/null +++ b/.github/workflows/docker2.yml @@ -0,0 +1,63 @@ +on: [push] + +jobs: + hello_world_job: + runs-on: ubuntu-latest + name: A job to say hello + steps: + # To use this repository's private action, + # you must check out the repository + - name: Checkout + uses: actions/checkout@v2 + - name: Hello world action step v2 + uses: ./ # Uses an action in the root directory + # runs: + # using: 'docker' + # image: 'ci.Dockerfile' + id: hello + with: + who-to-greet: 'Mona the Octocat' + # Use the output from the `hello` step + # - name: Get the output time + # run: echo "The time was ${{ steps.hello.outputs.time }}" + + +# name: Nim docker2 CI +# # on: [push, pull_request] +# on: [pull_request] + +# jobs: +# docker-example: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: Run box version +# #uses: docker://foundeo/minibox:latest +# uses: docker://i386/ubuntu:18.04 +# #container: i386/ubuntu:18.04 +# with: +# entrypoint: /opt/box/box +# args: version +# # - name: What OS is running +# # run: uname -a +# # - name: What java version do we have +# # run: java -version + + + +# # # action.yml +# # # on: pull_request +# # description: 'Greet someone and record the time' +# # inputs: +# # who-to-greet: # id of input +# # description: 'Who to greet' +# # required: true +# # default: 'World' +# # outputs: +# # time: # id of output +# # description: 'The time we greeted you' +# # runs: +# # using: 'docker' +# # image: 'Dockerfile' +# # args: +# # - ${{ inputs.who-to-greet }} diff --git a/action.yml b/action.yml new file mode 100644 index 0000000000000..303bc5161988e --- /dev/null +++ b/action.yml @@ -0,0 +1,16 @@ +# action.yml +name: 'Hello World' +description: 'Greet someone and record the time' +inputs: + who-to-greet: # id of input + description: 'Who to greet' + required: true + default: 'World' +outputs: + time: # id of output + description: 'The time we greeted you' +runs: + using: 'docker' + image: 'ci.Dockerfile' + args: + - ${{ inputs.who-to-greet }} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9006cf6e50cd8..1717ac555b2d2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,38 +14,20 @@ jobs: strategy: matrix: - Linux_amd64: - vmImage: 'ubuntu-16.04' - CPU: amd64 Linux_i386: # bug #17325: fails on 'ubuntu-16.04' because it now errors 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_amd64: - vmImage: 'macOS-10.15' - CPU: amd64 - OSX_amd64_cpp: - vmImage: 'macOS-10.15' - CPU: amd64 - NIM_COMPILE_TO_CPP: true - Windows_amd64_batch0_3: - vmImage: 'windows-2019' - CPU: amd64 - # see also: `NIM_TEST_PACKAGES` - NIM_TESTAMENT_BATCH: "0_3" - Windows_amd64_batch1_3: - vmImage: 'windows-2019' - CPU: amd64 - NIM_TESTAMENT_BATCH: "1_3" - Windows_amd64_batch2_3: - vmImage: 'windows-2019' - CPU: amd64 - NIM_TESTAMENT_BATCH: "2_3" pool: vmImage: $(vmImage) + container: ubuntu:18.04 + # container: i386/ubuntu + # docker run --rm -it arm32v7/ubuntu:18.04 bash + # container: i386/ubuntu:18.04 + workspace: clean: all @@ -57,7 +39,23 @@ jobs: - checkout: self fetchDepth: 1 - - bash: git clone --depth 1 https://github.com/nim-lang/csources + - run: | + apt-get update + apt-get install -y software-properties-common + apt-get install -y git + + - bash: | + . ci/funs.sh + set +e + echo_run apt update + echo_run apt-get update + echo_run apt install git + echo_run apt-get install git + echo_run sudo apt install git + echo_run sudo apt-get install git + echo_run whoami + echo_run pwd + echo_run git clone --depth 1 https://github.com/nim-lang/csources displayName: 'Checkout Nim csources' - task: NodeTool@0 @@ -76,24 +74,21 @@ jobs: condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64')) - bash: | - set -e + 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 - - # echo_run sudo apt-fast update -qq - echo_run sudo apt-fast update -qq || echo "failed, see bug #17343" + # echo_run dpkg --add-architecture i386 + # echo_run apt-fast update -qq + echo_run apt update + # echo_run apt-fast 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-fast install --no-install-recommends --allow-downgrades -yq \ + + export DEBIAN_FRONTEND='noninteractive' + echo_run apt install --no-install-recommends --allow-downgrades -y \ + 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 apt 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 diff --git a/build_all.sh b/build_all.sh index e66980e569a44..1cbbd7d7e193d 100755 --- a/build_all.sh +++ b/build_all.sh @@ -17,16 +17,21 @@ nim_csources=bin/nim_csources build_nim_csources_via_script(){ echo_run cd csources + echo "D20210317T004050" + echo "$@" echo_run sh build.sh "$@" } build_nim_csources(){ # avoid changing dir in case of failure ( + echo_run echo "ok1" if [ $# -ne 0 ]; then # some args were passed (e.g.: `--cpu i386`), need to call build.sh + echo_run echo "ok2" build_nim_csources_via_script "$@" else + echo_run echo "ok3" # no args, use multiple Make jobs (5X faster on 16 cores: 10s instead of 50s) makeX=make unamestr=$(uname) diff --git a/ci.Dockerfile b/ci.Dockerfile new file mode 100644 index 0000000000000..0ec6e3946e66e --- /dev/null +++ b/ci.Dockerfile @@ -0,0 +1,4 @@ +# FROM alpine:3.10 +FROM i386/ubuntu:18.04 +ENTRYPOINT sh ci/dockerrun.sh + diff --git a/ci/dockerrun.sh b/ci/dockerrun.sh new file mode 100644 index 0000000000000..fb5ac86dafa5c --- /dev/null +++ b/ci/dockerrun.sh @@ -0,0 +1,11 @@ +set -e +. ci/funs.sh +echo_run apt-get update +echo_run apt-get install -y software-properties-common +echo_run add-apt-repository -y ppa:git-core/ppa +echo_run apt-get update +echo_run apt-get install -yq cmake make gcc g++ git curl + +# export CPU=i386 +echo_run sh build_all.sh --cpu i386 +echo_run ./koch runCI