From f376d04dc81695c3fff621eb3ec50c16937932e7 Mon Sep 17 00:00:00 2001 From: acarioni Date: Tue, 25 Jun 2024 11:30:49 +0200 Subject: [PATCH 01/13] add compiler flag to enable c++17 support (#1116) --- toolchain/linux-toolchain.xml | 3 ++- toolchain/mac-toolchain.xml | 8 +++++--- toolchain/msvc-toolchain.xml | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/toolchain/linux-toolchain.xml b/toolchain/linux-toolchain.xml index dd7271c65..ed0880532 100644 --- a/toolchain/linux-toolchain.xml +++ b/toolchain/linux-toolchain.xml @@ -26,7 +26,7 @@ - + @@ -41,6 +41,7 @@ + diff --git a/toolchain/mac-toolchain.xml b/toolchain/mac-toolchain.xml index 907c2270a..c8e0f760d 100644 --- a/toolchain/mac-toolchain.xml +++ b/toolchain/mac-toolchain.xml @@ -2,17 +2,17 @@ - + - + - +
@@ -29,6 +29,8 @@ + + diff --git a/toolchain/msvc-toolchain.xml b/toolchain/msvc-toolchain.xml index 6a041a99c..26c7a826c 100644 --- a/toolchain/msvc-toolchain.xml +++ b/toolchain/msvc-toolchain.xml @@ -69,6 +69,7 @@ + From fcfca292ea0f1f0cbe0cfc324a8f499c039caf11 Mon Sep 17 00:00:00 2001 From: Aidan Lee Date: Tue, 25 Jun 2024 12:57:21 +0100 Subject: [PATCH 02/13] GitHub CI (#1106) * test github ci * pass through haxe version * Use macos-13 * better matrix config * fancier test matrix * revert fancier matrix change * Basic hxcpp setup * First haxe test attempt * cffi tests attempt * Fix debug flag for build.xml based compile * Fix all defines for build.xml based compile * Remove bash specific command * Try excluding macos from 32bits * More tests * Fix std tests * Fix differing output folder for std tests * haxe unit test * Use git switch * Try removing the escaping * Use checkout action * try sub jobs * comment out unimplemented jobs * Fully qualify working directory * try actual relative paths * try explicit working directory for all steps * try composite action * try hopefully correct composite action * cant have checkout in the setup action * Fix wrong path * Fix wrong path (again...) * Specify shell * Fix some old copy paths * explicit hxcpp path to composite action * Install gcc on linux * custom names * lets try pwsh * Do bring back the native lib stage though * More custom names * Do cffi copy on 32bit as well * build neko on 32bit as well * try a matrix telemetry * Remember setup guff * Add more test jobs * flip around cppia file name * add haxe tests suite job * Restore other ci jobs * Goodbye azure pipelines * Try splitting up into OS specific jobs * change naming again * Remove now un-needed intermediate workflow * add arch define to cffi hxml calls * Don't fail fast * Add pull request trigger * unmask mysql service * Move packaging stuff into independent yml file * limit packaging to master instead of tags * relax packaging requirements as a test * specify prs as well for the test * restrict packaging to master * Use setup-haxe fork and try macos-latest --- .github/workflows/main.yml | 221 ++++++----------- .github/workflows/package.yml | 148 +++++++++++ .github/workflows/setup/action.yml | 35 +++ .github/workflows/test.yml | 230 ++++++++++++++++++ azure-pipelines.yml | 42 ---- tools/azure-pipelines/build.yml | 160 ------------ .../install-haxe-snapshot.yaml | 31 --- .../install-neko-snapshot.yaml | 33 --- 8 files changed, 486 insertions(+), 414 deletions(-) mode change 100755 => 100644 .github/workflows/main.yml create mode 100644 .github/workflows/package.yml create mode 100644 .github/workflows/setup/action.yml create mode 100644 .github/workflows/test.yml delete mode 100644 azure-pipelines.yml delete mode 100644 tools/azure-pipelines/install-haxe-snapshot.yaml delete mode 100644 tools/azure-pipelines/install-neko-snapshot.yaml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml old mode 100755 new mode 100644 index 6f3658602..594fb4c00 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,148 +1,73 @@ -name: CI -on: [push] - -jobs: - build_matrix: - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: krdlab/setup-haxe@v1 - with: - haxe-version: 4.3.0 - - - name: Set Haxelib - run: | - haxe -version - haxelib dev hxcpp . - - - name: Set Version - run: haxe -cp tools/version --run Write ${{github.run_number}} > version.env - - - - name: Build Tool - run: | - cd tools/hxcpp - haxe compile.hxml - - - - name: Check XCode - if: startsWith(matrix.os,'macos') - run: xcode-select -p - - - name: Build Cppia - run: | - cd project - haxe compile-cppia.hxml -D HXCPP_M64 - - - name: Clean Project - if: startsWith(matrix.os,'ubuntu') - run: | - rm -rf project/cppia_bin - - - name: Archive Linux Results - if: startsWith(matrix.os,'ubuntu') - uses: actions/upload-artifact@v3 - with: - name: linux-64 - path: | - bin/Linux64/Cppia - tools - toolchain - version.env - src - run.n - include - hxcpp.n - haxelib.json - Changes.md - hxcpp - test - docs - project - README.md - build-tool - java - haxelib.xml - LICENSE.txt - - - name: Archive Windows Results - if: startsWith(matrix.os,'windows') - uses: actions/upload-artifact@v3 - with: - name: windows-64 - path: | - bin/Windows64/Cppia.exe - - - name: Archive Mac Results - if: startsWith(matrix.os,'macos') - uses: actions/upload-artifact@v3 - with: - name: mac-64 - path: | - bin/Mac64/Cppia - release: - name: Release - needs: build_matrix - runs-on: ubuntu-latest - steps: - - name: Download Linux - uses: actions/download-artifact@v3 - with: - name: linux-64 - path: hxcpp - - - name: Download Mac - uses: actions/download-artifact@v3 - with: - name: mac-64 - path: hxcpp/bin/Mac64/ - - - name: Download Windows - uses: actions/download-artifact@v3 - with: - name: windows-64 - path: hxcpp/bin/Windows64/ - - - name: List Files - run: ls -R - - - name: Get Version - run: | - cat hxcpp/version.env - cat hxcpp/version.env >> $GITHUB_ENV - rm hxcpp/version.env - - - name: Zip release - run: | - mv hxcpp hxcpp-${{ env.hxcpp_release }} - zip -r hxcpp-${{ env.hxcpp_release }}.zip hxcpp-${{ env.hxcpp_release }} - - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ env.hxcpp_release }} - release_name: Release ${{ env.hxcpp_release }} - draft: false - prerelease: false - - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./hxcpp-${{ env.hxcpp_release }}.zip - asset_name: hxcpp-${{ env.hxcpp_release }}.zip - asset_content_type: application/zip - - - +name: main +on: [push, pull_request] + +jobs: + Windows32: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.4, latest ] + uses: ./.github/workflows/test.yml + name: Test Windows (32bit) + with: + haxe: ${{ matrix.haxe }} + arch: 32 + sep: \ + ext: .dll + os: windows-latest + + Windows64: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.4, latest ] + uses: ./.github/workflows/test.yml + name: Test Windows (64bit) + with: + haxe: ${{ matrix.haxe }} + arch: 64 + sep: \ + ext: .dll + os: windows-latest + + MacOS: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.4, latest ] + uses: ./.github/workflows/test.yml + name: Test MacOS + with: + haxe: ${{ matrix.haxe }} + arch: 64 + sep: / + ext: .dylib + os: macos-latest + + Linux32: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.4, latest ] + uses: ./.github/workflows/test.yml + name: Test Linux (32bit) + with: + haxe: ${{ matrix.haxe }} + arch: 32 + sep: / + ext: .dso + os: ubuntu-latest + + Linux64: + strategy: + fail-fast: false + matrix: + haxe: [ 4.3.4, latest ] + uses: ./.github/workflows/test.yml + name: Test Linux (64bit) + with: + haxe: ${{ matrix.haxe }} + arch: 64 + sep: / + ext: .dso + os: ubuntu-latest \ No newline at end of file diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 000000000..d2bface2f --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,148 @@ +name: package +on: + push: + branches: [master] + +jobs: + Package: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: Aidan63/setup-haxe@e4b347bc45596200a68804b232be9d73f80868a6 + with: + haxe-version: 4.3.4 + + - name: Set Haxelib + run: | + haxe -version + haxelib dev hxcpp . + + - name: Set Version + run: haxe -cp tools/version --run Write ${{github.run_number}} > version.env + + + - name: Build Tool + run: | + cd tools/hxcpp + haxe compile.hxml + + + - name: Check XCode + if: startsWith(matrix.os,'macos') + run: xcode-select -p + + - name: Build Cppia + run: | + cd project + haxe compile-cppia.hxml -D HXCPP_M64 + + - name: Clean Project + if: startsWith(matrix.os,'ubuntu') + run: | + rm -rf project/cppia_bin + + - name: Archive Linux Results + if: startsWith(matrix.os,'ubuntu') + uses: actions/upload-artifact@v3 + with: + name: linux-64 + path: | + bin/Linux64/Cppia + tools + toolchain + version.env + src + run.n + include + hxcpp.n + haxelib.json + Changes.md + hxcpp + test + docs + project + README.md + build-tool + java + haxelib.xml + LICENSE.txt + + - name: Archive Windows Results + if: startsWith(matrix.os,'windows') + uses: actions/upload-artifact@v3 + with: + name: windows-64 + path: | + bin/Windows64/Cppia.exe + + - name: Archive Mac Results + if: startsWith(matrix.os,'macos') + uses: actions/upload-artifact@v3 + with: + name: mac-64 + path: | + bin/Mac64/Cppia + + Release: + needs: Package + runs-on: ubuntu-latest + steps: + - name: Download Linux + uses: actions/download-artifact@v3 + with: + name: linux-64 + path: hxcpp + + - name: Download Mac + uses: actions/download-artifact@v3 + with: + name: mac-64 + path: hxcpp/bin/Mac64/ + + - name: Download Windows + uses: actions/download-artifact@v3 + with: + name: windows-64 + path: hxcpp/bin/Windows64/ + + - name: List Files + run: ls -R + + - name: Get Version + run: | + cat hxcpp/version.env + cat hxcpp/version.env >> $GITHUB_ENV + rm hxcpp/version.env + + - name: Zip release + run: | + mv hxcpp hxcpp-${{ env.hxcpp_release }} + zip -r hxcpp-${{ env.hxcpp_release }}.zip hxcpp-${{ env.hxcpp_release }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ env.hxcpp_release }} + release_name: Release ${{ env.hxcpp_release }} + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./hxcpp-${{ env.hxcpp_release }}.zip + asset_name: hxcpp-${{ env.hxcpp_release }}.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/.github/workflows/setup/action.yml b/.github/workflows/setup/action.yml new file mode 100644 index 000000000..01f2c6b47 --- /dev/null +++ b/.github/workflows/setup/action.yml @@ -0,0 +1,35 @@ +name: setup +inputs: + haxe: + required: true + type: string +runs: + using: composite + steps: + - name: install haxe + uses: Aidan63/setup-haxe@e4b347bc45596200a68804b232be9d73f80868a6 + with: + haxe-version: ${{ inputs.haxe }} + + - name: install haxe libraries + shell: pwsh + run: | + haxelib install utest + haxelib git hx4compat https://github.com/HaxeFoundation/hx4compat + haxelib dev hxcpp ${{ github.workspace }} + haxelib list + + - name: install native libraries + if: runner.os == 'Linux' + shell: pwsh + run: sudo apt-get install -qqy gcc-multilib g++-multilib + + - name: build run.n + working-directory: tools/run + shell: pwsh + run: haxe compile.hxml + + - name: build hxcpp + working-directory: tools/hxcpp + shell: pwsh + run: haxe compile.hxml \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..da7c478cd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,230 @@ +name: test +on: + workflow_call: + inputs: + haxe: + required: true + type: string + arch: + required: true + type: string + sep: + required: true + type: string + ext: + required: true + type: string + os: + required: true + type: string + +jobs: + haxe: + runs-on: ${{ inputs.os }} + name: haxe + defaults: + run: + working-directory: test/haxe + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: build + run: haxe compile.hxml --debug -D HXCPP_M${{ inputs.arch }} + - name: run + run: bin${{ inputs.sep }}TestMain-debug + + cffi: + runs-on: ${{ inputs.os }} + name: cffi + defaults: + run: + working-directory: test/cffi + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: build project + working-directory: test/cffi/project + run: haxelib run hxcpp build.xml -Ddebug -DHXCPP_M${{ inputs.arch }} + - name: build + run: haxe compile.hxml --debug -D HXCPP_M${{ inputs.arch }} + - name: build (utf8) + run: haxe compile-utf8.hxml --debug -D HXCPP_M${{ inputs.arch }} + - name: build (neko) + run: haxe compile-neko.hxml --debug -D HXCPP_M${{ inputs.arch }} + - name: copy + run: cp project/ndll/*/prime${{ inputs.ext }} bin/neko/prime.ndll + - name: run + run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug + - name: run (utf8) + run: bin${{ inputs.sep }}cpp-utf8${{ inputs.sep }}TestMain-debug + - name: run (neko) + if: inputs.arch == '64' + working-directory: test/cffi/bin/neko + run: neko TestMain.n + + telemetry: + strategy: + fail-fast: false + matrix: + mode: [ debug, release ] + include: + - suffix: -debug + mode: debug + runs-on: ${{ inputs.os }} + name: telemetry (${{ matrix.mode }}) + defaults: + run: + working-directory: test/telemetry + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: build + run: haxe compile.hxml ${{ matrix.suffix }} -D HXCPP_M${{ inputs.arch }} + - name: run + run: bin${{ inputs.sep }}TestMain${{ matrix.suffix }} + + debugger: + runs-on: ${{ inputs.os }} + name: debugger + defaults: + run: + working-directory: test/debugger + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: build + run: haxe compile.hxml -D HXCPP_M${{ inputs.arch }} + - name: run + run: bin${{ inputs.sep }}App-debug + + native: + runs-on: ${{ inputs.os }} + name: native + defaults: + run: + working-directory: test/native + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: build + run: haxe compile.hxml -D HXCPP_M${{ inputs.arch }} + - name: run + run: bin${{ inputs.sep }}Native + + std: + runs-on: ${{ inputs.os }} + name: std + defaults: + run: + working-directory: test/std + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: install mariadb + if: runner.os == 'Linux' + run: | + set -ex + sudo rm -R /var/lib/mysql/ + curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup > mariadb_repo_setup + curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup.sha256 > mariadb_repo_setup.sha256 + sha256sum --check mariadb_repo_setup.sha256 + sudo bash mariadb_repo_setup + sudo apt-get update -qqy + sudo apt-get remove -qqy mysql-common + sudo apt-get autoremove -qqy + sudo apt-get install -qqy mariadb-server + - name: configure mariadb + if: runner.os == 'Linux' + run: | + set -ex + sudo systemctl unmask mysql.service + sudo systemctl start mysql + sudo mysql -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;" + - name: build + run: haxe compile${{ inputs.arch }}.hxml + - name: run + run: cpp${{ inputs.arch }}${{ inputs.sep }}Test + + cppia: + strategy: + fail-fast: false + matrix: + mode: [ interp, jit ] + include: + - suffix: -jit + mode: jit + runs-on: ${{ inputs.os }} + name: cppia (${{ matrix.mode }}) + defaults: + run: + working-directory: test/cppia + steps: + - name: checkout + uses: actions/checkout@v4 + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: build host + run: haxe compile-host.hxml -D HXCPP_M${{ inputs.arch }} + - name: build client + run: haxe compile-client.hxml -D HXCPP_M${{ inputs.arch }} + - name: run + run: bin${{ inputs.sep }}CppiaHost bin${{ inputs.sep }}client.cppia ${{ matrix.suffix }} + + suite: + runs-on: ${{ inputs.os }} + name: haxe test suite + defaults: + run: + working-directory: haxe/tests/unit + steps: + - name: checkout + uses: actions/checkout@v4 + - name: checkout haxe (latest) + if: inputs.haxe == 'latest' + uses: actions/checkout@v4 + with: + repository: HaxeFoundation/haxe + path: haxe + - name: checkout haxe (stable) + if: inputs.haxe != 'latest' + uses: actions/checkout@v4 + with: + repository: HaxeFoundation/haxe + path: haxe + ref: ${{ inputs.haxe }} + - name: setup + uses: ./.github/workflows/setup + with: + haxe: ${{ inputs.haxe }} + - name: install haxe libs + run: haxelib install compile-cpp.hxml --always + - name: build + run: haxe compile-cpp.hxml -D HXCPP_M${{ inputs.arch }} -D no_http + - name: run + run: bin${{ inputs.sep }}cpp${{ inputs.sep }}TestMain-debug \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index c4108d2c1..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,42 +0,0 @@ -variables: - - group: variables-haxe - - name: AZURE_PIPELINES_REPO_URL - value: $(Build.Repository.Uri) - - name: AZURE_PIPELINES_BRANCH - value: $(Build.SourceBranchName) - - name: HXCPP_COMPILE_CACHE - value: $(Agent.TempDirectory)/hxcache - -stages: - - stage: StageTest - jobs: - - template: tools/azure-pipelines/build.yml - parameters: - name: Linux64 - vmImage: ubuntu-20.04 - platform: linux64 - arch: 64 - - template: tools/azure-pipelines/build.yml - parameters: - name: Linux32 - vmImage: ubuntu-20.04 - platform: linux64 - arch: 32 - - template: tools/azure-pipelines/build.yml - parameters: - name: Mac - vmImage: macOS-12 - platform: mac - arch: 64 - - template: tools/azure-pipelines/build.yml - parameters: - name: Windows64 - vmImage: windows-2019 - platform: windows - arch: 64 - - template: tools/azure-pipelines/build.yml - parameters: - name: Windows32 - vmImage: windows-2019 - platform: windows - arch: 32 diff --git a/tools/azure-pipelines/build.yml b/tools/azure-pipelines/build.yml index d83d0cb71..e69de29bb 100644 --- a/tools/azure-pipelines/build.yml +++ b/tools/azure-pipelines/build.yml @@ -1,160 +0,0 @@ -parameters: - name: '' - vmImage: '' - arch: '' # hxcpp's target arch (HXCPP_Mxx), can be '32' or '64' - platform: '' # can be linux64, mac, windows, or windows64 - listPlatform32: ['linux32', 'windows'] - listPlatform64: ['linux64', 'mac', 'windows64'] - -jobs: - - job: ${{ parameters.name }} - pool: - vmImage: ${{ parameters.vmImage }} - variables: - ${{ if startsWith(parameters.vmImage, 'ubuntu-') }}: - libExt: .dso - sep: '/' - ${{ if contains(parameters.vmImage, 'mac') }}: - libExt: .dylib - sep: '/' - ${{ if contains(parameters.vmImage, 'win') }}: - libExt: .dll - sep: '\' - steps: - - ${{ if startsWith(parameters.vmImage, 'ubuntu-') }}: - - script: | - set -ex - sudo rm -R /var/lib/mysql/ - # mariadb - curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup > mariadb_repo_setup - curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup.sha256 > mariadb_repo_setup.sha256 - sha256sum --check mariadb_repo_setup.sha256 - sudo bash mariadb_repo_setup - sudo apt-get update -qqy - sudo apt-get remove -qqy mysql-common - sudo apt-get autoremove -qqy - sudo apt-get install -qqy mariadb-server - # remaining packages - sudo apt-get install -qqy gcc-multilib g++-multilib - displayName: Install dependencies - - script: | - set -ex - sudo systemctl unmask mysql.service - sudo systemctl start mysql - sudo mysql -u root -e "create database hxcpp; grant all privileges on hxcpp.* to hxcpp@localhost identified by 'hxcpp'; flush privileges;" - displayName: Configure MariaDB - - template: install-neko-snapshot.yaml - parameters: - platform: ${{ parameters.platform }} - - template: install-haxe-snapshot.yaml - parameters: - platform: ${{ parameters.platform }} - - script: | - set -ex - mkdir -p ~/haxelib - haxelib setup ~/haxelib - haxelib install utest - haxelib git hx4compat https://github.com/HaxeFoundation/hx4compat - haxelib dev hxcpp $(Build.SourcesDirectory) - haxelib list - displayName: Install Haxe libraries - - script: haxe compile.hxml - workingDirectory: tools/run - displayName: Build run.n - - script: haxe compile.hxml - workingDirectory: tools/hxcpp - displayName: Build hxcpp - - script: haxe compile-cppia.hxml - workingDirectory: project - displayName: Build cppia - - # cffi - - script: haxelib run hxcpp build.xml -debug -DHXCPP_M${{parameters.arch}} - workingDirectory: test/cffi/project - displayName: Build cffi project - - bash: | - set -ex - haxe compile.hxml -debug -D HXCPP_M${{parameters.arch}} - haxe compile-utf8.hxml -debug -D HXCPP_M${{parameters.arch}} - haxe compile-neko.hxml -debug -D HXCPP_M${{parameters.arch}} - workingDirectory: test/cffi - displayName: cffi test - Compile - - script: bin$(sep)cpp$(sep)TestMain-debug - workingDirectory: test/cffi - displayName: cffi test - Run - - script: bin$(sep)cpp-utf8$(sep)TestMain-debug - workingDirectory: test/cffi - displayName: cffi-utf8 test - Run - - ${{ if or(and(containsValue(parameters.listPlatform32, parameters.platform), eq(parameters.arch, '32')), and(containsValue(parameters.listPlatform64, parameters.platform), eq(parameters.arch, '64'))) }}: - - bash: cp test/cffi/project/ndll/*/prime$(libExt) test/cffi/bin/neko/prime.ndll - displayName: Copy prime.ndll - - script: neko TestMain.n - workingDirectory: test/cffi/bin/neko - displayName: cffi-neko test - Run - - # haxe - - script: haxe compile.hxml -debug -D HXCPP_M${{parameters.arch}} - workingDirectory: test/haxe - displayName: haxe test - Compile - - script: bin$(sep)TestMain-debug - workingDirectory: test/haxe - displayName: haxe test - Run - - # telemetry, should work in debug and non-debug modes - - script: haxe compile.hxml -debug -D HXCPP_M${{parameters.arch}} - workingDirectory: test/telemetry - displayName: telemetry test (debug) - Compile - - script: bin$(sep)TestMain-debug - workingDirectory: test/telemetry - displayName: telemetry test (debug) - Run - - script: haxe compile.hxml -D HXCPP_M${{parameters.arch}} - workingDirectory: test/telemetry - displayName: telemetry test - Compile - - script: bin$(sep)TestMain - workingDirectory: test/telemetry - displayName: telemetry test - Run - - # std - - script: haxe compile${{parameters.arch}}.hxml - workingDirectory: test/std - displayName: std test - Compile - - script: cpp${{parameters.arch}}$(sep)Test - workingDirectory: test/std - displayName: std test - Run - - # debugger - - script: haxe compile.hxml -D HXCPP_M${{parameters.arch}} - workingDirectory: test/debugger - displayName: debugger test - Compile - - script: bin$(sep)App-debug - workingDirectory: test/debugger - displayName: debugger test - Run - - # native - - script: haxe compile.hxml -D HXCPP_M${{parameters.arch}} - workingDirectory: test/native - displayName: native test - Compile - - script: bin$(sep)Native - workingDirectory: test/native - displayName: native test - Run - - # haxe unit test - - bash: | - set -ex - HAXE_VERSION=`haxe -version` - HAXE_HASH=`[[ "$HAXE_VERSION" =~ ^.+\+(.+) ]] && echo ${BASH_REMATCH[1]}` - git clone -q https://github.com/HaxeFoundation/haxe.git - pushd haxe - git reset --hard "$HAXE_HASH" - git clean -fdx - popd - displayName: haxe unit test - Clone haxe repo - - script: haxelib install compile-cpp.hxml --always - workingDirectory: haxe/tests/unit - displayName: haxe unit test - Install haxelibs - - script: haxe compile-cpp.hxml -D HXCPP_M${{parameters.arch}} -D no_http - workingDirectory: haxe/tests/unit - displayName: haxe unit test - Compile - - script: bin$(sep)cpp$(sep)TestMain-debug - workingDirectory: haxe/tests/unit - displayName: haxe unit test - Run diff --git a/tools/azure-pipelines/install-haxe-snapshot.yaml b/tools/azure-pipelines/install-haxe-snapshot.yaml deleted file mode 100644 index 48b14fb33..000000000 --- a/tools/azure-pipelines/install-haxe-snapshot.yaml +++ /dev/null @@ -1,31 +0,0 @@ -parameters: - platform: '' # can be linux64, mac, windows, or windows64 - -steps: - - ${{ if startsWith(parameters.platform, 'windows') }}: - - powershell: | - Invoke-WebRequest https://build.haxe.org/builds/haxe/${{parameters.platform}}/haxe_latest.zip -OutFile $(Agent.TempDirectory)/haxe_latest.zip - Expand-Archive $(Agent.TempDirectory)/haxe_latest.zip -DestinationPath $(Agent.TempDirectory) - Remove-Item $(Agent.TempDirectory)/haxe_latest.zip - $HAXEPATH = Get-Item $(Agent.TempDirectory)/haxe_* - $HAXE_STD_PATH = "$HAXEPATH\std" - Write-Host "##vso[task.prependpath]$HAXEPATH" - Write-Host "##vso[task.setvariable variable=HAXE_STD_PATH]$HAXE_STD_PATH" - displayName: Install Haxe using snapshot from S3 - - ${{ if not(startsWith(parameters.platform, 'windows')) }}: - - bash: | - set -ex - DOWNLOADDIR=$(Agent.TempDirectory) - curl -sSL https://build.haxe.org/builds/haxe/${{parameters.platform}}/haxe_latest.tar.gz -o $(Agent.TempDirectory)/haxe_latest.tar.gz - tar -xf $(Agent.TempDirectory)/haxe_latest.tar.gz -C $(Agent.TempDirectory) - rm $(Agent.TempDirectory)/haxe_latest.tar.gz - HAXEPATH=`echo $(Agent.TempDirectory)/haxe_*` - sudo mkdir -p /usr/local/bin - sudo mkdir -p /usr/local/share/haxe - sudo ln -s $HAXEPATH/{haxe,haxelib} /usr/local/bin/ - sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std - set +x - echo "##vso[task.setvariable variable=HAXE_STD_PATH]/usr/local/share/haxe/std" - displayName: Install Haxe using snapshot from S3 - - script: haxe -version - displayName: Print Haxe version \ No newline at end of file diff --git a/tools/azure-pipelines/install-neko-snapshot.yaml b/tools/azure-pipelines/install-neko-snapshot.yaml deleted file mode 100644 index fda19bd94..000000000 --- a/tools/azure-pipelines/install-neko-snapshot.yaml +++ /dev/null @@ -1,33 +0,0 @@ -parameters: - platform: '' # can be linux64, mac, windows, or windows64 - -steps: - - ${{ if startsWith(parameters.platform, 'windows') }}: - - powershell: | - Invoke-WebRequest https://build.haxe.org/builds/neko/${{parameters.platform}}/neko_latest.zip -OutFile $(Agent.TempDirectory)/neko_latest.zip - Expand-Archive $(Agent.TempDirectory)/neko_latest.zip -DestinationPath $(Agent.TempDirectory) - $NEKOPATH = Get-ChildItem $(Agent.TempDirectory)/neko-*-win - Write-Host "##vso[task.prependpath]$NEKOPATH" - Write-Host "##vso[task.setvariable variable=NEKOPATH]$NEKOPATH" - displayName: Install Neko using snapshot from S3 - - ${{ if not(startsWith(parameters.platform, 'windows')) }}: - - bash: | - set -ex - DOWNLOADDIR=$(Agent.TempDirectory) - curl -sSL https://build.haxe.org/builds/neko/${{parameters.platform}}/neko_latest.tar.gz -o $(Agent.TempDirectory)/neko_latest.tar.gz - tar -xf $(Agent.TempDirectory)/neko_latest.tar.gz -C $(Agent.TempDirectory) - NEKOPATH=`echo $(Agent.TempDirectory)/neko-*-*` - sudo mkdir -p /usr/local/bin - sudo mkdir -p /usr/local/lib/neko - sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/ - sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ - sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ - set +x - echo "##vso[task.prependpath]$NEKOPATH" - echo "##vso[task.setvariable variable=NEKOPATH]$NEKOPATH" - displayName: Install Neko using snapshot from S3 - - ${{ if eq(parameters.platform, 'linux64') }}: - - bash: sudo ldconfig - displayName: ldconfig - - script: neko -version 2>&1 - displayName: Print Neko version \ No newline at end of file From 08162d9768032c6c2c1bcf1ef0cfa8388c6bb572 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Thu, 1 Jun 2023 14:02:24 +0100 Subject: [PATCH 03/13] Add HXCPP_CPP17 support for mingw --- toolchain/mingw-toolchain.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain/mingw-toolchain.xml b/toolchain/mingw-toolchain.xml index d45ebaf9b..cf4ce7d02 100644 --- a/toolchain/mingw-toolchain.xml +++ b/toolchain/mingw-toolchain.xml @@ -24,7 +24,7 @@ - + @@ -41,6 +41,7 @@ + From 3655b1a175a6b0b1a816cb8cd928531647b97de5 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Fri, 2 Jun 2023 19:18:14 +0100 Subject: [PATCH 04/13] Add HXCPP_CPP17 support for ios --- toolchain/finish-setup.xml | 4 ++-- toolchain/iphoneos-toolchain.xml | 11 +++++++---- toolchain/iphonesim-toolchain.xml | 13 +++++++++---- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/toolchain/finish-setup.xml b/toolchain/finish-setup.xml index 23a693691..12ba656ac 100644 --- a/toolchain/finish-setup.xml +++ b/toolchain/finish-setup.xml @@ -75,8 +75,8 @@ - - + + diff --git a/toolchain/iphoneos-toolchain.xml b/toolchain/iphoneos-toolchain.xml index cde13b2c8..c3fd3307e 100644 --- a/toolchain/iphoneos-toolchain.xml +++ b/toolchain/iphoneos-toolchain.xml @@ -3,7 +3,7 @@ - + @@ -16,6 +16,7 @@ + @@ -32,11 +33,13 @@ - + + - + + @@ -93,7 +96,7 @@ - + diff --git a/toolchain/iphonesim-toolchain.xml b/toolchain/iphonesim-toolchain.xml index 0b6e46bf9..c509b4edd 100644 --- a/toolchain/iphonesim-toolchain.xml +++ b/toolchain/iphonesim-toolchain.xml @@ -2,7 +2,7 @@ - + @@ -13,6 +13,7 @@ + @@ -24,12 +25,16 @@ + - + + - + + + @@ -85,7 +90,7 @@ - + From 052a92408d076d36c8f3f09c083ddec7dfa75e09 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Mon, 3 Jul 2023 13:00:05 +0100 Subject: [PATCH 05/13] Add HXCPP_CPP17 support for android toolchain --- toolchain/android-toolchain-clang.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/android-toolchain-clang.xml b/toolchain/android-toolchain-clang.xml index 3f08595b4..870931257 100644 --- a/toolchain/android-toolchain-clang.xml +++ b/toolchain/android-toolchain-clang.xml @@ -67,6 +67,7 @@ + From 5c12506489631479f7d5e2dc64e3b96a7115418b Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 25 Jun 2024 07:39:55 -0700 Subject: [PATCH 06/13] mingw-toolchain: use same default paths for MinGW on macOS as are used on Linux (#1105) --- toolchain/mingw-toolchain.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/mingw-toolchain.xml b/toolchain/mingw-toolchain.xml index cf4ce7d02..851d0055a 100644 --- a/toolchain/mingw-toolchain.xml +++ b/toolchain/mingw-toolchain.xml @@ -2,7 +2,7 @@ -
+
From dd23d898696f0e7831652c3d750aa869f29d88c6 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Tue, 25 Jun 2024 16:15:20 +0100 Subject: [PATCH 07/13] Fix c standard error when compiling mbedtls (#1111) On some platforms (e.g. Android) it is necessary to specify the use of the c99 standard --- src/hx/libs/ssl/Build.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hx/libs/ssl/Build.xml b/src/hx/libs/ssl/Build.xml index 1e7bc5185..ffc34aa89 100644 --- a/src/hx/libs/ssl/Build.xml +++ b/src/hx/libs/ssl/Build.xml @@ -10,6 +10,7 @@ + From 72c719ddb136c24e11afc269f73bbeb09a3ed983 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Tue, 25 Jun 2024 17:07:42 +0100 Subject: [PATCH 08/13] Make sys_read_dir errors consistent between platforms (#1095) Haxe documentation specifies that an exception should be thrown if the path is not a valid directory. This was already the case on all platforms except Windows, where `null` was returned. Now the behavior is consistent. --- src/hx/libs/std/Sys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hx/libs/std/Sys.cpp b/src/hx/libs/std/Sys.cpp index 30ad2e29c..371addf93 100644 --- a/src/hx/libs/std/Sys.cpp +++ b/src/hx/libs/std/Sys.cpp @@ -669,7 +669,7 @@ Array _hx_std_sys_read_dir( String p ) const wchar_t *path = p.wchar_str(); size_t len = wcslen(path); if (len>MAX_PATH) - return null(); + hx::Throw(HX_CSTRING("Invalid directory")); WIN32_FIND_DATAW d; HANDLE handle; @@ -698,7 +698,7 @@ Array _hx_std_sys_read_dir( String p ) if( handle == INVALID_HANDLE_VALUE ) { hx::ExitGCFreeZone(); - return null(); + hx::Throw(HX_CSTRING("Invalid directory")); } while( true ) { From 01902821437331b4aca781fe9741bdbc31681d82 Mon Sep 17 00:00:00 2001 From: lehonma Date: Tue, 25 Jun 2024 13:40:18 -0300 Subject: [PATCH 09/13] Added Android's x86_64 architecture for older NDKs (#855) Co-authored-by: Caio --- toolchain/android-toolchain-gcc.xml | 42 ++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/toolchain/android-toolchain-gcc.xml b/toolchain/android-toolchain-gcc.xml index b1b8c323a..f945963a4 100644 --- a/toolchain/android-toolchain-gcc.xml +++ b/toolchain/android-toolchain-gcc.xml @@ -43,6 +43,15 @@
+
+ + + + + + +
+ @@ -84,7 +93,7 @@ -
+
@@ -109,6 +118,9 @@
+
+ +
@@ -168,11 +180,18 @@ - - - +
+ + + +
+
+ + + +
@@ -200,11 +219,16 @@ - - - - - +
+ + + +
+
+ + + +
From 73243b3879618ee64aff9d085ecd6373c1861ffe Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Tue, 25 Jun 2024 17:40:45 +0100 Subject: [PATCH 10/13] Fix arm64 library names on mac (#1088) --- toolchain/finish-setup.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/finish-setup.xml b/toolchain/finish-setup.xml index 12ba656ac..0b6aefc9e 100644 --- a/toolchain/finish-setup.xml +++ b/toolchain/finish-setup.xml @@ -60,7 +60,7 @@ - + From 0ab4cf09239b322f6f81068639c92267fb2d1559 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Tue, 25 Jun 2024 17:53:05 +0100 Subject: [PATCH 11/13] Do not add host architecture if arm architecture is set (#1079) --- tools/hxcpp/BuildTool.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/hxcpp/BuildTool.hx b/tools/hxcpp/BuildTool.hx index 15339a9a9..2109279f4 100644 --- a/tools/hxcpp/BuildTool.hx +++ b/tools/hxcpp/BuildTool.hx @@ -134,7 +134,8 @@ class BuildTool m64 = mDefines.exists("HXCPP_M64"); m32 = mDefines.exists("HXCPP_M32"); arm64 = mDefines.exists("HXCPP_ARM64"); - if (m64==m32 && !arm64) + var otherArmArchitecture = mDefines.exists("HXCPP_ARMV6") || mDefines.exists("HXCPP_ARMV7") || mDefines.exists("HXCPP_ARMV7S"); + if (m64==m32 && !arm64 && !otherArmArchitecture) { var arch = getArch(); From f61cd0131ff4d697fd1c060ecd25a0a477d319dc Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Tue, 25 Jun 2024 19:07:34 +0100 Subject: [PATCH 12/13] Add tools/hxcpp/cpp to git ignore (#1043) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e2b80f60e..fcc9ac911 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ test/extern-lib/gen-externs test/cffi/project/ndll test/snippets/messagebox/cpp test/haxe/gc/big.txt +tools/hxcpp/cpp hxcpp.n .DS_Store From abecbdad6434545de7b6589440edea52b7db23f8 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Tue, 25 Jun 2024 19:17:34 +0100 Subject: [PATCH 13/13] Don't undefine __STRICT_ANSI__ for mingw (#1112) This was done originally to fix #785. However, since gcc 11.1.0, this gives a warning: __STRICT_ANSI__ seems to have been undefined; this is not supported Due to this change: https://gcc.gnu.org/git/?p=gcc.git;a=commit;f=libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig;h=767537a8b027bcb5807bb45b0268c5da98c2c7a0 The original issue no longer happens with mingw-w64. The original mingw project is outdated (and 32 bit only) it is safe remove this flag now. --- toolchain/mingw-toolchain.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/toolchain/mingw-toolchain.xml b/toolchain/mingw-toolchain.xml index 851d0055a..c1dce197d 100644 --- a/toolchain/mingw-toolchain.xml +++ b/toolchain/mingw-toolchain.xml @@ -42,7 +42,6 @@ -