Skip to content

Commit

Permalink
Merge branch 'development' into out_of_curiosity_(don't_freak_out)
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/main.yml
#	libs/ilib/dune
#	libs/ilib/peReader.ml
#	libs/javalib/dune
#	src-json/define.json
#	src/codegen/dotnet.ml
#	src/codegen/gencommon/castDetect.ml
#	src/codegen/gencommon/closuresToClass.ml
#	src/codegen/gencommon/dynamicFieldAccess.ml
#	src/codegen/gencommon/dynamicOperators.ml
#	src/codegen/gencommon/enumToClass.ml
#	src/codegen/gencommon/enumToClass2.ml
#	src/codegen/gencommon/expressionUnwrap.ml
#	src/codegen/gencommon/filterClosures.ml
#	src/codegen/gencommon/fixOverrides.ml
#	src/codegen/gencommon/gencommon.ml
#	src/codegen/gencommon/initFunction.ml
#	src/codegen/gencommon/overloadingConstructor.ml
#	src/codegen/gencommon/realTypeParams.ml
#	src/codegen/gencommon/reflectionCFs.ml
#	src/codegen/gencommon/switchToIf.ml
#	src/codegen/gencommon/unnecessaryCastsRemoval.ml
#	src/codegen/gencommon/unreachableCodeEliminationSynf.ml
#	src/codegen/java.ml
#	src/codegen/javaModern.ml
#	src/context/common.ml
#	src/dune
#	src/filters/filters.ml
#	src/generators/gencs.ml
#	src/generators/genjava.ml
#	src/generators/genshared.ml
#	src/optimization/analyzerTexpr.ml
#	src/typing/matcher.ml
#	src/typing/typeloadCheck.ml
#	src/typing/typeloadFields.ml
#	src/typing/typeloadModule.ml
#	src/typing/typer.ml
#	std/cs/_std/Type.hx
#	tests/server/src/cases/ServerTests.hx
  • Loading branch information
Simn committed Oct 25, 2023
2 parents 52ab48e + 3482f68 commit f1acd1a
Show file tree
Hide file tree
Showing 511 changed files with 10,392 additions and 8,083 deletions.
228 changes: 130 additions & 98 deletions .github/workflows/main.yml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .vscode/schemas/define.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
"reserved": {
"type": "boolean",
"markdownDescription": "Reserved defines may not be defined from the command line."
},
"deprecated": {
"type": "string",
"markdownDescription": "Reason for the define to be deprecated."
}
},
"required": [
Expand Down
5 changes: 4 additions & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ devcontainer:
RUN git config --global codespaces-theme.hide-status 1

# Install OCaml libraries
COPY opam .
COPY haxe.opam .
RUN opam init --disable-sandboxing
RUN opam switch create 4.08.1
RUN eval $(opam env)
RUN opam env
RUN opam install . --yes --deps-only --no-depexts
RUN opam list
RUN ocamlopt -v
Expand Down
2 changes: 1 addition & 1 deletion Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ package_choco:
rm -rf out/choco

$(INSTALLER_TMP_DIR)/neko-win.zip: $(INSTALLER_TMP_DIR)
wget -nv https://github.com/HaxeFoundation/neko/releases/download/$(NEKO_VERSION_TAG)/neko-$(NEKO_VERSION)-win$(NEKO_ARCH_STR).zip -O installer/neko-win.zip
curl -L https://github.com/HaxeFoundation/neko/releases/download/$(NEKO_VERSION_TAG)/neko-$(NEKO_VERSION)-win$(NEKO_ARCH_STR).zip -o installer/neko-win.zip

package_installer_win: $(INSTALLER_TMP_DIR)/neko-win.zip package_win
$(eval OUTFILE := $(PACKAGE_OUT_DIR)/$(PACKAGE_FILE_NAME)_installer.zip)
Expand Down
3 changes: 2 additions & 1 deletion dune
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
(data_only_dirs extra lib std tests)
(dirs :standard \ tests std extra)
(data_only_dirs lib)
2 changes: 1 addition & 1 deletion extra/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You need to install some native libraries as well as some OCaml libraries.
To install the native libraries, use the appropriate system package manager.

* Mac OS X
* Use [Homebrew](https://brew.sh/), `brew install zlib pcre2`.
* Use [Homebrew](https://brew.sh/), `brew install zlib pcre2 mbedtls@2`.
* Debian / Ubuntu
* `sudo apt install libpcre2-dev zlib1g-dev libmbedtls-dev`.
* Windows (Cygwin)
Expand Down
51 changes: 50 additions & 1 deletion extra/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,53 @@
2023-04-06: 4.3.0
2023-09-01 4.3.2

General improvements:

all : do not raise error on no-op reification outside macro

Bugfixes:

all : don't infer Null<?> if it already is Null<?> (#11286)
all : fix ?? inference and precedence (#11252)
all : bring back forced inline (#11217)
all : allow non constant "inline" var init with -D no-inline (#11192)
all : improve @:enum abstract deprecation warning handling (#11302)
all : fix some stack overflow with pretty errors
display : fix go to definition with final (#11173)
display : fix completion requests with @:forwardStatics (#11294)
eval : fix MainLoop.add not repeating (#11202)
hl/eval/neko : fix exception stack when wrapping native exceptions (#11249)
macro : map `this` when restoring typed expressions (#11212)
macro : safe navigation fix for ExprTools.map (#11204)
macro : safe navigation fix for haxe.macro.Printer (#11206)
macro : macro generated EVars position fixes (#11163)
macro : fix abstract casts for local statics (#11301)
macro : add flags to TDAbstract to be able to construct enum abstracts (#11230)
nullsafety : make break/continue expressions not-nullable (#11269)
nullsafety : handle return in assignment (#11114)

2023-04-28 4.3.1

Breaking changes:

all : namespace message reporting defines (#11142)

General improvements:

all : support deprecation for defines

Bugfixes:

all : fix --times with compilation server (#11091)
all : fix default type parameters not respecting imports (#11161)
all : fix bytecode bindings issues (#11098)
macro : allow local statics in macro functions (#11096)
cpp : fix AtomicInt warnings on cppia (#11105)
cpp : fix deprecated implicit casts of cpp.Int64 (#10998)
cpp : add white space around template type syntax (#11107)
java : don't check native signatures on extern functions (#11131)
lua : remove non existent luautf8 charCodeAt extern (#11097)

2023-04-06 4.3.0

New features:

Expand Down
2 changes: 1 addition & 1 deletion extra/EnvVarUpdate.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
!ifndef Un${StrFuncName}_INCLUDED
${Un${StrFuncName}}
!endif
!define un.${StrFuncName} "${Un${StrFuncName}}"
!define un.${StrFuncName} '${Un${StrFuncName}}'
!macroend

!insertmacro _IncludeStrFunction StrTok
Expand Down
75 changes: 37 additions & 38 deletions extra/ImportAll.hx
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ class ImportAll {
static function isSysTarget() {
return Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ||
Context.defined("java") || Context.defined("python") ||
Context.defined("lua") || Context.defined("hl") || Context.defined("eval"); // TODO: have to add cs here, SPOD gets in the way at the moment
Context.defined("lua") || Context.defined("hl") || Context.defined("eval");
}

public static function run( ?pack ) {
if( pack == null ) {
pack = "";
haxe.macro.Compiler.define("doc_gen");
}
if (Context.defined("interp")) {
haxe.macro.Compiler.define("macro");
}
switch( pack ) {
case "php":
if( !Context.defined("php") ) return;
Expand Down Expand Up @@ -72,42 +69,44 @@ class ImportAll {
if (!Context.defined("neko") && !Context.defined("cpp")) return;
case "tools", "build-tool", "jar-tool": return;
}
for( p in Context.getClassPath() ) {
if( p == "/" || p == "" )
continue;
// skip if we have a classpath to haxe
if( pack.length == 0 && sys.FileSystem.exists(p+"std") )
continue;
var p = p + pack.split(".").join("/");
if( StringTools.endsWith(p,"/") )
p = p.substr(0,-1);
if( !sys.FileSystem.exists(p) || !sys.FileSystem.isDirectory(p) )
continue;
for( file in sys.FileSystem.readDirectory(p) ) {
if( file == ".svn" || file == "_std" )
Context.onAfterInitMacros(() -> {
for( p in Context.getClassPath() ) {
if( p == "/" || p == "" )
continue;
// skip if we have a classpath to haxe
if( pack.length == 0 && sys.FileSystem.exists(p+"std") )
continue;
var full = (pack == "") ? file : pack + "." + file;
if( StringTools.endsWith(file, ".hx") && file.substr(0, file.length - 3).indexOf(".") < 0 ) {
var cl = full.substr(0, full.length - 3);
switch( cl ) {
case "ImportAll", "neko.db.MacroManager": continue;
case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ) continue;
case "Sys": if(!isSysTarget()) continue;
case "haxe.web.Request": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("js")) ) continue;
case "haxe.macro.ExampleJSGenerator","haxe.macro.Context", "haxe.macro.Compiler": if( !Context.defined("eval") ) continue;
case "haxe.remoting.SocketWrapper": if( !Context.defined("flash") ) continue;
case "haxe.remoting.SyncSocketConnection": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("cpp")) ) continue;
case "neko.vm.Ui" | "sys.db.Sqlite" | "sys.db.Mysql" if ( Context.defined("interp") ): continue;
case "sys.db.Sqlite" | "sys.db.Mysql" | "cs.db.AdoNet" if ( Context.defined("cs") ): continue;
case "haxe.atomic.AtomicBool" if(!Context.defined("target.atomics")): continue;
case "haxe.atomic.AtomicInt" if(!Context.defined("target.atomics")): continue;
case "haxe.atomic.AtomicObject" if(!Context.defined("target.atomics") || Context.defined("js") || Context.defined("cpp")): continue;
}
Context.getModule(cl);
} else if( sys.FileSystem.isDirectory(p + "/" + file) )
run(full);
var p = p + pack.split(".").join("/");
if( StringTools.endsWith(p,"/") )
p = p.substr(0,-1);
if( !sys.FileSystem.exists(p) || !sys.FileSystem.isDirectory(p) )
continue;
for( file in sys.FileSystem.readDirectory(p) ) {
if( file == ".svn" || file == "_std" )
continue;
var full = (pack == "") ? file : pack + "." + file;
if( StringTools.endsWith(file, ".hx") && file.substr(0, file.length - 3).indexOf(".") < 0 ) {
var cl = full.substr(0, full.length - 3);
switch( cl ) {
case "ImportAll", "neko.db.MacroManager": continue;
case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ) continue;
case "Sys": if(!isSysTarget()) continue;
case "haxe.web.Request": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("js")) ) continue;
case "haxe.macro.ExampleJSGenerator","haxe.macro.Context", "haxe.macro.Compiler": if( !Context.defined("eval") ) continue;
case "haxe.remoting.SocketWrapper": if( !Context.defined("flash") ) continue;
case "haxe.remoting.SyncSocketConnection": if( !(Context.defined("neko") || Context.defined("php") || Context.defined("cpp")) ) continue;
case "neko.vm.Ui" | "sys.db.Sqlite" | "sys.db.Mysql" if ( Context.defined("interp") ): continue;
case "sys.db.Sqlite" | "sys.db.Mysql" | "cs.db.AdoNet" if ( Context.defined("cs") ): continue;
case "haxe.atomic.AtomicBool" if(!Context.defined("target.atomics")): continue;
case "haxe.atomic.AtomicInt" if(!Context.defined("target.atomics")): continue;
case "haxe.atomic.AtomicObject" if(!Context.defined("target.atomics") || Context.defined("js") || Context.defined("cpp")): continue;
}
Context.getModule(cl);
} else if( sys.FileSystem.isDirectory(p + "/" + file) )
run(full);
}
}
}
});
}

}
7 changes: 3 additions & 4 deletions extra/github-actions/build-mac.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: Install dependencies
env:
# For compatibility with macOS 10.13
ZLIB_VERSION: 1.2.13
ZLIB_VERSION: 1.3
MBEDTLS_VERSION: 2.25.0
PCRE2_VERSION: 10.42
run: |
Expand Down Expand Up @@ -32,14 +32,13 @@
make && make install
cd ..
- name: Install OCaml libraries
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
set -ex
opam init # --disable-sandboxing
opam update
opam switch create 4.07.1
opam switch create 4.08.1
eval $(opam env)
opam env
opam pin add ctypes 0.17.1 --yes
Expand All @@ -64,7 +63,7 @@
otool -L ./haxelib
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v3
with:
name: macBinaries
path: out
9 changes: 8 additions & 1 deletion extra/github-actions/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && cygcheck ./haxelib.exe')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && ls ./out')
- name: Check artifact
shell: bash
run: |
ls out
# Output should contain binaries zip, installer zip and nupkg
[ $(ls -1 out | wc -l) -eq "3" ]
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v3
with:
name: win${{env.ARCH}}Binaries
path: out
6 changes: 0 additions & 6 deletions extra/github-actions/cache-opam.yml

This file was deleted.

6 changes: 4 additions & 2 deletions extra/github-actions/install-nsis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
- name: choco install nsis
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.02 -y
command: choco install --no-progress nsis.portable --version 3.09 -y

- name: choco install things
shell: pwsh
run: choco install --no-progress curl wget 7zip.portable -y

- name: Prepend Chocolatey path
shell: pwsh
run: Write-Host "::add-path::C:\ProgramData\chocolatey\bin"
9 changes: 2 additions & 7 deletions extra/github-actions/install-ocaml-libs-windows.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
- name: Install OCaml libraries
if: steps.cache-opam.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSDebug -Trace 1
& "$($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 install haxe --deps-only --yes 2>&1')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'opam list')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'ocamlopt -v')
opam install haxe --deps-only
opam list
38 changes: 30 additions & 8 deletions extra/github-actions/install-ocaml-windows.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
- name: Install OCaml
- name: Setup ocaml
id: ocaml
continue-on-error: true
uses: kLabz/setup-ocaml@win32
with:
ocaml-compiler: 4.08.1
opam-depext: false
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
opam-local-packages: |
haxe.opam
cache-prefix: w32-v1

# TODO make it work on first try
# (when cygwin cache doesn't exist, ocaml install fails with a curl error)
- name: Setup ocaml (second chance)
if: steps.ocaml.outcome == 'failure'
uses: kLabz/setup-ocaml@win32
with:
ocaml-compiler: 4.08.1
opam-depext: false
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
opam-local-packages: |
haxe.opam
cache-prefix: w32-v1

- name: Install dependencies
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 libpcre2-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre2 --allow-unsupported-windows" -Wait -RedirectStandardOutput cygwin-setup-out.txt
Get-Content cygwin-setup-out.txt
& "$($env:CYG_ROOT)/bin/bash.exe" @('--norc', '--noprofile', '/etc/postinstall/ca-certificates.sh')
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')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
18 changes: 11 additions & 7 deletions extra/github-actions/install-ocaml-windows64.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
- name: Install OCaml
- name: Setup ocaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.08.1
opam-repositories: |
opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset
default: https://github.com/ocaml/opam-repository.git
opam-local-packages: |
haxe.opam
- name: Install dependencies
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 libpcre2-devel -P mbedtls-devel -P mingw64-$($env:MINGW_ARCH)-zlib -P mingw64-$($env:MINGW_ARCH)-gcc-core -P mingw64-$($env:MINGW_ARCH)-pcre2" -Wait -RedirectStandardOutput cygwin-setup-out.txt
Get-Content cygwin-setup-out.txt
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')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
& "$($env:CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam${ARCH}/install.sh')
4 changes: 4 additions & 0 deletions extra/github-actions/test-windows.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- uses: actions/setup-node@v3
with:
node-version: 18.17.1

# - name: Quick test
# shell: pwsh
# run: |
Expand Down
Loading

0 comments on commit f1acd1a

Please sign in to comment.