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

Upgrade bob with the last version of esperanto #53

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .github/workflows/esperanto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
ocaml-version: ["4.14.0"]
ocaml-version: ["4.14.1"]
runs-on: ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v2
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-version }}
opam-disable-sandboxing: true
# See jart/cosmopolitan#3
- name: Fix binfmt and Cosmopolitan
run: sudo sh -c "echo ':APE:M::MZqFpD::/bin/sh:' >/proc/sys/fs/binfmt_misc/register"
- name: Pin & Install workflows
run: |
opam install esperanto.0.0.4
opam install ocamlfind opam-monorepo
opam install ocamlfind opam-monorepo x86_64-esperanto aarch64-esperanto
opam repo add upstream git+https://github.com/ocaml/opam-repository.git
opam repo add dune-universe git+https://github.com/dune-universe/opam-overlays.git
opam repo add mirage-universe git+https://github.com/dune-universe/mirage-opam-overlays.git
- name: Compilation
run: |
env OPAMVAR_monorepo='opam-monorepo' opam monorepo lock --require-cross-compile --build-only --ocaml-version ${{ matrix.ocaml-version }} com
env OPAMVAR_monorepo='opam-monorepo' opam monorepo pull
opam exec -- dune build -x esperanto -p bob bin/bob.exe
objcopy -S -O binary _build/default.esperanto/bin/bob.exe bob.com
strip bob.com
opam exec -- dune build -x x86_64_esperanto -p bob bin/bob.exe
opam exec -- dune build -x aarch64_esperanto -p bob bin/bob.exe
./link.sh
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
60 changes: 32 additions & 28 deletions com.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,54 @@ doc: "https://dinosaure.github.io/bob/"
license: "MIT"
synopsis: "A peer-to-peer file-transfer tool"

build: [ "dune" "build" "-x" "esperanto" "-p" name "bin/bob.exe" "-j" jobs ]
install: [
[ "objcopy" "-S" "-O" "binary" "_build/default.esperanto/bin/bob.exe" "%{bin}%/bob.com" ]
build: [
[ "dune" "build" "-x" "x86_64-esperanto" "-p" name "bin/bob.exe" "-j" jobs ]
[ "dune" "build" "-x" "aarch64-esperanto" "-p" name "bin/bob.exe" "-j" jobs ]
[ "sh" "link.sh" ]
]
run-test: [ "dune" "runtest" "-p" name "-j" jobs ]

depends: [
"ocaml" { build & >= "4.13.0" & < "5.0.0" }
"dune" { >= "3.3.0" }
"fmt" { >= "0.9.0" }
"hxd" { >= "0.3.2" }
"logs" { >= "0.7.0" }
"bheap" { >= "2.0.0" }
"base64" { >= "3.5.0" }
"decompress" { >= "1.5.1" }
"digestif" { >= "1.1.3" }
"opam-monorepo" { build }
"esperanto" { build }
"ocamlfind" { build }
"ocaml" { build & >= "4.13.0" & < "5.0.0" }
"dune" { >= "3.3.0" }
"fmt" { >= "0.9.0" }
"hxd" { >= "0.3.2" }
"logs" { >= "0.7.0" }
"bheap" { >= "2.0.0" }
"base64" { >= "3.5.0" }
"decompress" { >= "1.5.1" }
"digestif" { >= "1.1.3" }
"opam-monorepo" { build }
"esperanto-cosmopolitan" { build }
"x86_64-esperanto" { build }
"aarch64-esperanto" { build }
"ocamlfind" { build }
"bigstringaf"
"cmdliner"
"ipaddr" { >= "5.3.0" }
"ipaddr" { >= "5.3.0" }
"mirage-crypto"
"mirage-crypto-rng" { >= "0.11.0" }
"x509" { >= "0.16.0" }
"mirage-crypto-rng" { >= "0.11.0" }
"x509" { >= "0.16.0" }
"psq"
"lru" { >= "0.3.1" }
"lru" { >= "0.3.1" }
"tls"
"carton" { >= "0.5.0" }
"progress" { >= "0.2.1" }
"carton" { >= "0.5.0" }
"progress" { >= "0.2.1" }
"dns-client"
"happy-eyeballs" { >= "0.6.0" }
"happy-eyeballs" { >= "0.6.0" }
"ca-certs"
"ke" { >= "0.6" }
"alcotest" { with-test }
"spoke" { >= "0.0.2" }
"ke" { >= "0.6" }
"alcotest" { with-test }
"spoke" { >= "0.0.2" }
]

pin-depends: [
[ "mirage-crypto.dev" "git+https://github.com/dinosaure/mirage-crypto.git#83b160823cc601ffb19f8be2e32d643ffcbea60d" ]
[ "mirage-crypto-pk.dev" "git+https://github.com/dinosaure/mirage-crypto.git#83b160823cc601ffb19f8be2e32d643ffcbea60d" ]
[ "mirage-crypto-ec.dev" "git+https://github.com/dinosaure/mirage-crypto.git#83b160823cc601ffb19f8be2e32d643ffcbea60d" ]
[ "mirage-crypto-rng.dev" "git+https://github.com/dinosaure/mirage-crypto.git#83b160823cc601ffb19f8be2e32d643ffcbea60d" ]
[ "mtime.dev" "git+https://github.com/dinosaure/mtime.git#d5d70f38c40da90e3e173eb60346df55b64a4a0a"]
[ "mtime.dev" "git+https://github.com/dinosaure/mtime.git#d5d70f38c40da90e3e173eb60346df55b64a4a0a" ]
[ "gmp.dev" "git+https://github.com/mirage/ocaml-gmp.git#dfc83c74a327d848074ecf0d33b009eaf5625250" ]
]

x-mirage-opam-lock-location: "com.opam.locked"
Expand All @@ -65,6 +69,6 @@ x-mirage-extra-repo: [
[ "opam-overlays" "https://github.com/dune-universe/opam-overlays.git" ]
[ "mirage-overlays" "https://github.com/dune-universe/mirage-opam-overlays.git" ]
]
x-opam-monorepo-opam-provided: ["ocaml" "ocamlfind" "opam-monorepo" "esperanto"]
x-opam-monorepo-opam-provided: ["ocaml" "ocamlfind" "opam-monorepo" "esperanto-cosmopolitan" "x86_64-esperanto" "aarch64-esperanto"]

url { src: "git+https://github.com/dinosaure/bob.git#reproducible-build" }
url { src: "git+https://github.com/dinosaure/bob.git" }
15 changes: 15 additions & 0 deletions link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

opam exec -- apelink \
-o bob.com \
-l $(opam var bin)/ape-x86_64.elf \
-l $(opam var bin)/ape-aarch64.elf \
-M $(opam var bin)/ape-m1.c \
_build/default.x86_64_esperanto/bin/bob.exe.dbg \
_build/default.aarch64_esperanto/bin/bob.exe.dbg

cat >com.install <<EOF
bin: [
"bob.com"
]
EOF
Loading