diff -Nru haxe-4.2.0/debian/changelog haxe-4.2.1/debian/changelog --- haxe-4.2.0/debian/changelog 2021-02-15 11:50:28.000000000 +0000 +++ haxe-4.2.1/debian/changelog 2021-02-27 08:52:01.000000000 +0000 @@ -1,14 +1,19 @@ -haxe (1:4.2.0-1~ubuntu16.04.1~ppa3) xenial; urgency=medium +haxe (1:4.2.1-1~ubuntu16.04.1~ppa1) xenial; urgency=medium * No-change backport to xenial - -- Andy Li Mon, 15 Feb 2021 19:50:28 +0800 + -- Andy Li Sat, 27 Feb 2021 16:52:01 +0800 + +haxe (1:4.2.1-1) experimental; urgency=medium + + * New upstream version. + + -- Andy Li Sat, 27 Feb 2021 15:43:18 +0800 haxe (1:4.2.0-1) experimental; urgency=medium * New upstream version. * Set d/compat back to 9. - * Add uchar build-dep. -- Andy Li Fri, 12 Feb 2021 12:57:25 +0800 diff -Nru haxe-4.2.0/debian/control haxe-4.2.1/debian/control --- haxe-4.2.0/debian/control 2021-02-12 04:57:25.000000000 +0000 +++ haxe-4.2.1/debian/control 2021-02-27 07:43:18.000000000 +0000 @@ -17,7 +17,6 @@ libluv-ocaml-dev (>= 0.5.6), libuv1-dev, libmbedtls-dev, - libuchar-ocaml-dev, neko (>= 2.3.0), zlib1g-dev, libpcre3-dev, diff -Nru haxe-4.2.0/debian/patches/series haxe-4.2.1/debian/patches/series --- haxe-4.2.0/debian/patches/series 2021-02-12 04:57:25.000000000 +0000 +++ haxe-4.2.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -uchar.diff diff -Nru haxe-4.2.0/debian/patches/uchar.diff haxe-4.2.1/debian/patches/uchar.diff --- haxe-4.2.0/debian/patches/uchar.diff 2021-02-12 04:57:25.000000000 +0000 +++ haxe-4.2.1/debian/patches/uchar.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ ---- a/src/dune -+++ b/src/dune -@@ -14,6 +14,7 @@ - unix str threads dynlink - xml-light extlib ptmap sha - luv -+ uchar - ) - (modules (:standard \ haxe)) - (preprocess (per_module diff -Nru haxe-4.2.0/extra/CHANGES.txt haxe-4.2.1/extra/CHANGES.txt --- haxe-4.2.0/extra/CHANGES.txt 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/extra/CHANGES.txt 2021-02-27 07:44:53.000000000 +0000 @@ -1,3 +1,22 @@ +2021-02-26 4.2.1: + + General improvements: + + threads : changed main thread initialization to make main event loop available during static initialization (#10114) + php : added extern for `number_format` function (#10115) + python : rewrote `sys.thread.Thread`, `Mutex` and `Lock` as classes instead of abstracts. + + Bugfixes: + + all : fixed compiler compatibility with OS X 10.13 (#10110) + all : fixed compiler hanging on `switch` for abstracts with implicit casts involving type parameters and constraints (#10082) + all : fixed inlining of `haxe.DynamicAccess.keyValueIterator` (#10118) + all : fixed rest arguments typing against type parameters (#10124) + analyzer : fixed side effect handling for enums (#10032) + cpp : fixed handling of `cpp.ConstCharStar` with analyzer enabled (#9733) + php : fixed failure with trailing slash in output dir (#6212) + hl : fixed call stack of rethrown exceptions (#10109) + 2021-02-09 4.2.0: New features: diff -Nru haxe-4.2.0/extra/github-actions/build-mac.yml haxe-4.2.1/extra/github-actions/build-mac.yml --- haxe-4.2.0/extra/github-actions/build-mac.yml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/extra/github-actions/build-mac.yml 2021-02-27 07:44:53.000000000 +0000 @@ -1,4 +1,8 @@ - name: Install dependencies + env: + ZLIB_VERSION: 1.2.11 + MBEDTLS_VERSION: 2.25.0 + PCRE_VERSION: 8.44 run: | set -ex brew uninstall openssl@1.0.2t || echo @@ -11,12 +15,28 @@ brew install cpanminus cpanm IPC::System::Simple cpanm String::ShellQuote + curl -L https://www.zlib.net/zlib-$ZLIB_VERSION.tar.gz | tar xz + cd zlib-$ZLIB_VERSION + ./configure + make && make install + curl -L https://github.com/ARMmbed/mbedtls/archive/v$MBEDTLS_VERSION.tar.gz | tar xz + cd mbedtls-$MBEDTLS_VERSION + make && make install + curl -L https://ftp.pcre.org/pub/pcre/pcre-$PCRE_VERSION.tar.gz | tar xz + cd pcre-$PCRE_VERSION + ./configure --enable-utf8 --enable-pcre8 --enable-pcre16 --enable-pcre32 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-jit + make && make install + - name: Install OCaml libraries run: | set -ex opam init # --disable-sandboxing opam update + opam switch create 4.07.1 + eval $(opam env) + opam env + opam pin add ctypes 0.17.1 --yes opam pin add haxe . --no-action opam install haxe --deps-only opam list @@ -30,7 +50,7 @@ run: | set -ex eval $(opam env) - opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe + opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe opam config exec -- make -s haxelib make -s package_unix package_installer_mac ls -l out diff -Nru haxe-4.2.0/extra/github-actions/build-windows.yml haxe-4.2.1/extra/github-actions/build-windows.yml --- haxe-4.2.0/extra/github-actions/build-windows.yml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/extra/github-actions/build-windows.yml 2021-02-27 07:44:53.000000000 +0000 @@ -16,10 +16,11 @@ run: | Set-PSDebug -Trace 1 curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP) - Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre -P perl-IPC-System-Simple" -Wait + Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre" -Wait curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$($env:ARCH).tar.xz curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 https://github.com/Simn/mingw64-mbedtls/releases/download/2.16.3/mingw64-$($env:MINGW_ARCH)-mbedtls-2.16.3-1.tar.xz & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'curl -L https://cpanmin.us | perl - App::cpanminus') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm IPC::System::Simple module') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm String::ShellQuote') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz') @@ -28,8 +29,8 @@ & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add ctypes 0.17.1 --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#44db25c2b2669f9d1373377006a4d5850e0820e3 --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v') diff -Nru haxe-4.2.0/extra/github-actions/workflows/main.yml haxe-4.2.1/extra/github-actions/workflows/main.yml --- haxe-4.2.0/extra/github-actions/workflows/main.yml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/extra/github-actions/workflows/main.yml 2021-02-27 07:44:53.000000000 +0000 @@ -70,6 +70,7 @@ env: PLATFORM: mac OPAMYES: 1 + MACOSX_DEPLOYMENT_TARGET: 10.13 steps: - uses: actions/checkout@main with: diff -Nru haxe-4.2.0/.github/workflows/main.yml haxe-4.2.1/.github/workflows/main.yml --- haxe-4.2.0/.github/workflows/main.yml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/.github/workflows/main.yml 2021-02-27 07:44:53.000000000 +0000 @@ -35,7 +35,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -45,7 +45,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -55,10 +55,10 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + - name: choco install nsis uses: nick-invision/retry@v1 with: @@ -71,16 +71,17 @@ - name: Prepend Chocolatey path shell: pwsh run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin" - + - name: Install OCaml and OCaml libraries shell: pwsh run: | Set-PSDebug -Trace 1 curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP) - Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre -P perl-IPC-System-Simple" -Wait + Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre" -Wait curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$($env:ARCH).tar.xz curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 https://github.com/Simn/mingw64-mbedtls/releases/download/2.16.3/mingw64-$($env:MINGW_ARCH)-mbedtls-2.16.3-1.tar.xz & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'curl -L https://cpanmin.us | perl - App::cpanminus') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm IPC::System::Simple module') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm String::ShellQuote') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz') @@ -89,20 +90,20 @@ & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add ctypes 0.17.1 --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#44db25c2b2669f9d1373377006a4d5850e0820e3 --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v') - + - name: Expose mingw dll files shell: pwsh run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin" - + - name: Set ADD_REVISION=1 for non-release if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: pwsh run: echo "ADD_REVISION=1" >> $Env:GITHUB_ENV - + - name: Build Haxe shell: pwsh run: | @@ -114,13 +115,13 @@ & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') - + - name: Upload artifact uses: actions/upload-artifact@v1.0.0 with: name: win${{env.ARCH}}Binaries path: out - + windows-build: runs-on: windows-latest @@ -142,7 +143,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -152,7 +153,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -162,10 +163,10 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + - name: choco install nsis uses: nick-invision/retry@v1 with: @@ -178,16 +179,17 @@ - name: Prepend Chocolatey path shell: pwsh run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin" - + - name: Install OCaml and OCaml libraries shell: pwsh run: | Set-PSDebug -Trace 1 curl.exe -fsSL -o cygwin-setup.exe --retry 3 $($env:CYGWIN_SETUP) - Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre -P perl-IPC-System-Simple" -Wait + Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $($env:CYG_ROOT) -l C:/tmp -s $($env:CYG_MIRROR) -P default -P make -P git -P zlib-devel -P rsync -P patch -P diffutils -P curl -P unzip -P tar -P m4 -P perl -P libpcre-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre" -Wait curl.exe -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.2/opam$($env:ARCH).tar.xz curl.exe -fsSL -o "libmbedtls.tar.xz" --retry 3 https://github.com/Simn/mingw64-mbedtls/releases/download/2.16.3/mingw64-$($env:MINGW_ARCH)-mbedtls-2.16.3-1.tar.xz & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'curl -L https://cpanmin.us | perl - App::cpanminus') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm IPC::System::Simple module') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cpanm String::ShellQuote') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libmbedtls.tar.xz') @@ -196,20 +198,20 @@ & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam init mingw "https://github.com/fdopen/opam-repository-mingw.git#opam2" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam update --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && opam pin add haxe . --kind=path --no-action --yes 2>&1') + & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add ctypes 0.17.1 --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam install haxe --deps-only --yes 2>&1') - & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam pin add luv https://github.com/aantron/luv.git#44db25c2b2669f9d1373377006a4d5850e0820e3 --yes 2>&1') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v') - + - name: Expose mingw dll files shell: pwsh run: Write-Host "::add-path::${env:CYG_ROOT}/usr/$($env:MINGW_ARCH)-w64-mingw32/sys-root/mingw/bin" - + - name: Set ADD_REVISION=1 for non-release if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: pwsh run: echo "ADD_REVISION=1" >> $Env:GITHUB_ENV - + - name: Build Haxe shell: pwsh run: | @@ -221,13 +223,13 @@ & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxe.exe') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe') & "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out') - + - name: Upload artifact uses: actions/upload-artifact@v1.0.0 with: name: win${{env.ARCH}}Binaries path: out - + linux-build: runs-on: ubuntu-latest @@ -243,7 +245,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -253,7 +255,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -263,10 +265,10 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + - name: Install dependencies run: | set -ex @@ -274,7 +276,7 @@ sudo add-apt-repository ppa:haxe/ocaml -y # provides newer version of mbedtls sudo apt-get update -qqy sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev libmbedtls-dev ninja-build libstring-shellquote-perl - + - name: Install OCaml libraries run: | set -ex @@ -284,11 +286,11 @@ opam install haxe --deps-only opam list ocamlopt -v - + - name: Set ADD_REVISION=1 for non-release if: ${{ !startsWith(github.ref, 'refs/tags/') }} run: echo "ADD_REVISION=1" >> $GITHUB_ENV - + - name: Build Haxe run: | set -ex @@ -299,13 +301,13 @@ ls -l out ldd -v ./haxe ldd -v ./haxelib - + # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions - name: Extract branch name id: extract_branch shell: bash run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - + - name: Build xmldoc run: | set -ex @@ -316,25 +318,26 @@ "branch": "${{ steps.extract_branch.outputs.branch }}" } EOL - + - name: Upload xmldoc artifact uses: actions/upload-artifact@v1.0.0 with: name: xmldoc path: extra/doc - + - name: Upload artifact uses: actions/upload-artifact@v1.0.0 with: name: linuxBinaries path: out - + mac-build: runs-on: macos-latest env: PLATFORM: mac OPAMYES: 1 + MACOSX_DEPLOYMENT_TARGET: 10.13 steps: - uses: actions/checkout@main with: @@ -344,7 +347,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -354,7 +357,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -364,11 +367,15 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + - name: Install dependencies + env: + ZLIB_VERSION: 1.2.11 + MBEDTLS_VERSION: 2.25.0 + PCRE_VERSION: 8.44 run: | set -ex brew uninstall openssl@1.0.2t || echo @@ -381,38 +388,54 @@ brew install cpanminus cpanm IPC::System::Simple cpanm String::ShellQuote - + curl -L https://www.zlib.net/zlib-$ZLIB_VERSION.tar.gz | tar xz + cd zlib-$ZLIB_VERSION + ./configure + make && make install + curl -L https://github.com/ARMmbed/mbedtls/archive/v$MBEDTLS_VERSION.tar.gz | tar xz + cd mbedtls-$MBEDTLS_VERSION + make && make install + curl -L https://ftp.pcre.org/pub/pcre/pcre-$PCRE_VERSION.tar.gz | tar xz + cd pcre-$PCRE_VERSION + ./configure --enable-utf8 --enable-pcre8 --enable-pcre16 --enable-pcre32 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-jit + make && make install + + - name: Install OCaml libraries run: | set -ex opam init # --disable-sandboxing opam update + opam switch create 4.07.1 + eval $(opam env) + opam env + opam pin add ctypes 0.17.1 --yes opam pin add haxe . --no-action opam install haxe --deps-only opam list ocamlopt -v - + - name: Set ADD_REVISION=1 for non-release if: ${{ !startsWith(github.ref, 'refs/tags/') }} run: echo "ADD_REVISION=1" >> $GITHUB_ENV - + - name: Build Haxe run: | set -ex eval $(opam env) - opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe + opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe opam config exec -- make -s haxelib make -s package_unix package_installer_mac ls -l out otool -L ./haxe otool -L ./haxelib - + - name: Upload artifact uses: actions/upload-artifact@v1.0.0 with: name: macBinaries path: out - + windows64-test: needs: windows64-build @@ -440,7 +463,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -450,7 +473,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -460,17 +483,17 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + # - name: Quick test # shell: pwsh # run: | # $DOWNLOADDIR="./win$($env:ARCH)Binaries" # new-item -Name $DOWNLOADDIR -ItemType directory # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip - + - name: Setup Haxe shell: pwsh run: | @@ -480,11 +503,11 @@ $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory Write-Host "::add-path::$HAXEPATH" Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib" - + - name: Print Haxe version shell: pwsh run: haxe -version - + - name: "Make Python 3 be available as python3 in the cmdline" shell: pwsh run: | @@ -493,7 +516,7 @@ $py3path = $pypath.replace("python.exe","python3.exe") cmd /c mklink $py3path $pypath python3 -V - + - name: Install hererocks if: matrix.target == 'lua' shell: cmd @@ -501,18 +524,18 @@ pip install hererocks hererocks lua53 -l5.3 -rlatest call lua53/bin/activate - + - name: Setup haxelib shell: pwsh run: | mkdir "$env:HAXELIB_ROOT" haxelib setup "$env:HAXELIB_ROOT" - + - name: Test shell: pwsh run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests - + windows-test: needs: windows-build @@ -541,7 +564,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -551,7 +574,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -561,17 +584,17 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + # - name: Quick test # shell: pwsh # run: | # $DOWNLOADDIR="./win$($env:ARCH)Binaries" # new-item -Name $DOWNLOADDIR -ItemType directory # Invoke-WebRequest https://build.haxe.org/builds/haxe/$env:PLATFORM/haxe_latest.zip -OutFile $DOWNLOADDIR/haxe_bin.zip - + - name: Setup Haxe shell: pwsh run: | @@ -581,11 +604,11 @@ $HAXEPATH = Get-ChildItem $DOWNLOADDIR/haxe_*_* -Directory Write-Host "::add-path::$HAXEPATH" Write-Host "::set-env name=HAXELIB_ROOT::$HAXEPATH\lib" - + - name: Print Haxe version shell: pwsh run: haxe -version - + - name: "Make Python 3 be available as python3 in the cmdline" shell: pwsh run: | @@ -594,7 +617,7 @@ $py3path = $pypath.replace("python.exe","python3.exe") cmd /c mklink $py3path $pypath python3 -V - + - name: Install hererocks if: matrix.target == 'lua' shell: cmd @@ -602,18 +625,18 @@ pip install hererocks hererocks lua53 -l5.3 -rlatest call lua53/bin/activate - + - name: Setup haxelib shell: pwsh run: | mkdir "$env:HAXELIB_ROOT" haxelib setup "$env:HAXELIB_ROOT" - + - name: Test shell: pwsh run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests - + linux-test: needs: linux-build @@ -651,7 +674,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -661,7 +684,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -671,17 +694,17 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + - name: Setup Haxe run: | # mkdir ./linuxBinaries # curl -sSL https://build.haxe.org/builds/haxe/linux64/haxe_latest.tar.gz -o ./linuxBinaries/haxe_bin.tar.gz - + sudo apt install -qqy libmbedtls-dev - + set -ex tar -xf linuxBinaries/*_bin.tar.gz -C linuxBinaries --strip-components=1 sudo mkdir -p /usr/local/bin/ @@ -689,39 +712,39 @@ sudo ln -s `pwd`/linuxBinaries/haxe /usr/local/bin/haxe sudo ln -s `pwd`/linuxBinaries/haxelib /usr/local/bin/haxelib sudo ln -s `pwd`/linuxBinaries/std /usr/local/share/haxe/std - + - name: Print Haxe version run: haxe -version - + - name: Setup haxelib run: | set -ex mkdir ~/haxelib haxelib setup ~/haxelib - + - name: Install apt packages if: matrix.APT_PACKAGES run: | set -ex sudo apt update -qqy sudo apt install -qqy ${{matrix.APT_PACKAGES}} - + - name: Flash setup if: matrix.target == 'flash9' run: export DISPLAY=:99.0 - + - name: Test if: success() && !(matrix.SAUCE && matrix.SAUCE_ACCESS_KEY) run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests - + - name: Test (with SauceLabs) if: matrix.target == 'js' && success() && matrix.SAUCE && matrix.SAUCE_ACCESS_KEY run: haxe RunCi.hxml working-directory: ${{github.workspace}}/tests env: SAUCE_ACCESS_KEY: matrix.SAUCE_ACCESS_KEY - + mac-test: needs: mac-build @@ -749,7 +772,7 @@ if: ${{ !startsWith(env.PLATFORM, 'windows') }} run: | set -ex - + curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP NEKOPATH=`echo $RUNNER_TEMP/neko-*-*` @@ -759,7 +782,7 @@ sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/ sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/ echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV - + - name: Install Neko using snapshot from S3 (Windows) if: ${{ startsWith(env.PLATFORM, 'windows') }} shell: pwsh @@ -769,15 +792,15 @@ $NEKOPATH = Get-ChildItem $env:RUNNER_TEMP/neko-*-* echo "$NEKOPATH" >> $env:GITHUB_PATH echo "NEKOPATH=$NEKOPATH" >> $env:GITHUB_ENV - + - name: Print Neko version run: neko -version 2>&1 - + - name: Setup Haxe run: | # mkdir ./macBinaries # curl -sSL https://build.haxe.org/builds/haxe/mac/haxe_latest.tar.gz -o ./macBinaries/haxe_bin.tar.gz - + set -ex tar -xf macBinaries/*_bin.tar.gz -C macBinaries --strip-components=1 sudo mkdir -p /usr/local/bin/ @@ -785,27 +808,27 @@ sudo ln -s `pwd`/macBinaries/haxe /usr/local/bin/haxe sudo ln -s `pwd`/macBinaries/haxelib /usr/local/bin/haxelib sudo ln -s `pwd`/macBinaries/std /usr/local/share/haxe/std - + - name: Print Haxe version run: haxe -version - + - name: Setup haxelib run: | set -ex mkdir ~/haxelib haxelib setup ~/haxelib - + - name: Install homebrew packages if: matrix.BREW_PACKAGES run: brew install ${{matrix.BREW_PACKAGES}} - + - name: Test run: | # disable invalid Unicode filenames on APFS echo "" > sys/compile-fs.hxml haxe RunCi.hxml working-directory: ${{github.workspace}}/tests - + deploy: if: github.event_name != 'pull_request' diff -Nru haxe-4.2.0/opam haxe-4.2.1/opam --- haxe-4.2.0/opam 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/opam 2021-02-27 07:44:53.000000000 +0000 @@ -1,6 +1,6 @@ opam-version: "2.0" name: "haxe" -version: "4.2.0" +version: "4.2.1" synopsis: "Multi-target universal programming language" description: """ Haxe is an open source toolkit based on a modern, diff -Nru haxe-4.2.0/src/core/globals.ml haxe-4.2.1/src/core/globals.ml --- haxe-4.2.0/src/core/globals.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/core/globals.ml 2021-02-27 07:44:53.000000000 +0000 @@ -24,7 +24,7 @@ | Hl | Eval -let version = 4200 +let version = 4201 let version_major = version / 1000 let version_minor = (version mod 1000) / 100 let version_revision = (version mod 100) diff -Nru haxe-4.2.0/src/generators/gencpp.ml haxe-4.2.1/src/generators/gencpp.ml --- haxe-4.2.0/src/generators/gencpp.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/generators/gencpp.ml 2021-02-27 07:44:53.000000000 +0000 @@ -2636,7 +2636,7 @@ else if fieldName="cca" && obj.cpptype=TCppString then CppFunction( FuncInternal(obj,"cca","."), TCppScalar("int")), TCppDynamic else if fieldName="__s" && obj.cpptype=TCppString then - CppVar( VarInternal(obj,".","utf8_str()")), TCppPointer("ConstPointer", TCppScalar("char")) + CppVar( VarInternal(obj,".","utf8_str()")), TCppRawPointer("const ", TCppScalar("char")) else if fieldName="__Index" then CppEnumIndex(obj), TCppScalar("int") else if is_internal_member fieldName || cpp_is_real_array obj then begin diff -Nru haxe-4.2.0/src/generators/genhl.ml haxe-4.2.1/src/generators/genhl.ml --- haxe-4.2.0/src/generators/genhl.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/generators/genhl.ml 2021-02-27 07:44:53.000000000 +0000 @@ -2599,6 +2599,11 @@ free ctx env; op ctx (OInstanceClosure (r, fid, env))); r + (* throwing a catch var means we want to rethrow an exception *) + | TThrow ({ eexpr = TLocal v } as e1) when has_var_flag v VCaught -> + let r = alloc_tmp ctx HVoid in + op ctx (ORethrow (eval_to ctx e1 HDyn)); + r | TThrow v -> op ctx (OThrow (eval_to ctx v HDyn)); alloc_tmp ctx HDyn diff -Nru haxe-4.2.0/src/generators/genphp7.ml haxe-4.2.1/src/generators/genphp7.ml --- haxe-4.2.0/src/generators/genphp7.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/generators/genphp7.ml 2021-02-27 07:44:53.000000000 +0000 @@ -502,16 +502,16 @@ *) let create_dir_recursive (path:string list) = let rec create dir nested_dirs = + let dir = Path.remove_trailing_slash dir in if not (Sys.file_exists dir) then (Unix.mkdir dir 0o755); match nested_dirs with - | [] -> (); + | [] -> dir | next :: rest -> create (dir ^ "/" ^ next) rest in match path with | [] -> ""; | root :: rest -> - create root rest; - (String.concat "/" path) + create root rest (** @return String representation of specified type path. E.g. returns "\example\Test" for (["example"], "Test") @@ -3933,7 +3933,7 @@ class generator (ctx:php_generator_context) = object (self) val mutable build_dir = "" - val root_dir = ctx.pgc_common.file + val root_dir = Path.remove_trailing_slash ctx.pgc_common.file val mutable init_types = [] val mutable boot : (type_builder * string) option = None val mutable polyfills_source_path : string option = None diff -Nru haxe-4.2.0/src/optimization/analyzerTexpr.ml haxe-4.2.1/src/optimization/analyzerTexpr.ml --- haxe-4.2.0/src/optimization/analyzerTexpr.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/optimization/analyzerTexpr.ml 2021-02-27 07:44:53.000000000 +0000 @@ -538,7 +538,7 @@ | {eexpr = TField (_,fa)} as e1 :: el when PurityState.is_explicitly_impure fa -> block_element (e1 :: acc) el (* no-side-effect *) - | {eexpr = TEnumParameter _ | TEnumIndex _ | TFunction _ | TConst _ | TTypeExpr _} :: el -> + | {eexpr = TFunction _ | TConst _ | TTypeExpr _} :: el -> block_element acc el | {eexpr = TMeta((Meta.Pure,_,_),_)} :: el -> block_element acc el @@ -561,7 +561,7 @@ | None -> block_element (e :: acc) el end (* no-side-effect composites *) - | {eexpr = TParenthesis e1 | TMeta(_,e1) | TCast(e1,None) | TField(e1,_) | TUnop(_,_,e1)} :: el -> + | {eexpr = TParenthesis e1 | TMeta(_,e1) | TCast(e1,None) | TField(e1,_) | TUnop(_,_,e1) | TEnumIndex e1 | TEnumParameter(e1,_,_)} :: el -> block_element acc (e1 :: el) | {eexpr = TArray(e1,e2) | TBinop(_,e1,e2)} :: el -> block_element acc (e1 :: e2 :: el) diff -Nru haxe-4.2.0/src/optimization/inline.ml haxe-4.2.1/src/optimization/inline.ml --- haxe-4.2.0/src/optimization/inline.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/optimization/inline.ml 2021-02-27 07:44:53.000000000 +0000 @@ -483,8 +483,7 @@ set_inlined_vars args1 args2; Some vthis - method finalize config e tl tret p = - let has_params,map_type = match config with Some config -> config | None -> inline_default_config cf ethis.etype in + method finalize e tl tret has_params map_type p = if self#had_side_effect then List.iter (fun (l,e) -> if self#might_be_affected e && not (ExtType.has_value_semantics e.etype) then l.i_force_temp <- true; ) _inlined_vars; @@ -650,7 +649,8 @@ | None -> raise Exit | Some e -> Some e) with Exit -> - let params = inline_rest_params ctx f params p in + let has_params,map_type = match config with Some config -> config | None -> inline_default_config cf ethis.etype in + let params = inline_rest_params ctx f params map_type p in let state = new inline_state ctx ethis params cf f p in let vthis_opt = state#initialize in let opt f = function @@ -849,7 +849,7 @@ | _ -> [] in let tl = arg_types params f.tf_args in - let e = state#finalize config e tl tret p in + let e = state#finalize e tl tret has_params map_type p in if Meta.has (Meta.Custom ":inlineDebug") ctx.meta then begin let se t = s_expr_pretty true t true (s_type (print_context())) in print_endline (Printf.sprintf "Inline %s:\n\tArgs: %s\n\tExpr: %s\n\tResult: %s" @@ -884,7 +884,7 @@ in type_inline ctx cf tf ethis el ctx.t.tvoid None po true -and inline_rest_params ctx f params p = +and inline_rest_params ctx f params map_type p = if not ctx.com.config.pf_supports_rest_args then params else @@ -897,16 +897,23 @@ | [{ eexpr = TUnop(Spread,Prefix,e) }] -> [e] (* In other cases: `haxe.Rest.of([param1, param2, ...])` *) | _ -> - match follow v.v_type with - | TAbstract ({ a_path = ["haxe"],"Rest"; a_impl = Some c } as a, [t]) as rest_t -> + match follow (map_type v.v_type) with + | TAbstract ({ a_path = ["haxe"],"Rest"; a_impl = Some c } as a, [t]) -> let cf = try PMap.find "of" c.cl_statics with Not_found -> die ~p:c.cl_name_pos "Can't find haxe.Rest.of function" __LOC__ and p = punion_el (List.map (fun e -> (),e.epos) params) in (* [param1, param2, ...] *) - let array = mk (TArrayDecl params) (ctx.t.tarray t) p in + (* If we don't know the type (e.g. the rest argument is a field type parameter) then we need + to find a common type via unify_min. *) + let t_params = match follow t with + | TMono _ -> unify_min ctx params + | _ -> t + in + let array = mk (TArrayDecl params) (ctx.t.tarray t_params) p in (* haxe.Rest.of(array) *) - [make_static_call ctx c cf (apply_params a.a_params [t]) [array] rest_t p] + let e = make_static_call ctx c cf (apply_params a.a_params [t]) [array] (TAbstract(a,[t_params])) p in + [e] | _ -> die ~p:v.v_pos "Unexpected rest arguments type" __LOC__ ) diff -Nru haxe-4.2.0/src/typing/callUnification.ml haxe-4.2.1/src/typing/callUnification.ml --- haxe-4.2.0/src/typing/callUnification.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/typing/callUnification.ml 2021-02-27 07:44:53.000000000 +0000 @@ -106,18 +106,30 @@ in (* these platforms deal with rest args on their own *) if ctx.com.config.pf_supports_rest_args then + let type_rest t = + List.map (fun e -> + match e with + | (EUnop (Spread,Prefix,_),p) -> unexpected_spread p + | _ -> type_against name (t()) e + ) el + in match el with | [(EUnop (Spread,Prefix,e),p)] -> (try [mk (TUnop (Spread, Prefix, type_against name t e)) t p] with WithTypeError(ul,p) -> arg_error ul name false p) + | _ when ExtType.is_mono (follow arg_t) -> + (try + let el = type_rest mk_mono in + try + Type.unify arg_t (unify_min ctx el); + el + with Unify_error _ -> + die ~p:callp "Unexpected unification error" __LOC__ + with WithTypeError(ul,p) -> + arg_error ul name false p) | _ -> (try - List.map (fun e -> - match e with - | (EUnop (Spread,Prefix,_),p) -> - unexpected_spread p - | _ -> type_against name arg_t e - ) el + type_rest (fun() -> arg_t) with WithTypeError(ul,p) -> arg_error ul name false p) (* for other platforms make sure rest arguments are wrapped in an array *) diff -Nru haxe-4.2.0/src/typing/finalization.ml haxe-4.2.1/src/typing/finalization.ml --- haxe-4.2.0/src/typing/finalization.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/typing/finalization.ml 2021-02-27 07:44:53.000000000 +0000 @@ -59,17 +59,10 @@ [main; call_static (["haxe"],"EntryPoint") "run"] with Not_found -> [main] - and add_entry_point_init main = - try - [call_static (["haxe"],"EntryPoint") "init"; main] - with Not_found -> - [main] - in (* add calls for event loop *) - let add_event_loop main = + and add_event_loop main = (try - let thread = (["sys";"thread";"_Thread"],"Thread_Impl_") in - call_static thread "initEventLoop" :: add_entry_point_init main @ [call_static thread "processEvents"] + [main; call_static (["sys";"thread";"_Thread"],"Thread_Impl_") "processEvents"] with Not_found -> [main] ) diff -Nru haxe-4.2.0/src/typing/matcher.ml haxe-4.2.1/src/typing/matcher.ml --- haxe-4.2.0/src/typing/matcher.ml 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/src/typing/matcher.ml 2021-02-27 07:44:53.000000000 +0000 @@ -383,7 +383,7 @@ | Bad_pattern s -> error s p end | EArrayDecl el -> - let rec pattern t = match follow t with + let rec pattern seen t = match follow t with | TFun(tl,tr) when tr == fake_tuple_type -> let rec loop el tl = match el,tl with | e :: el,(_,_,t) :: tl -> @@ -400,15 +400,15 @@ make pctx false t2 e ) el in PatConstructor(con_array (List.length patterns) (pos e),patterns) - | TAbstract(a,tl) -> + | TAbstract(a,tl) as t when not (List.exists (fun t' -> shallow_eq t t') seen) -> begin match TyperBase.get_abstract_froms a tl with - | [t2] -> pattern t2 + | [t2] -> pattern (t :: seen) t2 | _ -> fail() end | _ -> fail() in - pattern t + pattern [] t | EObjectDecl fl -> let known_fields = ref [] in let collect_field cf t filter = match filter with diff -Nru haxe-4.2.0/std/cpp/Int64.hx haxe-4.2.1/std/cpp/Int64.hx --- haxe-4.2.0/std/cpp/Int64.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/cpp/Int64.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,4 +22,14 @@ package cpp; -@:coreType @:notNull @:runtimeValue abstract Int64 from Int to Int {} +@:coreType @:notNull @:runtimeValue abstract Int64 from Int to Int { + @:to + #if !cppia inline #end function toInt64():haxe.Int64 { + return cast this; + } + + @:from + static #if !cppia inline #end function ofInt64(x:haxe.Int64):Int64 { + return cast x; + } +} diff -Nru haxe-4.2.0/std/cpp/_std/haxe/Int64.hx haxe-4.2.1/std/cpp/_std/haxe/Int64.hx --- haxe-4.2.0/std/cpp/_std/haxe/Int64.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/cpp/_std/haxe/Int64.hx 2021-02-27 07:44:53.000000000 +0000 @@ -144,16 +144,6 @@ return __Int64.make(high, low); } - @:to - #if !cppia inline #end function toInt64():cpp.Int64 { - return cast this; - } - - @:from - static #if !cppia inline #end function ofInt64(x:cpp.Int64):Int64 { - return cast x; - } - @:from public static #if !cppia inline #end function ofInt(x:Int):Int64 { return __Int64.ofInt(x); diff -Nru haxe-4.2.0/std/cpp/_std/sys/thread/Thread.hx haxe-4.2.1/std/cpp/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/cpp/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/cpp/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,7 +22,9 @@ package sys.thread; -abstract Thread(HaxeThread) from HaxeThread to HaxeThread { +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; public inline function sendMessage(msg:Dynamic):Void { @@ -56,11 +58,6 @@ } @:keep - static function initEventLoop() { - @:privateAccess HaxeThread.current().events = new EventLoop(); - } - - @:keep static public function processEvents() { HaxeThread.current().events.loop(); } @@ -74,10 +71,18 @@ private class HaxeThread { - static final threads = new Array<{thread:HaxeThread, handle:ThreadHandle}>(); - static final threadsMutex = new Mutex(); - static var mainThreadHandle:ThreadHandle = currentHandle(); - static var mainThread:HaxeThread = new HaxeThread(currentHandle()); + static var threads:Array<{thread:HaxeThread, handle:ThreadHandle}>; + static var threadsMutex:Mutex; + static var mainThreadHandle:ThreadHandle; + static var mainThread:HaxeThread; + + static function __init__() { + threads = []; + threadsMutex = new Mutex(); + mainThreadHandle = currentHandle(); + mainThread = new HaxeThread(currentHandle()); + mainThread.events = new EventLoop(); + } public var events(default,null):Null; public var handle:ThreadHandle; diff -Nru haxe-4.2.0/std/cs/_std/sys/thread/Thread.hx haxe-4.2.1/std/cs/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/cs/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/cs/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -23,10 +23,13 @@ package sys.thread; import cs.system.threading.Thread as NativeThread; +import cs.system.threading.Mutex as NativeMutex; import cs.system.WeakReference; import cs.Lib; -abstract Thread(HaxeThread) { +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; inline function new(thread:HaxeThread) { @@ -87,22 +90,26 @@ } @:keep - static function initEventLoop():Void { - @:privateAccess HaxeThread.get(NativeThread.CurrentThread).events = new EventLoop(); - } - - @:keep static function processEvents():Void { HaxeThread.get(NativeThread.CurrentThread).events.loop(); } } private class HaxeThread { - static final mainNativeThread = NativeThread.CurrentThread; - static final mainHaxeThread = new HaxeThread(NativeThread.CurrentThread); - static final threads = new Map(); - static final threadsMutex = new cs.system.threading.Mutex(); - static var allocateCount = 0; + static var mainNativeThread:NativeThread; + static var mainHaxeThread:HaxeThread; + static var threads:Map; + static var threadsMutex:NativeMutex; + static var allocateCount:Int; + + static function __init__() { + threads = new Map(); + threadsMutex = new NativeMutex(); + allocateCount = 0; + mainNativeThread = NativeThread.CurrentThread; + mainHaxeThread = new HaxeThread(NativeThread.CurrentThread); + mainHaxeThread.events = new EventLoop(); + } public final native:NativeThread; public var events(default,null):Null; diff -Nru haxe-4.2.0/std/eval/_std/sys/thread/Thread.hx haxe-4.2.1/std/eval/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/eval/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/eval/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -24,9 +24,15 @@ import eval.vm.NativeThread; -abstract Thread(NativeThread) { +private typedef ThreadImpl = NativeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; + static function __init__() { + NativeThread.self().events = new EventLoop(); + } + inline function new(h:NativeThread):Void { this = h; } @@ -93,12 +99,6 @@ } @:keep - static function initEventLoop() { - NativeThread.self().events = new EventLoop(); - } - - - @:keep static function processEvents():Void { NativeThread.self().events.loop(); } diff -Nru haxe-4.2.0/std/haxe/EntryPoint.hx haxe-4.2.1/std/haxe/EntryPoint.hx --- haxe-4.2.0/std/haxe/EntryPoint.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/haxe/EntryPoint.hx 2021-02-27 07:44:53.000000000 +0000 @@ -36,10 +36,7 @@ #if sys static var mutex = new Mutex(); #if (target.threaded && !cppia) - static var mainThread:Thread; - @:keep static function init() { - mainThread = Thread.current(); - } + static var mainThread:Thread = Thread.current(); #else static var sleepLock = new Lock(); #end diff -Nru haxe-4.2.0/std/haxe/iterators/DynamicAccessKeyValueIterator.hx haxe-4.2.1/std/haxe/iterators/DynamicAccessKeyValueIterator.hx --- haxe-4.2.0/std/haxe/iterators/DynamicAccessKeyValueIterator.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/haxe/iterators/DynamicAccessKeyValueIterator.hx 2021-02-27 07:44:53.000000000 +0000 @@ -48,6 +48,6 @@ **/ public inline function next():{key:String, value:T} { var key = keys[index++]; - return {value: access[key], key: key}; + return {value: (access[key] : T), key: key}; } } diff -Nru haxe-4.2.0/std/haxe/MainLoop.hx haxe-4.2.1/std/haxe/MainLoop.hx --- haxe-4.2.0/std/haxe/MainLoop.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/haxe/MainLoop.hx 2021-02-27 07:44:53.000000000 +0000 @@ -63,9 +63,7 @@ #if (target.threaded && !cppia) static var eventLoopHandler:Null; static var mutex = new sys.thread.Mutex(); - static var mainThread(get,never):Thread; - static inline function get_mainThread():Thread - return @:privateAccess EntryPoint.mainThread; + static var mainThread = Thread.current(); #end static var pending:MainEvent; diff -Nru haxe-4.2.0/std/hl/_std/sys/thread/Thread.hx haxe-4.2.1/std/hl/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/hl/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/hl/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,7 +22,9 @@ package sys.thread; -abstract Thread(HaxeThread) from HaxeThread to HaxeThread { +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; public inline function sendMessage(msg:Dynamic) { @@ -56,11 +58,6 @@ } @:keep - static function initEventLoop() { - @:privateAccess HaxeThread.current().events = new EventLoop(); - } - - @:keep static public function processEvents() { HaxeThread.current().events.loop(); } @@ -69,10 +66,18 @@ private typedef ThreadHandle = hl.Abstract<"hl_thread">; private class HaxeThread { - static final mainThreadHandle:ThreadHandle = currentHandle(); - static final mainThread:HaxeThread = new HaxeThread(); - static final threads = new Array<{thread:HaxeThread, handle:ThreadHandle}>(); - static final threadsMutex = new Mutex(); + static var mainThreadHandle:ThreadHandle; + static var mainThread:HaxeThread; + static var threads:Array<{thread:HaxeThread, handle:ThreadHandle}>; + static var threadsMutex:Mutex; + + static function __init__() { + mainThreadHandle = currentHandle(); + threadsMutex = new Mutex(); + threads = []; + mainThread = new HaxeThread(); + mainThread.events = new EventLoop(); + } public var events(default,null):Null; final messages = new Deque(); diff -Nru haxe-4.2.0/std/java/_std/sys/thread/Thread.hx haxe-4.2.1/std/java/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/java/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/java/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -32,7 +32,9 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.LinkedBlockingDeque; -abstract Thread(HaxeThread) from HaxeThread { +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; inline function new(t:HaxeThread) { @@ -73,11 +75,6 @@ return this.events; } - @:keep - static function initEventLoop() { - @:privateAccess HaxeThread.get(JavaThread.currentThread()).events = new EventLoop(); - } - @:keep //TODO: keep only if events are actually used static function processEvents():Void { current().getHandle().events.loop(); @@ -85,9 +82,16 @@ } private class HaxeThread { - static final nativeThreads = Collections.synchronizedMap(new WeakHashMap()); - static final mainJavaThread = JavaThread.currentThread(); - static final mainHaxeThread = new HaxeThread(); + static var nativeThreads:java.util.Map; + static var mainJavaThread:JavaThread; + static var mainHaxeThread:HaxeThread; + + static function __init__() { + nativeThreads = Collections.synchronizedMap(new WeakHashMap()); + mainJavaThread = JavaThread.currentThread(); + mainHaxeThread = new HaxeThread(); + mainHaxeThread.events = new EventLoop(); + } public final messages = new LinkedBlockingDeque(); diff -Nru haxe-4.2.0/std/neko/_std/sys/thread/Thread.hx haxe-4.2.1/std/neko/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/neko/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/neko/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,7 +22,9 @@ package sys.thread; -abstract Thread(HaxeThread) from HaxeThread to HaxeThread { +private typedef ThreadImpl = HaxeThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; @@ -57,11 +59,6 @@ } @:keep - static function initEventLoop() { - @:privateAccess HaxeThread.current().events = new EventLoop(); - } - - @:keep static function processEvents() { HaxeThread.current().events.loop(); } @@ -74,16 +71,30 @@ private typedef ThreadHandle = NativeThreadHandle; private class HaxeThread { - static var thread_create:(callb:(_:Dynamic)->Void, _:Dynamic)->ThreadHandle = neko.Lib.load("std", "thread_create", 2); - static var thread_current:()->ThreadHandle = neko.Lib.load("std", "thread_current", 0); - static var thread_send:(handle:ThreadHandle, msg:Dynamic)->Void = neko.Lib.load("std", "thread_send", 2); - static var thread_read_message:(block:Bool)->Dynamic = neko.Lib.load("std", "thread_read_message", 1); - - static var mainThreadHandle = thread_current(); - static var mainThread = new HaxeThread(mainThreadHandle); + static var thread_create:(callb:(_:Dynamic)->Void, _:Dynamic)->ThreadHandle; + static var thread_current:()->ThreadHandle; + static var thread_send:(handle:ThreadHandle, msg:Dynamic)->Void; + static var thread_read_message:(block:Bool)->Dynamic; + + static var mainThreadHandle:ThreadHandle; + static var mainThread:HaxeThread; + + static var threads:Array<{thread:HaxeThread, handle:ThreadHandle}>; + static var threadsMutex:Mutex; + + static function __init__() { + thread_create = neko.Lib.load("std", "thread_create", 2); + thread_current = neko.Lib.load("std", "thread_current", 0); + thread_send = neko.Lib.load("std", "thread_send", 2); + thread_read_message = neko.Lib.load("std", "thread_read_message", 1); + + mainThreadHandle = thread_current(); + mainThread = new HaxeThread(mainThreadHandle); + mainThread.events = new EventLoop(); - static final threads = new Array<{thread:HaxeThread, handle:ThreadHandle}>(); - static final threadsMutex = new Mutex(); + threads = []; + threadsMutex = new Mutex(); + } public var events(default,null):Null; public var handle:ThreadHandle; diff -Nru haxe-4.2.0/std/php/Global.hx haxe-4.2.1/std/php/Global.hx --- haxe-4.2.0/std/php/Global.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/php/Global.hx 2021-02-27 07:44:53.000000000 +0000 @@ -1838,4 +1838,10 @@ @see http://php.net/manual/en/function.filter-var.php **/ static function filter_var(value: Any, ?filter:Int, ?options: EitherType, Int>):Dynamic; + + /** + @see http://php.net/manual/en/function.number-format.php + **/ + static function number_format(num:Float, ?decimals:Int, ?decimal_separator:String, ?thousands_separator:String):String; + } diff -Nru haxe-4.2.0/std/python/_std/sys/thread/Lock.hx haxe-4.2.1/std/python/_std/sys/thread/Lock.hx --- haxe-4.2.0/std/python/_std/sys/thread/Lock.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/python/_std/sys/thread/Lock.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,14 +22,20 @@ package sys.thread; -@:forward(release) -abstract Lock(NativeSemaphore) { +@:coreApi +class Lock { + final semaphore:NativeSemaphore; + public inline function new() { - this = new NativeSemaphore(0); + semaphore = new NativeSemaphore(0); } public inline function wait(?timeout:Float):Bool { - return this.acquire(true, timeout); + return semaphore.acquire(true, timeout); + } + + public inline function release():Void { + semaphore.release(); } } diff -Nru haxe-4.2.0/std/python/_std/sys/thread/Mutex.hx haxe-4.2.1/std/python/_std/sys/thread/Mutex.hx --- haxe-4.2.0/std/python/_std/sys/thread/Mutex.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/python/_std/sys/thread/Mutex.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,23 +22,29 @@ package sys.thread; -@:forward("release") -abstract Mutex(NativeRLock) { - inline public function new() { - this = new NativeRLock(); +@:coreApi +class Mutex { + final lock:NativeRLock; + + inline public function new():Void { + lock = new NativeRLock(); } inline public function acquire():Void { - this.acquire(true); + lock.acquire(true); } inline public function tryAcquire():Bool { - return this.acquire(false); + return lock.acquire(false); + } + + inline public function release():Void { + lock.release(); } } @:pythonImport("threading", "RLock") -extern class NativeRLock { +private extern class NativeRLock { function new():Void; function acquire(blocking:Bool):Bool; function release():Void; diff -Nru haxe-4.2.0/std/python/_std/sys/thread/Thread.hx haxe-4.2.1/std/python/_std/sys/thread/Thread.hx --- haxe-4.2.0/std/python/_std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/python/_std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -22,7 +22,11 @@ package sys.thread; -abstract Thread(HxThread) from HxThread { +import haxe.ds.ObjectMap; + +private typedef ThreadImpl = HxThread; + +abstract Thread(ThreadImpl) from ThreadImpl { public var events(get,never):EventLoop; public static inline function current():Thread { @@ -56,11 +60,6 @@ } @:keep - static function initEventLoop() { - @:privateAccess HxThread.current().events = new EventLoop(); - } - - @:keep static public function processEvents() { HxThread.current().events.loop(); } @@ -72,9 +71,16 @@ final nativeThread:NativeThread; final messages = new Deque(); - static var threads = new haxe.ds.ObjectMap(); - static var threadsMutex: Mutex = new Mutex(); - static var mainThread: HxThread; + static var threads:ObjectMap; + static var threadsMutex:Mutex; + static var mainThread:HxThread; + + static function __init__() { + threads = new ObjectMap(); + threadsMutex = new Mutex(); + mainThread = new HxThread(PyThreadingAPI.current_thread()); + mainThread.events = new EventLoop(); + } private function new(t:NativeThread) { nativeThread = t; @@ -88,7 +94,6 @@ threadsMutex.acquire(); var ct = PyThreadingAPI.current_thread(); if (ct == PyThreadingAPI.main_thread()) { - if (mainThread == null) mainThread = new HxThread(ct); threadsMutex.release(); return mainThread; } diff -Nru haxe-4.2.0/std/sys/thread/Thread.hx haxe-4.2.1/std/sys/thread/Thread.hx --- haxe-4.2.0/std/sys/thread/Thread.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/std/sys/thread/Thread.hx 2021-02-27 07:44:53.000000000 +0000 @@ -26,7 +26,9 @@ #error "This class is not available on this target" #end -extern abstract Thread({}) { +private typedef ThreadImpl = {}; + +extern abstract Thread(ThreadImpl) from ThreadImpl { /** Event loop of this thread (if available). @@ -75,11 +77,6 @@ public static function readMessage(block:Bool):Dynamic; /** - Initialize event loop in this thread - **/ - private static function initEventLoop():Void; - - /** Run event loop of the current thread **/ private static function processEvents():Void; diff -Nru haxe-4.2.0/tests/Brewfile haxe-4.2.1/tests/Brewfile --- haxe-4.2.0/tests/Brewfile 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/tests/Brewfile 2021-02-27 07:44:53.000000000 +0000 @@ -2,9 +2,6 @@ brew "camlp5" brew "opam" brew "ninja" -brew "zlib" -brew "pcre" brew "awscli" brew "cmake" -brew "pkg-config" -brew "mbedtls" \ No newline at end of file +brew "pkg-config" \ No newline at end of file diff -Nru haxe-4.2.0/tests/threads/src/cases/TestMainLoop.hx haxe-4.2.1/tests/threads/src/cases/TestMainLoop.hx --- haxe-4.2.0/tests/threads/src/cases/TestMainLoop.hx 2021-02-12 04:58:23.000000000 +0000 +++ haxe-4.2.1/tests/threads/src/cases/TestMainLoop.hx 2021-02-27 07:44:53.000000000 +0000 @@ -5,6 +5,31 @@ @:timeout(10000) @:depends(cases.TestEvents) class TestMainLoop extends utest.Test { + @:keep static var init = MainLoop.add(() -> { + staticInit = true; + init.stop(); + }); + static var staticInit = false; + + function testWorksInStaticInits_issue10114(async:Async) { + var mainThread = Thread.current(); + var checkAttempts = 3; + function check() { + checkAttempts++; + if(staticInit) { + pass(); + async.done(); + } else if(checkAttempts > 0) { + checkAttempts--; + mainThread.events.run(check); + } else { + fail(); + async.done(); + } + } + mainThread.events.run(check); + } + function testNewAction_immediately(async:Async) { var e1:MainEvent = null; e1 = MainLoop.add(() -> { diff -Nru haxe-4.2.0/tests/unit/src/unit/issues/Issue10032.hx haxe-4.2.1/tests/unit/src/unit/issues/Issue10032.hx --- haxe-4.2.0/tests/unit/src/unit/issues/Issue10032.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.2.1/tests/unit/src/unit/issues/Issue10032.hx 2021-02-27 07:44:53.000000000 +0000 @@ -0,0 +1,21 @@ +package unit.issues; + +private enum Foo { + A; + B; +} + +class Issue10032 extends Test { + static var a:Foo = A; + + static function onChange(v:Foo) + switch a = v { + case A: // Commenting out this line fixes the issue. + case _: + } + + function test() { + onChange(B); + t(a == B); + } +} diff -Nru haxe-4.2.0/tests/unit/src/unit/issues/Issue10109.hx haxe-4.2.1/tests/unit/src/unit/issues/Issue10109.hx --- haxe-4.2.0/tests/unit/src/unit/issues/Issue10109.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.2.1/tests/unit/src/unit/issues/Issue10109.hx 2021-02-27 07:44:53.000000000 +0000 @@ -0,0 +1,26 @@ +package unit.issues; + +class Issue10109 extends Test { +#if hl + @:pure(false) + static function foo( o : String ) { + return o.length; + } + + function test() { + try { + try { + foo(null); + } catch( e : Stop ) { + } + assert(); + } catch(e) { + t(e.stack.length > 0); + } + } +#end +} + +private enum Stop { + A; +} diff -Nru haxe-4.2.0/tests/unit/src/unit/issues/Issue10124.hx haxe-4.2.1/tests/unit/src/unit/issues/Issue10124.hx --- haxe-4.2.0/tests/unit/src/unit/issues/Issue10124.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.2.1/tests/unit/src/unit/issues/Issue10124.hx 2021-02-27 07:44:53.000000000 +0000 @@ -0,0 +1,40 @@ +package unit.issues; + +import utest.Assert; + +using unit.issues.Issue10124.Util; + +private class Util { + public static inline function add(arr:Array,...values:T) { + for (v in values) + arr.push(v); + } + + public static inline function addFloat(arr:Array,...values:Float) { + for (v in values) + arr.push(v); + } +} + +class Issue10124 extends Test { + function test1() { + var arr = [1, 3, 4]; + arr.add(5, 6, 7); + Assert.same([1, 3, 4, 5, 6, 7], arr); + } + + function test2() { + var arr = [1, 3, 4]; + arr.addFloat(5, 6, 7); + Assert.same([1, 3, 4, 5, 6, 7], arr); + } + + function test3() { + function rest(...values:T):Array { + return values.toArray(); + } + var a = rest(5, 6.2, 7); + aeq([5, 6.2, 7], a); + eq('Array', HelperMacros.typeString(a)); + } +}