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

[new release] randoml (0.1.4) #19057

Closed
wants to merge 2 commits into from
Closed

Conversation

mimoo
Copy link
Contributor

@mimoo mimoo commented Jul 14, 2021

Generating cryptographically-secure random numbers

CHANGES:

Fix vendoring of rust dependencies for release (bis) (bis)

CHANGES:

Fix vendoring of rust dependencies for release (bis) (bis)
@mimoo
Copy link
Contributor Author

mimoo commented Jul 14, 2021

\o/

@mseri
Copy link
Member

mseri commented Jul 14, 2021

Oh now some builds are passing. You probably are using some new feature which is not in the 2018 edition. That would explain why only on some distributions it compiles properly. The linking error in the tests is more subtle though... I would not know where to start looking

@mimoo
Copy link
Contributor Author

mimoo commented Jul 14, 2021

For some of these errors, it most probably is the version of rust that is too low. Is there a way to enforce a constraint on the rust version within an opam file?

@mseri
Copy link
Member

mseri commented Jul 14, 2021

I don't think we have a good solution for that yet. Just for the editions.
There have been some discussions, for example https://discuss.ocaml.org/t/cargo-opam-packaging-of-a-rust-ocaml-project/5743 but you will find more also in PRs or issues in this repo, which somehow led to what we currently have which is somehow a middle ground.

In this case one could add a post-install failure message that informs the user about the minimal rust requirements for example

@mimoo
Copy link
Contributor Author

mimoo commented Jul 14, 2021

Thanks for the pointer! I'm thinking that a similar package as conf-rust-2018 might work : o I'll look into it.

@mimoo
Copy link
Contributor Author

mimoo commented Jul 15, 2021

trying to do that here: #19061

@mseri
Copy link
Member

mseri commented Jul 21, 2021

@mimoo this is using rust 1.53.0 but it fails during linking (the same failure happens in a few instances with 1.53):

