pyre-check icon indicating copy to clipboard operation
pyre-check copied to clipboard

Pyre installation from source fails when building.

Open sarraga opened this issue 1 year ago • 5 comments

Pyre Bug

Bug description When following the installation from source steps at https://pyre-check.org/docs/installation/ we get a compile-time error and installation aborts.

Reproduction steps

From my .history:

500 $ git clone https://github.com/facebook/pyre-check 501 git clone https://github.com/facebook/pyre-check 502 cd pyre-check/ 503 ./scripts/setup.sh --local

Expected behavior Compile should succeed and leave us with an installable binary.

Logs

sarraga@nagios:~/pyre-check$ ./scripts/setup.sh --local
[2024-08-11 16:29:05,068] [INFO] ['opam', '--version']
[2024-08-11 16:29:05,081] [INFO] Found opam version 2.0.8
[2024-08-11 16:29:05,081] [INFO] ['opam', 'init', '--bare', '--yes', '--disable-sandboxing', '--root', '/home/sarraga/.opam', 'default', 'https://opam.ocaml.org']
[NOTE] Will configure from built-in defaults.
[2024-08-11 16:29:21,413] [INFO] ['opam', 'update', '--root', '/home/sarraga/.opam']
[2024-08-11 16:29:41,567] [INFO] ['opam', 'switch', 'create', 'pyre-4.14.0', '--packages=ocaml-variants.4.14.0+options,ocaml-option-flambda', '--yes', '--root', '/home/sarraga/.opam']
[ERROR] The compilation of ocaml-variants failed at "/usr/bin/make -j1".

#=== ERROR while compiling ocaml-variants.4.14.0+options ======================#
# context              2.0.8 | linux/x86_64 | ocaml-option-flambda.1 | https://opam.ocaml.org#0f4d0ee5b69b496a4e26f305891c31400f0b4b5f
# path                 ~/.opam/pyre-4.14.0/.opam-switch/build/ocaml-variants.4.14.0+options
# command              /usr/bin/make -j1
# exit-code            2
# env-file             ~/.opam/log/ocaml-variants-29426-0325cb.env
# output-file          ~/.opam/log/ocaml-variants-29426-0325cb.out
### output ###
# signals_osdep.h:33:57: error: ‘REG_R15’ undeclared (first use in this function)
# [...]
#       |                                                         ^~~~~~~
# signals_nat.c:228:39: note: in expansion of macro ‘CONTEXT_YOUNG_PTR’
#   228 |     Caml_state->young_ptr = (value *) CONTEXT_YOUNG_PTR;
#       |                                       ^~~~~~~~~~~~~~~~~
# make[3]: *** [Makefile:366: signals_nat.n.o] Error 1
# make[3]: Leaving directory '/home/sarraga/.opam/pyre-4.14.0/.opam-switch/build/ocaml-variants.4.14.0+options/runtime'
# make[2]: *** [Makefile:826: makeruntimeopt] Error 2
# make[2]: Leaving directory '/home/sarraga/.opam/pyre-4.14.0/.opam-switch/build/ocaml-variants.4.14.0+options'
# make[1]: *** [Makefile:249: opt.opt] Error 2
# make[1]: Leaving directory '/home/sarraga/.opam/pyre-4.14.0/.opam-switch/build/ocaml-variants.4.14.0+options'
# make: *** [Makefile:312: world.opt] Error 2

[2024-08-11 16:32:22,051] [INFO] Command: ['opam', 'switch', 'create', 'pyre-4.14.0', '--packages=ocaml-variants.4.14.0+options,ocaml-option-flambda', '--yes', '--root', '/home/sarraga/.opam'] returned non zero exit code.
stdout:
<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ocaml-config.2/gen_ocaml_config.ml.in] downloaded from https://opam.ocaml.org/cache
[ocaml-config.2/ocaml-config.install] downloaded from https://opam.ocaml.org/cache
[ocaml-variants.4.14.0+options] downloaded from cache at https://opam.ocaml.org/cache
[ocaml-variants.4.14.0+options/ocaml-variants.install] downloaded from https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed base-bigarray.base
∗ installed base-threads.base
∗ installed base-unix.base
∗ installed host-arch-x86_64.1
∗ installed host-system-other.1
∗ installed ocaml-option-flambda.1


<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed

Please run your reproduction steps followed by pyre rage > pyre_rage.log, and upload the file here:

Additional context Add any other context about the problem here. (like dependencies in your venv, third party stub files being used, overall goals, etc.)

sarraga avatar Aug 11 '24 16:08 sarraga

Hey @sarraga, when you run opam switch list, what do you see?

connernilsen avatar Aug 12 '24 18:08 connernilsen

sarraga@nagios:~/pyre-check$ opam switch list
#  switch  compiler  description
sarraga@nagios:~/pyre-check$

sarraga avatar Aug 13 '24 09:08 sarraga

Interesting, it looks like the OCaml compiler can't be compiled for you.

See if you run opam switch create pyre-4.14.0 4.14.0. It might work with that (using a slightly different package than what the setup script uses), but if not, then you'll probably have to post on the OCaml forum and get help from OCaml developers and those who really know what's going on here.

Let me know how it goes when you run the command above.

connernilsen avatar Aug 14 '24 15:08 connernilsen

Yeah, no luck.

### output ###
# signals_osdep.h:33:57: error: ‘REG_R15’ undeclared (first use in this
function)
# [...]
#       |                                                         ^~~~~~~
# signals_nat.c:228:39: note: in expansion of macro ‘CONTEXT_YOUNG_PTR’
#   228 |     Caml_state->young_ptr = (value *) CONTEXT_YOUNG_PTR;
#       |                                       ^~~~~~~~~~~~~~~~~
# make[3]: *** [Makefile:366: signals_nat.n.o] Error 1

Thanks for looking into this, I'll try get an OCaml compiler working.

On Wed, Aug 14, 2024 at 4:08 PM Conner Nilsen @.***> wrote:

Interesting, it looks like the OCaml compiler can't be compiled for you.

See if you run opam switch create pyre-4.14.0 4.14.0. It might work with that (using a slightly different package than what the setup script uses), but if not, then you'll probably have to post on the OCaml forum and get help from OCaml developers and those who really know what's going on here.

Let me know how it goes when you run the command above.

— Reply to this email directly, view it on GitHub https://github.com/facebook/pyre-check/issues/908#issuecomment-2289071145, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEMXXBSPDACE5KFQS5EAT3ZRNXGDAVCNFSM6AAAAABMK35ZYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBZGA3TCMJUGU . You are receiving this because you were mentioned.Message ID: @.***>

sarraga avatar Aug 14 '24 15:08 sarraga

Yeah, sorry @sarraga. I'm not familiar with the internals of the OCaml compiler, so I don't be able to help here. Good luck, and let me know if you have any other issues once you get that working.

connernilsen avatar Aug 14 '24 18:08 connernilsen