Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asys #8817

Closed
Closed

asys #8817

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
bec9818
libuv stubs, most fs functions
Aurel300 Jul 18, 2019
d68cb64
stat
Aurel300 Jul 18, 2019
b5ab085
fix linking
Aurel300 Jul 18, 2019
7929a23
initial eval code (FileSystem.exists)
Aurel300 Jul 18, 2019
0d81028
first async function, callbacks into Haxe
Aurel300 Jul 19, 2019
05aae0e
improve error handling, more fs work
Aurel300 Jul 22, 2019
eb2d506
report positions in errors
Aurel300 Jul 23, 2019
9af1f9e
less segfaulting, fs watchers, some cleanup and docs
Aurel300 Jul 24, 2019
b4d94d5
more cleanup and docs
Aurel300 Jul 24, 2019
61741df
move uv constants out, simplify stat
Aurel300 Jul 24, 2019
03018ce
close handles properly
Aurel300 Jul 25, 2019
f779f6f
tcp work
Aurel300 Jul 26, 2019
c0f2eb2
TCP, DNS, timers
Aurel300 Aug 6, 2019
3786432
socket options, fix connect
Aurel300 Aug 6, 2019
8ab1bc8
return DNS and scandir results in correct order
Aurel300 Aug 7, 2019
141c67f
unref timers
Aurel300 Aug 7, 2019
cb66ce2
async file operations
Aurel300 Aug 8, 2019
d1f08dc
TCP get(sock|peer)name
Aurel300 Aug 9, 2019
150d11c
read/write -> readBuffer/writeBuffer
Aurel300 Aug 12, 2019
7b379ec
udp stubs
Aurel300 Aug 12, 2019
b211f6b
UDP
Aurel300 Aug 13, 2019
3fded3b
allow run with any mode
Aurel300 Aug 15, 2019
3a0bbea
process stubs
Aurel300 Aug 15, 2019
4e1d1fd
process stdlib
Aurel300 Aug 15, 2019
ede92a0
ref, unref, less code that just casts handles
Aurel300 Aug 16, 2019
4dc047c
pipes
Aurel300 Aug 19, 2019
b7591e7
process close
Aurel300 Aug 19, 2019
2c26275
better pipes and streams
Aurel300 Aug 20, 2019
25e842b
get IPC name
Aurel300 Aug 20, 2019
66beabc
ref/unref UDP sockets
Aurel300 Aug 20, 2019
211e6ee
pass handles via pipes
Aurel300 Aug 21, 2019
4782ace
move to asys package
Aurel300 Sep 9, 2019
0d8bf4a
minor fixes
Aurel300 Sep 16, 2019
6a24d1b
fix dune
Aurel300 Sep 16, 2019
16306c1
macros for allocating/freeing requests
Aurel300 Sep 16, 2019
4da20b8
Merge branch 'development' into feature/eval-libuv
Simn Sep 18, 2019
842dc16
[ci] setup Windows
Simn Sep 19, 2019
61b33de
Merge branch 'development' into feature/eval-libuv
Simn Sep 19, 2019
9f9e810
bring back Sys inclusion hack
Simn Sep 19, 2019
db0d9a0
womp womp
Simn Sep 19, 2019
831123c
fix Std.hx
Simn Sep 19, 2019
6678277
[ci] setup Linux and OS X
Simn Sep 19, 2019
6809c38
[std] add missing get_message
Simn Sep 19, 2019
de2b204
add asys Haxe APIs, asys test suite
Aurel300 Sep 19, 2019
0051e49
minor stubs changes
Aurel300 Sep 19, 2019
6b8a04a
Merge branch 'feature/eval-libuv' of github.com:Aurel300/haxe into fe…
Aurel300 Sep 19, 2019
d33b27c
some test setup fixes
Aurel300 Sep 19, 2019
a229959
fix xmldoc
Aurel300 Sep 19, 2019
a392e9e
skip some tests on Windows
Aurel300 Sep 19, 2019
c4ee323
(revert later) skip docgen
Aurel300 Sep 19, 2019
df401d8
[ci] enable win32 macro tests again
Simn Sep 19, 2019
ef3cdc7
(revert later) ughh
Aurel300 Sep 19, 2019
51b5ecf
don't leave access.txt in read-only so we can clean up
Simn Sep 20, 2019
94755ee
Merge branch 'development' into feature/eval-libuv
Simn Sep 20, 2019
c1e5290
start on dealing with flag values
Simn Sep 20, 2019
3cdbcdf
disable test that's probably invalid on Windows
Simn Sep 20, 2019
ba637ea
adjust tests to windows limitations
Simn Sep 20, 2019
7408547
[ci] install libuv manually on Linux
Aurel300 Sep 20, 2019
d065543
maybe fix Linux ci
Aurel300 Sep 20, 2019
bd97e56
sudo make ci work
Aurel300 Sep 20, 2019
27db9e6
disable watcher test on Linux
Aurel300 Sep 20, 2019
2d54ddc
error code docstrings
Aurel300 Sep 20, 2019
7a8ab7d
(eval) add lchown and copyfile
Aurel300 Sep 20, 2019
4d0270f
no callback on process_kill
Aurel300 Sep 20, 2019
3e5919d
use 32-bit ints for IPv4
Aurel300 Sep 20, 2019
5dbfef6
[libuv] prepare libuv integration
Simn Sep 20, 2019
56ad076
[ci] bring back docgen
Simn Sep 20, 2019
c047d43
...
Simn Sep 20, 2019
4f6d9a5
avoid dll problem
Simn Sep 20, 2019
d3ede31
no target is asys yet
Simn Sep 20, 2019
7b39cf4
cleanup
Simn Sep 20, 2019
3a3ce68
fix pointer warnings
Simn Sep 21, 2019
18f98b5
check for libuv >= 1.31
Simn Sep 21, 2019
1a17c34
close file in FileSystem.writeFile
Simn Sep 21, 2019
1dfb708
add asys define, forbid asys package on all targets for now
Aurel300 Sep 20, 2019
5b1acbc
eval is asys here
Simn Sep 22, 2019
3fa47f5
merge asys.Timer into haxe.Timer
Simn Sep 22, 2019
ba4aae7
run Uv.init/close just once in the asys tests
Simn Sep 22, 2019
0fdd3e8
hijack haxe.EntryPoint to deal with UV initialization
Simn Sep 22, 2019
f03ff69
fix FileWatcherEvent and adjust test
Simn Sep 22, 2019
7cfbb83
use distinct directory per-test
Simn Sep 22, 2019
c67ed00
fix tests
Simn Sep 22, 2019
552e238
don't unlink
Simn Sep 22, 2019
896eba7
remove more random cleanup code
Simn Sep 22, 2019
bd0c345
simplify alloc_data
Aurel300 Sep 23, 2019
2e2f16c
Merge branch 'development' into feature/libuv-prepare
Simn Sep 23, 2019
1a10736
Merge branch 'feature/libuv-prepare' into feature/eval-libuv
Simn Sep 23, 2019
9e53d3c
port server tests to asys
Simn Sep 23, 2019
e8989ae
disable wonky watcher test for now
Simn Sep 23, 2019
f52b2d7
fix haxeserver branch
Simn Sep 23, 2019
5ea451c
check something
Simn Sep 23, 2019
715f8ef
disable unused include
Simn Sep 24, 2019
99a6663
move UV.init to asys.uv.Uv.__init__
Simn Sep 24, 2019
49a40f0
remove imports
Simn Sep 24, 2019
fa74d66
add mutex and TLS externs
Simn Sep 24, 2019
7cd7425
don't allocate so much
Simn Sep 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/libs/xml-light/xml_lexer.ml
/libs/xml-light/xml_parser.ml
/libs/xml-light/xml_parser.mli
/libs/uv/test
/std/tools/haxedoc/haxedoc
/std/tools/haxedoc/haxedoc.n
/std/tools/haxelib/haxelib
Expand Down Expand Up @@ -132,3 +133,4 @@ tests/server/test.js.map
*.merlin
lib.sexp
src/compiler/version.ml
tests/asys/resources-rw/
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ HAXE_VERSION=$(shell $(CURDIR)/$(HAXE_OUTPUT) -version 2>&1 | awk '{print $$1;}'
HAXE_VERSION_SHORT=$(shell echo "$(HAXE_VERSION)" | grep -oE "^[0-9]+\.[0-9]+\.[0-9]+")

ifneq ($(STATICLINK),0)
LIB_PARAMS= -cclib '-Wl,-Bstatic -lpcre -lz -Wl,-Bdynamic '
LIB_PARAMS= -cclib '-Wl,-Bstatic -lpcre -lz -luv -Wl,-Bdynamic '
else
LIB_PARAMS?= -cclib -lpcre -cclib -lz
LIB_PARAMS?= -cclib -lpcre -cclib -lz -cclib -luv
endif

all: haxe tools
Expand Down
2 changes: 1 addition & 1 deletion Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifdef FILTER
CC_CMD=($(COMPILER) $(ALL_CFLAGS) -c $< 2>tmp.cmi && $(FILTER)) || ($(FILTER) && exit 1)
endif

PACKAGE_FILES=$(HAXE_OUTPUT) $(HAXELIB_OUTPUT) std "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep zlib1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libpcre-1.dll | sed -e 's/^\s*//')"
PACKAGE_FILES=$(HAXE_OUTPUT) $(HAXELIB_OUTPUT) std "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep zlib1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libpcre-1.dll | sed -e 's/^\s*//')" "$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libuv-1.dll | sed -e 's/^\s*//')"

echo_package_files:
echo $(PACKAGE_FILES)
Expand Down
6 changes: 6 additions & 0 deletions extra/ImportAll.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ class ImportAll {
Context.defined("lua") || Context.defined("hl") || Context.defined("eval"); // TODO: have to add cs here, SPOD gets in the way at the moment
}

static function isAsysTarget() {
return Context.defined("eval"); // TODO: expand as more targets are integrated
}

public static function run( ?pack ) {
if( pack == null ) {
pack = "";
Expand All @@ -52,6 +56,8 @@ class ImportAll {
return;
case "sys":
if(!isSysTarget()) return;
case "asys":
if(!isAsysTarget()) return;
case "sys.thread":
if ( !Context.defined("target.threaded") ) return;
case "java":
Expand Down
24 changes: 9 additions & 15 deletions extra/azure-pipelines/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ jobs:
sudo add-apt-repository ppa:avsm/ppa -y # provides newer version of OCaml and OPAM
sudo apt-get update -qqy
sudo apt-get install -qqy ocaml-nox camlp5 opam libpcre3-dev zlib1g-dev libgtk2.0-dev ninja-build
curl -sSL -o "$(Agent.TempDirectory)/libuv-1.31.0.tar.gz" --retry 3 https://github.com/libuv/libuv/archive/v1.31.0.tar.gz
tar -xf $(Agent.TempDirectory)/libuv-1.31.0.tar.gz -C $(Agent.TempDirectory)
pushd $(Agent.TempDirectory)/libuv-1.31.0
sh autogen.sh
./configure
make
sudo make install
popd
displayName: Install dependencies
- template: install-neko-snapshot.yaml
parameters:
Expand All @@ -42,18 +50,4 @@ jobs:
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'linuxBinaries'
targetPath: out
- script: |
set -ex
make -s xmldoc
cat >extra/doc/info.json <<EOL
{
"commit": "$(Build.SourceVersion)",
"branch": "$(Build.SourceBranchName)"
}
EOL
displayName: Build xmldoc
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'xmldoc'
targetPath: extra/doc
targetPath: out
2 changes: 1 addition & 1 deletion extra/azure-pipelines/build-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
displayName: Install OCaml libraries
- script: |
set -ex
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" haxe
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/libuv.a" haxe
opam config exec -- make -s haxelib
make -s package_bin package_installer_mac
ls -l out
Expand Down
4 changes: 3 additions & 1 deletion extra/azure-pipelines/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ jobs:
- powershell: |
Set-PSDebug -Trace 1
curl.exe -fsSL -o cygwin-setup.exe --retry 3 $(CYGWIN_SETUP)
Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $(CYG_ROOT) -l C:/tmp -s $(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 mingw64-$(MINGW_ARCH)-zlib -P mingw64-$(MINGW_ARCH)-gcc-core -P mingw64-$(MINGW_ARCH)-pcre" -Wait
Start-Process -FilePath "cygwin-setup.exe" -ArgumentList "-B -q -R $(CYG_ROOT) -l C:/tmp -s $(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 libuv-devel -P mingw64-$(MINGW_ARCH)-zlib -P mingw64-$(MINGW_ARCH)-gcc-core -P mingw64-$(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$(ARCH).tar.xz
curl.exe -fsSL -o "libuv.tar.xz" --retry 3 https://github.com/Simn/mingw64-uv/releases/download/1.32.0/mingw64-$(MINGW_ARCH)-uv-1.32.0-1.tar.xz
& "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'echo "$OLDPWD"')
& "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -C / -xvf libuv.tar.xz')
& "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && tar -xf opam.tar.xz')
& "$(CYG_ROOT)/bin/bash.exe" @('-lc', 'cd "$OLDPWD" && bash opam$(ARCH)/install.sh')
& "$(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')
Expand Down
6 changes: 2 additions & 4 deletions extra/azure-pipelines/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ jobs:
HAXELIB_ROOT: C:/haxelib
strategy:
matrix:
# https://github.com/HaxeFoundation/haxe/issues/8600
${{ if eq(parameters.arch, '64') }}:
macro:
TEST: macro
macro:
TEST: macro
neko:
TEST: neko
hl:
Expand Down
26 changes: 26 additions & 0 deletions libs/uv/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ALL_CFLAGS = $(CFLAGS)
OCAMLOPT=ocamlopt
OCAMLC=ocamlc
SRC = uv.ml uv_stubs.c

all: bytecode native

bytecode: uv.cma

native: uv.cmxa

uv.cma: uv_stubs.o uv.ml
ocamlfind $(OCAMLC) -safe-string -a -o uv.cma uv.ml

uv.cmxa: uv_stubs.o uv.ml
ocamlfind $(OCAMLOPT) -safe-string -a -o uv.cmxa uv.ml

uv_stubs.o: uv_stubs.c
ocamlfind $(OCAMLC) -safe-string $(ALL_CFLAGS) uv_stubs.c

clean:
rm -f $(wildcard *.cmo) $(wildcard *.cma) $(wildcard *.cmx) $(wildcard *.cmxa) $(wildcard *.a) $(wildcard *.obj) $(wildcard *.o) $(wildcard *.cmi)

.PHONY: all bytecode native clean
Makefile: ;
$(SRC): ;
7 changes: 7 additions & 0 deletions libs/uv/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(include_subdirs no)

(library
(name uv)
(c_names uv_stubs)
(wrapped false)
)
Loading