#=== ERROR while compiling randoml.0.1.4 ======================================#
# context              2.0.9 | linux/x86_64 | ocaml-base-compiler.4.12.0 | pinned(https://github.com/mimoo/randoml/releases/download/0.1.4/randoml-0.1.4.tbz)
# path                 ~/.opam/4.12/.opam-switch/build/randoml.0.1.4
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p randoml -j 47 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/randoml-48-5f1023.env
# output-file          ~/.opam/log/randoml-48-5f1023.out
### output ###
#        cargo lib/rand/dllrand.so,lib/rand/librand.a
#    Compiling proc-macro2 v1.0.27
#    Compiling libc v0.2.97
#    Compiling unicode-xid v0.2.2
#    Compiling cc v1.0.68
#    Compiling syn v1.0.73
#    Compiling cfg-if v1.0.0
#    Compiling ocaml-sys v0.20.1
#    Compiling ocaml-sys v0.22.0
#    Compiling cty v0.2.1
#    Compiling chlorine v1.0.7
#    Compiling ppv-lite86 v0.2.10
#    Compiling static_assertions v1.1.0
#    Compiling quote v1.0.9
#    Compiling ocaml-boxroot-sys v0.2.0
#    Compiling getrandom v0.2.3
#    Compiling rand_core v0.6.3
#    Compiling rand_chacha v0.3.1
#    Compiling ocaml-interop v0.8.4
#    Compiling rand v0.8.4
#    Compiling synstructure v0.12.4
#    Compiling ocaml-derive v0.22.0
#    Compiling ocaml v0.22.0
#    Compiling rand v0.1.0 (/home/opam/.opam/4.12/.opam-switch/build/randoml.0.1.4/_build/default/lib/rand)
#     Finished release [optimized] target(s) in 11.54s
#     ocamlopt lib/.randoml.inline-tests/inline_test_runner_randoml.exe (exit 2)
# (cd _build/default && /home/opam/.opam/4.12/bin/ocamlopt.opt -w -40 -w -24 -g -g -o lib/.randoml.inline-tests/inline_test_runner_randoml.exe /home/opam/.opam/4.12/lib/base/base_internalhash_types/base_internalhash_types.cmxa -I /home/opam/.opam/4.12/lib/base/base_internalhash_types /home/opam/.opam/4.12/lib/base/caml/caml.cmxa /home/opam/.opam/4.12/lib/sexplib0/sexplib0.cmxa /home/opam/.opam/4.12/lib/base/shadow_stdlib/shadow_stdlib.cmxa /home/opam/.opam/4.12/lib/base/base.cmxa -I /home/opam/.opam/4.12/lib/base /home/opam/.opam/4.12/lib/ppx_sexp_conv/runtime-lib/ppx_sexp_conv_lib.cmxa /home/opam/.opam/4.12/lib/ppx_compare/runtime-lib/ppx_compare_lib.cmxa /home/opam/.opam/4.12/lib/ppx_enumerate/runtime-lib/ppx_enumerate_lib.cmxa /home/opam/.opam/4.12/lib/ppx_hash/runtime-lib/ppx_hash_lib.cmxa /home/opam/.opam/4.12/lib/ppx_here/runtime-lib/ppx_here_lib.cmxa /home/opam/.opam/4.12/lib/ppx_assert/runtime-lib/ppx_assert_lib.cmxa /home/opam/.opam/4.12/lib/ppx_bench/runtime-lib/ppx_bench_lib.cmxa /home/opam/.opam/4.12/lib/base/md5/md5_lib.cmxa /home/opam/.opam/4.12/lib/ocaml/unix.cmxa -I /home/opam/.opam/4.12/lib/ocaml /home/opam/.opam/4.12/lib/ocaml/bigarray.cmxa -I /home/opam/.opam/4.12/lib/ocaml /home/opam/.opam/4.12/lib/fieldslib/fieldslib.cmxa /home/opam/.opam/4.12/lib/variantslib/variantslib.cmxa /home/opam/.opam/4.12/lib/bin_prot/shape/bin_shape_lib.cmxa /home/opam/.opam/4.12/lib/bin_prot/bin_prot.cmxa -I /home/opam/.opam/4.12/lib/bin_prot /home/opam/.opam/4.12/lib/ppx_inline_test/config/inline_test_config.cmxa /home/opam/.opam/4.12/lib/jane-street-headers/jane_street_headers.cmxa /home/opam/.opam/4.12/lib/time_now/time_now.cmxa -I /home/opam/.opam/4.12/lib/time_now /home/opam/.opam/4.12/lib/ppx_inline_test/runtime-lib/ppx_inline_test_lib.cmxa /home/opam/.opam/4.12/lib/stdio/stdio.cmxa /home/opam/.opam/4.12/lib/ppx_module_timer/runtime/ppx_module_timer_runtime.cmxa /home/opam/.opam/4.12/lib/typerep/typerep_lib.cmxa /home/opam/.opam/4.12/lib/ppx_expect/common/expect_test_common.cmxa /home/opam/.opam/4.12/lib/ppx_expect/config_types/expect_test_config_types.cmxa /home/opam/.opam/4.12/lib/ppx_expect/collector/expect_test_collector.cmxa -I /home/opam/.opam/4.12/lib/ppx_expect/collector /home/opam/.opam/4.12/lib/ppx_expect/config/expect_test_config.cmxa /home/opam/.opam/4.12/lib/splittable_random/splittable_random.cmxa /home/opam/.opam/4.12/lib/base_quickcheck/base_quickcheck.cmxa /home/opam/.opam/4.12/lib/base_bigstring/base_bigstring.cmxa -I /home/opam/.opam/4.12/lib/base_bigstring /home/opam/.opam/4.12/lib/core_kernel/base_for_tests/base_for_tests.cmxa /home/opam/.opam/4.12/lib/parsexp/parsexp.cmxa /home/opam/.opam/4.12/lib/sexplib/sexplib.cmxa /home/opam/.opam/4.12/lib/core_kernel/core_kernel.cmxa -I /home/opam/.opam/4.12/lib/core_kernel /home/opam/.opam/4.12/lib/ocaml/nums.cmxa -I /home/opam/.opam/4.12/lib/ocaml /home/opam/.opam/4.12/lib/zarith/zarith.cmxa -I /home/opam/.opam/4.12/lib/zarith /home/opam/.opam/4.12/lib/zarith_stubs_js/zarith_stubs_js.cmxa /home/opam/.opam/4.12/lib/bignum/bigint/bigint.cmxa lib/rand/rand.cmxa -I lib/rand lib/randoml.cmxa /home/opam/.opam/4.12/lib/ppx_inline_test/runner/lib/ppx_inline_test_runner_lib.cmxa -I /home/opam/.opam/4.12/lib/ppx_inline_test/runner/lib lib/.randoml.inline-tests/.randoml.inline-tests.eobjs/native/dune__exe__Inline_test_runner_randoml.cmx -linkall)
# /usr/bin/ld: lib/rand/librand.a(std-4b7af11f63a04154.std.e65s9sct-cgu.0.rcgu.o): undefined reference to symbol 'pthread_rwlock_wrlock@@GLIBC_2.2.5'
# /usr/bin/ld: /usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
# collect2: error: ld returned 1 exit status
# File "caml_startup", line 1:
# Error: Error during linking (exit code 1)

It compiles but fails in the same way in other distros with rust >= 1.43. Are you sure that 1.53 is the minimal version?

@mseri
Copy link
Member

mseri commented Sep 7, 2021

Hi, how is it going? I tried to look at the code, but I don't know how to solve this linking issue at the moment, did you try something?

@mimoo
Copy link
Contributor Author

mimoo commented Sep 7, 2021

sorry this has been in limbo as I've context switched. I've kept this unread until I get back into reading more about that :o you can close this issue if you want I'll reopen/recreate it when I get to it!

@mseri
Copy link
Member

mseri commented Sep 8, 2021

Let's leave it open for now. I think maybe something is needed on how dune is linking the library. May be worth asking on the dune repository, or in the discuss.ocaml.org forum, some of the people there have experience with mixing rust and dune. I am very curious to see how this is solved, I have some plans for hybrid rust-ocaml libraries as well

@mseri
Copy link
Member

mseri commented Sep 17, 2021

Hi @mimoo can you re tag and re release with the new changes?

@mimoo
Copy link
Contributor Author

mimoo commented Sep 20, 2021

Thanks for the help! Here it is: #19612

@mimoo mimoo closed this Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants