shakthimaan
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
      • No invitee
    • Publish Note

      Publish Note

      Everyone on the web can find and read all notes of this public team.
      Once published, notes can be searched and viewed by anyone online.
      See published notes
      Please check the box to agree to the Community Guidelines.
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
No invitee
Publish Note

Publish Note

Everyone on the web can find and read all notes of this public team.
Once published, notes can be searched and viewed by anyone online.
See published notes
Please check the box to agree to the Community Guidelines.
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Fix MirageOS Libraries on CI Reference: https://ocaml.ci.dev/github/mirage | Status | Package | Issue | Comments | |--------|---------|-------|----------| | DONE | Either | WARNING: updating https://dl-cdn.alpinelinux.org/alpine/v3.19/main: temporary error (try again later) | Use alpine-3.19-ocaml-5.1 Docker image for successful build | | DONE | Coin | (lower-bound) and alpine-3.19-5.1_opam-2.1 build failure with WARNING: updating https://dl-cdn.alpinelinux.org/alpine/v3.19/main: temporary error (try again later) | Ensure re package is installed. | | DONE | bechamel | Result is not found | Install linux-headers apk and re-build with dependencies installed | | DONE | irmin-watcher | Error: Unbound value Mtime.Span.to_ms | | TODO | alcotest | Failing on debian-12-5.2~alpha1_opam-2.1 and FreeBSD | | | TODO | cactus | Error: Unbound value Mtime.Span.to_ms | | | TODO | mirage-www | Failed in 0s | | | TODO | conan | Failing on dependency error on debian-12-4.14+flambda_opam-2.1 | | | TODO | cowabloga | Error: Unbound module Cohttp_lwt_unix_net (multiple distros) | | | TODO | irmin | lint error | | | On Ubuntu 22.04 LTS: ## Docker ``` $ sudo apt install docker.io $ sudo docker pull alpine:3.19.1 ``` ## Attempt III: Using images from ocaml/opam Test with alpine-3.19-ocaml-5.1: Pre-requisites: ``` $ sudo docker pull ocaml/opam:alpine-3.19-ocaml-5.1 $ sudo docker run -it ocaml/opam:alpine-3.19-ocaml-5.1 bash ``` ### Either ``` $ git clone https://github.com/mirage/either.git $ opam install dune $ cd either $ dune build $ cd _build/default/src/.either.jobs/byte/ $ ocaml # #load "either.cmo" ;; # Either.left ;; ``` ### coin ``` $ git clone https://github.com/mirage/coin.git $ opam install . --deps-only -y $ dune build $ dune runtest $ dune exec -- ./_build/default/gen/generate.exe ``` ### bechamel ``` $ git clone https://github.com/mirage/bechamel.git $ cd bechamel $ sudo apk add linux-headers # Add "result" to depends in bechamel.opam $ opam install . --deps-only --with-test $ dune build $ dune runtest $ dune exec -- ./_build/default/examples/list.exe $ dune exec -- ./_build/default/examples/fact.exe ```` ### cactus gmp-dev is not installed on alpine. $ sudo apk add gmp-dev $ opam install . --deps-only --with-test -y $ dune build ``` ~/cactus$ dune build File "src/stats.ml", line 78, characters 36-52: 78 | let point = add_span |> Mtime.Span.to_us |> Float.log in ^^^^^^^^^^^^^^^^ Error: Unbound value Mtime.Span.to_us File "bench/encoding/encoding.ml", line 54, characters 18-35: 54 | ~short_hash:short_hash_staged H.of_raw_string H.to_raw_string ^^^^^^^^^^^^^^^^^ Error: This expression has type (?seed:int -> t -> int) Repr__Type.staged but an expression was expected of type ?seed:int -> t -> int File "src/recorder.ml", line 57, characters 63-64: 57 | let _, size = decode_int32 (really_input_string in_ 4) 0 in ^ Error: This expression has type int but an expression was expected of type int ref File "bench/log.ml", line 23, characters 42-58: 23 | let dt = Mtime_clock.count counter |> Mtime.Span.to_ms in ^^^^^^^^^^^^^^^^ Error: Unbound value Mtime.Span.to_ms File "tests/log.ml", line 23, characters 42-58: 23 | let dt = Mtime_clock.count counter |> Mtime.Span.to_ms in ^^^^^^^^^^^^^^^^ Error: Unbound value Mtime.Span.to_ms File "tests/common.ml", line 110, characters 42-58: 110 | let dt = Mtime_clock.count counter |> Mtime.Span.to_ms in ^^^^^^^^^^^^^^^^ Error: Unbound value Mtime.Span.to_ms ``` ### Conan Failure on debian-12-4.14+flambda_opam-2.1 ``` [ERROR] Package conflict! * Incompatible packages: - conan-unix >= dev - (invariant) -> ocaml-options-only-flambda -> ocaml-option-flambda You can temporarily relax the switch invariant with `--update-invariant' ``` ### cowabloga On alpine-3.19-5.1_opam-2.1 and other distributions: ``` Warning 70 [missing-mli]: Cannot find interface file. (cd _build/default && /home/opam/.opam/5.1/bin/ocamlc.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -w A-4-41-44 -warn-error +1..49 -strict-sequence -principal -g -bin-annot -I lib/.cowabloga.objs/byte -I /home/opam/.opam/5.1/lib/angstrom -I /home/opam/.opam/5.1/lib/bigstringaf -I /home/opam/.opam/5.1/lib/cow -I /home/opam/.opam/5.1/lib/cstruct -I /home/opam/.opam/5.1/lib/ezjsonm -I /home/opam/.opam/5.1/lib/hex -I /home/opam/.opam/5.1/lib/jsonm -I /home/opam/.opam/5.1/lib/lwt -I /home/opam/.opam/5.1/lib/magic-mime -I /home/opam/.opam/5.1/lib/omd -I /home/opam/.opam/5.1/lib/re -I /home/opam/.opam/5.1/lib/seq -I /home/opam/.opam/5.1/lib/sexplib0 -I /home/opam/.opam/5.1/lib/stringext -I /home/opam/.opam/5.1/lib/uri -I /home/opam/.opam/5.1/lib/uucp -I /home/opam/.opam/5.1/lib/uunf -I /home/opam/.opam/5.1/lib/uutf -I /home/opam/.opam/5.1/lib/xmlm -intf-suffix .ml -no-alias-deps -opaque -open Cowabloga -o lib/.cowabloga.objs/byte/cowabloga__Blog.cmo -c -impl lib/blog.ml) File "lib/blog.ml", line 101, characters 14-35: 101 | let to_html ?(sep=default_separator) ~feed ~entries = ^^^^^^^^^^^^^^^^^^^^^ Error (warning 16 [unerasable-optional-argument]): this optional argument cannot be erased. (cd _build/default && /home/opam/.opam/5.1/bin/ocamlc.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -w A-4-41-44 -warn-error +1..49 -strict-sequence -principal -g -bin-annot -I lib/.cowabloga.objs/byte -I /home/opam/.opam/5.1/lib/angstrom -I /home/opam/.opam/5.1/lib/bigstringaf -I /home/opam/.opam/5.1/lib/cow -I /home/opam/.opam/5.1/lib/cstruct -I /home/opam/.opam/5.1/lib/ezjsonm -I /home/opam/.opam/5.1/lib/hex -I /home/opam/.opam/5.1/lib/jsonm -I /home/opam/.opam/5.1/lib/lwt -I /home/opam/.opam/5.1/lib/magic-mime -I /home/opam/.opam/5.1/lib/omd -I /home/opam/.opam/5.1/lib/re -I /home/opam/.opam/5.1/lib/seq -I /home/opam/.opam/5.1/lib/sexplib0 -I /home/opam/.opam/5.1/lib/stringext -I /home/opam/.opam/5.1/lib/uri -I /home/opam/.opam/5.1/lib/uucp -I /home/opam/.opam/5.1/lib/uunf -I /home/opam/.opam/5.1/lib/uutf -I /home/opam/.opam/5.1/lib/xmlm -no-alias-deps -opaque -open Cowabloga -o lib/.cowabloga.objs/byte/cowabloga__Feed.cmo -c -impl lib/feed.ml) File "lib/feed.ml", line 1: Warning 70 [missing-mli]: Cannot find interface file. (cd _build/default && /home/opam/.opam/5.1/bin/ocamlopt.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -w A-4-41-44 -warn-error +1..49 -strict-sequence -principal -g -I lib/.cowabloga.objs/byte -I lib/.cowabloga.objs/native -I /home/opam/.opam/5.1/lib/angstrom -I /home/opam/.opam/5.1/lib/bigstringaf -I /home/opam/.opam/5.1/lib/cow -I /home/opam/.opam/5.1/lib/cstruct -I /home/opam/.opam/5.1/lib/ezjsonm -I /home/opam/.opam/5.1/lib/hex -I /home/opam/.opam/5.1/lib/jsonm -I /home/opam/.opam/5.1/lib/lwt -I /home/opam/.opam/5.1/lib/magic-mime -I /home/opam/.opam/5.1/lib/omd -I /home/opam/.opam/5.1/lib/re -I /home/opam/.opam/5.1/lib/seq -I /home/opam/.opam/5.1/lib/sexplib0 -I /home/opam/.opam/5.1/lib/stringext -I /home/opam/.opam/5.1/lib/uri -I /home/opam/.opam/5.1/lib/uucp -I /home/opam/.opam/5.1/lib/uunf -I /home/opam/.opam/5.1/lib/uutf -I /home/opam/.opam/5.1/lib/xmlm -intf-suffix .ml -no-alias-deps -opaque -open Cowabloga -o lib/.cowabloga.objs/native/cowabloga__Blog.cmx -c -impl lib/blog.ml) File "lib/blog.ml", line 101, characters 14-35: 101 | let to_html ?(sep=default_separator) ~feed ~entries = ^^^^^^^^^^^^^^^^^^^^^ Error (warning 16 [unerasable-optional-argument]): this optional argument cannot be erased. (cd _build/default && /home/opam/.opam/5.1/bin/ocamlc.opt -w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence -strict-formats -short-paths -keep-locs -g -bin-annot -I lib_test/.serve.eobjs/byte -I /home/opam/.opam/5.1/lib/angstrom -I /home/opam/.opam/5.1/lib/astring -I /home/opam/.opam/5.1/lib/base64 -I /home/opam/.opam/5.1/lib/bigstringaf -I /home/opam/.opam/5.1/lib/bytes -I /home/opam/.opam/5.1/lib/cohttp -I /home/opam/.opam/5.1/lib/cohttp-lwt -I /home/opam/.opam/5.1/lib/cohttp-lwt-unix -I /home/opam/.opam/5.1/lib/conduit -I /home/opam/.opam/5.1/lib/conduit-lwt -I /home/opam/.opam/5.1/lib/conduit-lwt-unix -I /home/opam/.opam/5.1/lib/cow -I /home/opam/.opam/5.1/lib/cstruct -I /home/opam/.opam/5.1/lib/domain-name -I /home/opam/.opam/5.1/lib/ezjsonm -I /home/opam/.opam/5.1/lib/fmt -I /home/opam/.opam/5.1/lib/hex -I /home/opam/.opam/5.1/lib/ipaddr -I /home/opam/.opam/5.1/lib/ipaddr-sexp -I /home/opam/.opam/5.1/lib/ipaddr/unix -I /home/opam/.opam/5.1/lib/jsonm -I /home/opam/.opam/5.1/lib/logs -I /home/opam/.opam/5.1/lib/lwt -I /home/opam/.opam/5.1/lib/lwt/unix -I /home/opam/.opam/5.1/lib/macaddr -I /home/opam/.opam/5.1/lib/magic-mime -I /home/opam/.opam/5.1/lib/ocaml/threads -I /home/opam/.opam/5.1/lib/ocaml/unix -I /home/opam/.opam/5.1/lib/ocplib-endian -I /home/opam/.opam/5.1/lib/ocplib-endian/bigstring -I /home/opam/.opam/5.1/lib/omd -I /home/opam/.opam/5.1/lib/parsexp -I /home/opam/.opam/5.1/lib/ppx_sexp_conv/runtime-lib -I /home/opam/.opam/5.1/lib/re -I /home/opam/.opam/5.1/lib/seq -I /home/opam/.opam/5.1/lib/sexplib -I /home/opam/.opam/5.1/lib/sexplib0 -I /home/opam/.opam/5.1/lib/stringext -I /home/opam/.opam/5.1/lib/uri -I /home/opam/.opam/5.1/lib/uri-sexp -I /home/opam/.opam/5.1/lib/uri/services -I /home/opam/.opam/5.1/lib/uucp -I /home/opam/.opam/5.1/lib/uunf -I /home/opam/.opam/5.1/lib/uutf -I /home/opam/.opam/5.1/lib/xmlm -I lib/.cowabloga.objs/byte -no-alias-deps -opaque -o lib_test/.serve.eobjs/byte/serve.cmo -c -impl lib_test/serve.ml) File "lib_test/serve.ml", line 36, characters 12-36: 36 | let ctx = Cohttp_lwt_unix_net.init () in ^^^^^^^^^^^^^^^^^^^^^^^^ Error: Unbound module Cohttp_lwt_unix_net ``` ### irmin ``` "/usr/bin/env" "bash" "-c" "opam exec -- opam-dune-lint" failed with exit status 1 2024-03-13 22:40.54: Job failed: Failed: Build failed ``` ### irmin-watcher ``` $ git clone https://github.com/mirage/irmin-watcher.git $ cd irmin-watcher $ sudo apk add libffi-dev $ opam install . --deps-only --with-test -y $ dune build $ dune test ``` ``` $ opam install . --deps-only -y <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -> installed conf-pkg-config.3 [ERROR] The compilation of conf-libffi failed at "/usr/bin/pkg-config libffi". ... File "test/dune", line 3, characters 50-64: 3 | (libraries alcotest logs.fmt irmin-watcher mtime mtime.clock.os)) ^^^^^^^^^^^^^^ Error: Library "mtime.clock.os" not found. ``` 1. Update mtime dependency in dune-project to use: (mtime (and :with-test (>= "2.0.0"))) ``` File "test/test.ml", line 135, characters 15-31: 135 | let dt = Mtime.Span.to_us (Mtime_clock.elapsed ()) in ^^^^^^^^^^^^^^^^ Error: Unbound value Mtime.Span.to_us ``` Update test/test.ml from Mtime.Span.to_us to Mtime.Span.to_float_ns. Reference: 1. cca - Mtime.Span.to_float.ns https://github.com/codinuum/cca/commit/7e900b68b3799252d9cac4cc397c439205371651 Docker Source: 1. https://hub.docker.com/r/ocaml/opam/tags?page=1&name=alpine-3.19-ocaml-5.1 ## Attempt II: Using dev-containers ### Start the container ``` $ sudo docker run -it alpine:3.19.1 sh ``` ### Install dependenciess ``` $ apk add --update alpine-sdk build-base curl git bzip2 bash $ mkdir /usr/dev/ocaml $ mkdir -p /usr/dev/ocaml/bin /usr/dev/ocaml/lib</pre> # wget https://raw.githubusercontent.com/avsm/ocaml-devcontainers/main/install-tools.sh # wget https://raw.githubusercontent.com/avsm/ocaml-devcontainers/main/install-ocaml.sh # chmod +x *.sh # /root/install-ocaml.sh 5.1.1 ``` References: 1. Dockerfile.apk. https://github.com/avsm/ocaml-devcontainers/blob/main/Dockerfile.apk ## Attempt I: Manual opam install ### Install dependencies ``` # apk update # apk add make nano patch build-base \ bubblewrap rsync git sudo bash \ mercurial ``` Note: build-base provides cc. ### Install OPAM ``` # wget https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh # sh install.sh ``` ### Create user opam ``` ~ # adduser opam Changing password for opam New password: Bad password: too short Retype password: passwd: password for opam changed by root ``` ``` # visudo ``` Add ``` opam ALL=(ALL:ALL) ALL ``` Update /etc/passwd to set default shell as /bin/bash for opam user. ### Set sh redirect to bash ``` # ln -sf /bin/bash /bin/sh ``` ### Initialize opam ``` # sudo su - opam $ opam init ``` The error ``` $ opam init No configuration file found, using built-in defaults. Checking for available remotes: rsync and local, git, mercurial. - you won't be able to use darcs repositories unless you install the darcs command on your system. [ERROR] Sandboxing is not working on your platform alpine: "~/.opam/opam-init/hooks/sandbox.sh build sh -c echo SUCCESS >$TMPDIR/opam-sandbox-check-out && cat $TMPDIR/opam-sandbox-check-out; rm -f $TMPDIR/opam-sandbox-check-out" exited with code 1 Do you want to disable it? Note that this will result in less secure package builds, so please ensure that you have some other isolation mechanisms in place (such as running within a container or virtual machine). [y/N] ``` References: 1. Push deprecated containers when rotating out distributions. https://github.com/ocurrent/docker-base-images/issues/57

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template is not available.
Upgrade
All
  • All
  • Team
No template found.

Create custom template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

How to use Slide mode

API Docs

Edit in VSCode

Install browser extension

Get in Touch

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Upgrade to Prime Plan

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

No updates to save
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Upgrade

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Upgrade

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully