reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.14k stars 428 forks source link

cannot build 3.9.0 with esy #2720

Closed susurri closed 11 months ago

susurri commented 1 year ago

esy fails to build 3.9.0.

package.json

{
  "name": "hello",
  "esy": {
    "build": "dune build -p #{self.name}"
  },
  "dependencies": {
    "@opam/dune": "*",
    "@opam/reason": "3.9.0",
    "ocaml": "4.14.x"
  }
}

build log

...
info building @opam/reason@opam:3.9.0@718de96d
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: @opam/reason@opam:3.9.0
    # esy-build-package: pwd: /home/user/.esy/3/b/opam__s__reason-opam__c__3.9.0-09a9dda8
    # esy-build-package: running: 'dune' 'build' '-p' 'reason' '-j' '4' '--promote-install-files=false' '@install'
    (cd _build/default/src/refmt && /usr/bin/bash -e -u -o pipefail -c 'echo let version = \"$(git rev-parse --verify HEAD)\"') > _build/default/src/refmt/git_commit.ml
    fatal: not a git repository (or any of the parent directories): .git
    (cd _build/default/src/refmt && /usr/bin/bash -e -u -o pipefail -c 'echo let short_version = \"$(git rev-parse --short HEAD)\"') > _build/default/src/refmt/git_commit.ml
    fatal: not a git repository (or any of the parent directories): .git
    # esy-build-package: running: 'dune' 'install' '-p' 'reason' '--create-install-files' 'reason'
    Error: The mandir installation directory is unknown.
    Hint: It could be specified with --mandir
    error: command failed: 'dune' 'install' '-p' 'reason' '--create-install-files' 'reason' (exited with 1)
    esy-build-package: exiting with errors above...

  building @opam/reason@opam:3.9.0
esy: exiting due to errors above
anmonteiro commented 1 year ago

This is an esy bug, could you open an issue over there? https://github.com/esy/esy

susurri commented 1 year ago

I do not think it is an esy bug. looking at https://github.com/ocaml/opam-repository/blob/master/packages/reason/reason.3.9.0/opam, https://github.com/reasonml/reason/releases/download/3.9.0/reason-3.9.0.tbz is used, which does not include .git directory. I think git rev-parse should not be used in src/refmt/dune for distributing with opam.

anmonteiro commented 1 year ago

The real error is:

    Error: The mandir installation directory is unknown.
    Hint: It could be specified with --mandir

Esy isn't setting up MANDIR or similar, which causes installation to fail. The fact that we see installation running in the log output:

    # esy-build-package: running: 'dune' 'install' '-p' 'reason' '--create-install-files' 'reason'

means that the error didn't happen during build.

susurri commented 1 year ago

I have opened an issue https://github.com/esy/esy/issues/1478.

anmonteiro commented 11 months ago

Closing here too