Skip to content

Commit

Permalink
Update to ocaml 4.08.1 and luv 0.5.12
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Apr 28, 2023
1 parent b6d9e55 commit 2a7ff13
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 130 deletions.
161 changes: 86 additions & 75 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PLATFORM: windows64
OPAMYES: 1
OPAMROOT: D:\.opam
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/
ARCH: 64
MINGW_ARCH: x86_64
CYGWIN_SETUP: https://cygwin.com/setup-x86_64.exe
CYG_ROOT: C:/cygwin64
CYG_ROOT: D:\cygwin
steps:
- uses: actions/checkout@main
with:
Expand All @@ -27,12 +23,20 @@ jobs:
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
rm C:\msys64\usr\bin\bash.exe
- name: Cache opam
id: cache-opam
uses: actions/cache@v3.0.11
- name: choco install nsis
uses: nick-invision/retry@v1
with:
path: D:\.opam
key: ${{ runner.os }}64-${{ hashFiles('./opam', './libs/') }}
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.02 -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"

- name: Install Neko from S3
shell: pwsh
Expand All @@ -46,47 +50,33 @@ jobs:
- name: Print Neko version
run: neko -version 2>&1

- name: choco install nsis
uses: nick-invision/retry@v1
- name: Setup ocaml
uses: ocaml/setup-ocaml@v2
with:
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.02 -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"
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 OCaml
- 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')
- 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
- name: Expose mingw dll files
shell: pwsh
Expand Down Expand Up @@ -116,6 +106,13 @@ jobs:
& "$($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
with:
Expand All @@ -128,13 +125,9 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
PLATFORM: windows
OPAMYES: 1
OPAMROOT: D:\.opam
CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin-archive/20221123
ARCH: 32
MINGW_ARCH: i686
CYGWIN_SETUP: https://cygwin.com/setup-x86.exe
CYG_ROOT: C:/cygwin
CYG_ROOT: D:\cygwin
steps:
- uses: actions/checkout@main
with:
Expand All @@ -145,12 +138,20 @@ jobs:
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
rm C:\msys64\usr\bin\bash.exe
- name: Cache opam
id: cache-opam
uses: actions/cache@v3.0.11
- name: choco install nsis
uses: nick-invision/retry@v1
with:
path: D:\.opam
key: ${{ runner.os }}32-${{ hashFiles('./opam', './libs/') }}
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.02 -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"

- name: Install Neko from S3
shell: pwsh
Expand All @@ -164,48 +165,52 @@ jobs:
- name: Print Neko version
run: neko -version 2>&1

- name: choco install nsis
uses: nick-invision/retry@v1
- name: Setup ocaml
id: ocaml
continue-on-error: true
uses: kLabz/setup-ocaml@win32
with:
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.02 -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"
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 OCaml
- 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')
- 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
- name: Expose mingw dll files
shell: pwsh
Expand Down Expand Up @@ -235,6 +240,13 @@ jobs:
& "$($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
with:
Expand All @@ -257,7 +269,7 @@ jobs:
uses: actions/cache@v3.0.11
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./opam', './libs/') }}-2
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}-2

- name: Install Neko from S3
run: |
Expand Down Expand Up @@ -572,7 +584,7 @@ jobs:
uses: actions/cache@v3.0.11
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./opam', './libs/') }}-2
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}-2

- name: Install Neko from S3
run: |
Expand Down Expand Up @@ -625,14 +637,13 @@ jobs:
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 Down
2 changes: 1 addition & 1 deletion Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ 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 install . --yes --deps-only --no-depexts
RUN opam list
Expand Down
3 changes: 1 addition & 2 deletions extra/github-actions/build-mac.yml
Original file line number Diff line number Diff line change
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 Down
7 changes: 7 additions & 0 deletions extra/github-actions/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
& "$($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
with:
Expand Down
6 changes: 6 additions & 0 deletions extra/github-actions/cache-opam-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Cache opam
id: cache-opam
uses: actions/cache@v3.0.11
with:
path: D:\.opam
key: ${{ runner.os }}${{ env.ARCH }}-${{ hashFiles('./haxe.opam', './libs/') }}
2 changes: 1 addition & 1 deletion extra/github-actions/cache-opam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
uses: actions/cache@v3.0.11
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./opam', './libs/') }}-2
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}-2
2 changes: 2 additions & 0 deletions extra/github-actions/install-nsis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
timeout_minutes: 10
max_attempts: 10
command: choco install --no-progress nsis.portable --version 3.02 -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

0 comments on commit 2a7ff13

Please sign in to comment.