esy / esy

package.json workflow for native development with Reason/OCaml
http://esy.sh
Other
845 stars 93 forks source link

Failed to apply patch on nightly build. #743

Closed jordwalke closed 5 years ago

jordwalke commented 5 years ago

info esy build 0.4.4-d9ad76

git clone https://github.com/bryphe/merlin-language-server.git
cd merlin-language-server
esy install
esy build

Indeed, the patch did fail to apply in the build directory. The patch file is in the local esy.lock

$time 'C:\Users\jwalke\AppData\Roaming\npm\esy.cmd' build
info esy build 0.4.4-d9ad76
info building @opam/ppx_deriving@opam:4.2.1@7927b93a
info building @opam/base@opam:v0.11.1@0e54024e
info building @reason-native/pastel@0.0.0@d41d8cd9
info building @opam/astring@opam:0.8.3@4e5e17d5
info building @reason-native/console@0.0.1@d41d8cd9
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: @opam/ppx_deriving@opam:4.2.1
    # esy-build-package: pwd: C:\Users\jwalke\.esy\3_\b\opam__s__ppx__deriving-opam__c__4.2.1-eeb67424
    # esy-build-package: running: "substs" "pkg\META.in"
    # esy-build-package: running: "bash" "-c" "patch -p1 < ppx_deriving-4.2.1.patch"
    C:/Users/jwalke/AppData/Roaming/npm/node_modules/@esy-nightly/esy/node_modules/esy-bash/.cygwin/bin/bash: ppx_deriving-4.2.1.patch: No such file or directory
    error: command failed: "bash" "-c" "patch -p1 < ppx_deriving-4.2.1.patch" (exited with 1)
    esy-build-package: exiting with errors above...

  building @opam/ppx_deriving@opam:4.2.1
esy: exiting due to errors above

real    0m1.214s
user    0m0.015s
sys     0m0.015s

Now testing 0.4.3 to see if the problem is there too.

jordwalke commented 5 years ago

Side question: does the build cache ID take into account the hash of patches? We wouldn't want versions of packages without patches being applied to share the same build cache as that same package with a patch applied.

jordwalke commented 5 years ago

When I tried with the older version of esy, it failed on another package with another failed to apply patch.

S C:\Users\jwalke\github\merlin-language-server> esy build
info esy build 0.4.3
info building @opam/dune@opam:1.6.2@1683022f
info building @opam/dune@opam:1.6.2@1683022f: done
info building @opam/ocamlbuild@opam:0.12.0@bbe76db8
info building @opam/ocamlfind@opam:1.8.0@6fa9aaf5
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: @opam/ocamlbuild@opam:0.12.0
    # esy-build-package: pwd: C:\Users\jwalke\.esy\3_\b\opam__s__ocamlbuild-opam__c__0.12.0-22c9ca82
    # esy-build-package: running: "bash" "-c" "patch -p1 < ocamlbuild-0.12.0.patch"
    C:/Users/jwalke/AppData/Roaming/npm/node_modules/esy/node_modules/esy-bash/.cygwin/bin/bash: ocamlbuild-0.12.0.patch: No such file or directory
    error: command failed: "bash" "-c" "patch -p1 < ocamlbuild-0.12.0.patch" (exited with 1)
    esy-build-package: exiting with errors above...

  building @opam/ocamlbuild@opam:0.12.0@bbe76db8
esy: exiting due to errors above
jordwalke commented 5 years ago

Now it's failing to apply the patch with a perfectly clean/package build cache, and no_esy directory, no ~/.esy directory, no project esy.lock/ file, on esy nightly (building hello-reason).

PS C:\Users\jwalke\github\hello-reason> esy install
info install 0.4.4-d9ad76
info fetching: done
info installing: done
PS C:\Users\jwalke\github\hello-reason> esy build
info esy build 0.4.4-d9ad76
info building @opam/ocamlbuild@opam:0.12.0@6c616094
info building @opam/ocamlfind@opam:1.8.0@96572762
error: build failed with exit code: 1
  build log:
    # esy-build-package: building: @opam/ocamlbuild@opam:0.12.0
    # esy-build-package: pwd: C:\Users\jwalke\.esy\3_\b\opam__s__ocamlbuild-opam__c__0.12.0-2d99c8b0
    # esy-build-package: running: "bash" "-c" "patch -p1 < ocamlbuild-0.12.0.patch"
    C:/Users/jwalke/AppData/Roaming/npm/node_modules/@esy-nightly/esy/node_modules/esy-bash/.cygwin/bin/bash: ocamlbuild-0.12.0.patch: No such file or directory
    error: command failed: "bash" "-c" "patch -p1 < ocamlbuild-0.12.0.patch" (exited with 1)
    esy-build-package: exiting with errors above...

  building @opam/ocamlbuild@opam:0.12.0
esy: exiting due to errors above

And it's failing to build on esy 0.4.3 after totally cleaning global build/package cache, removing _esy, and even removing the esy.lock/ with this error: (This might be an old bug that has since been fixed, but I'm reporting it just in case. In general, things were working okay with nightly - and 0.4.3, now they're all broken for me in weird ways - sometimes not including the patch files, sometimes other things).

error: build failed with exit code: 1
  build log:
    # esy-build-package: building: @opam/lwt@opam:4.1.0
    # esy-build-package: pwd: C:\Users\jwalke\.esy\3_\b\opam__s__lwt-opam__c__4.1.0-67b54c5e
    esy-build-package: delete directory
                       C:\Users\jwalke\.esy\3_\i\opam__s__lwt-opam__c__4.1.0-67b54c5e:
                       C:\Users\jwalke\.esy\3_\i\opam__s__lwt-opam__c__4.1.0-67b54c5e\lib\lwt\lwt.a:
                       The directory name is invalid.

    ocumentation comment
        discover src/unix/lwt_config.{h,ml},src/unix/unix_c_flags.sexp,src/unix/unix_c_library_flags.sexp
    found config var ext_obj: ...................... .o
    found config var default_executable_name: ...... camlprog.exe
    found config var ccomp_type: ................... cc
    found config var system: ....................... mingw64
    found config var os_type: ...................... Win32
    found config var use_libev: .................... false
    not checking for pkg-config
    not checking for libev
    not checking for pthread
    not checking for eventfd
    not checking for fd passing
    not checking for sched_getcpu
    not checking for affinity getting/setting
    not checking for credentials getting (Linux)
    not checking for credentials getting (NetBSD)
    not checking for credentials getting (OpenBSD)
    not checking for credentials getting (FreeBSD)
    not checking for credentials getting (getpeereid)
    not checking for fdatasync
    not checking for netdb_reentrant
    not checking for reentrant gethost*
    testing for nanosecond stat support: ........... unavailable
    not checking for BSD mincore
    # esy-build-package: installing using built-in installer
    # esy-build-package: rewriting prefix: C:\Users\jwalke\.esy\3_\s\opam__s__lwt-opam__c__4.1.0-67b54c5e -> C:\Users\jwalke\.esy\3_\i\opam__s__lwt-opam__c__4.1.0-67b54c5e
    # esy-build-package: committing: C:\Users\jwalke\.esy\3_\s\opam__s__lwt-opam__c__4.1.0-67b54c5e -> C:\Users\jwalke\.esy\3_\i\opam__s__lwt-opam__c__4.1.0-67b54c5e

  building @opam/lwt@opam:4.1.0@114c53b7
esy: exiting due to errors above
andreypopp commented 5 years ago

Side question: does the build cache ID take into account the hash of patches? We wouldn't want versions of packages without patches being applied to share the same build cache as that same package with a patch applied.

Yes, this would be woefully incorrect otherwise.