zshipko / ocaml-rs

OCaml extensions in Rust
https://docs.rs/ocaml
ISC License
259 stars 31 forks source link

install error #27

Closed progman1 closed 4 years ago

progman1 commented 4 years ago

hi

I installed on x86-64 system with no problem but then switched to a armv7l and got this install error:

   Compiling ocaml v0.11.3
error[E0308]: mismatched types
  --> /home/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/ocaml-0.11.3/src/value.rs:56:47
   |
56 |             let named = sys::caml_named_value(s.as_ptr());
   |                                               ^^^^^^^^^^ expected `i8`, found `u8`
   |
   = note: expected raw pointer `*const i8`
              found raw pointer `*const u8`

I don't know enough about rust at the moment to fix this but I note that the cargo.toml for ocaml-sys says it's repository is the same as for ocaml-rs. also its doc is docs.rs/ocaml-sys but ocaml-rs's is docs.rs/ocaml ! I also see that in earlier versions caml-named-value was declared in ocaml-rs with a u8 rather than i8.

zshipko commented 4 years ago

Thanks!

I've just pushed some changes to master that will hopefully fix this. I don't have access to an armv7l machine, but it has been tested on armv8 - I will also look into setting up an armv7 virtual machine to run the tests in. Let me know if you run into any more issues getting things working on armv7.

To test out the new change you will need to edit your ocaml dependency in Cargo.toml:

ocaml = {git = "https://github.com/zshipko/ocaml-rs"}

In regards to the docs, here is ocaml-sys and here is ocaml - the source for these projects does live in the same repo, but there are separate docs.

progman1 commented 4 years ago

thank you! one surprise, though I'm sure there is no toml / .cargo/config thing causing this is:

   Compiling ocaml-sys v0.11.0 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml v0.11.3 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml2rust v0.1.0 (/home/dev/experiments/ocaml-rust-starter)
    Finished release [optimized] target(s) in 13.66s

on each and every cargo build without changing lib.rs! even before incremental compilation I thought rust didn't recompile entire crates unnecessarily. it is taking appreciable time on my small system so I would say it really is compiling from scratch. confusingly, it is not recompiling ocaml-derive, which would not be surprising if it is bahaving completely bonkers anyway. any idea why the above is happening? cheers.

On 05/05/2020, zach notifications@github.com wrote:

Thanks!

I've just pushed some changes to master that will hopefully fix this. I don't have access to an armv7l machine, but it has been tested on armv8. Let me know if you run into any more issues getting things working on armv7.

In regards to the docs, here is ocaml-sys and here is ocaml - the source for these projects does live in the same repo, but there are separate docs.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624129554

zshipko commented 4 years ago

Great, glad that works!

I'm not sure about that behavior, is your repo available anywhere for me to look at? Did you use https://github.com/zshipko/ocaml-rust-starter or something else to set up the dune file and everything?

progman1 commented 4 years ago

yes the 'starter' indeed, name change only! I'm running cargo directly to see what's happening.

On 05/05/2020, zach notifications@github.com wrote:

Great, glad that works!

I'm not sure about that behavior, is your repo available anywhere for me to look at? Did you use https://github.com/zshipko/ocaml-rust-starter or something else to set up the dune file and everything?

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624214731

progman1 commented 4 years ago

can you post your cargo build output please!?

On 05/05/2020, kris cq.personal@gmail.com wrote:

thank you! one surprise, though I'm sure there is no toml / .cargo/config thing causing this is:

   Compiling ocaml-sys v0.11.0 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml v0.11.3 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml2rust v0.1.0 (/home/dev/experiments/ocaml-rust-starter)
    Finished release [optimized] target(s) in 13.66s

on each and every cargo build without changing lib.rs! even before incremental compilation I thought rust didn't recompile entire crates unnecessarily. it is taking appreciable time on my small system so I would say it really is compiling from scratch. confusingly, it is not recompiling ocaml-derive, which would not be surprising if it is bahaving completely bonkers anyway. any idea why the above is happening? cheers.

On 05/05/2020, zach notifications@github.com wrote:

Thanks!

I've just pushed some changes to master that will hopefully fix this. I don't have access to an armv7l machine, but it has been tested on armv8. Let me know if you run into any more issues getting things working on armv7.

In regards to the docs, here is ocaml-sys and here is ocaml - the source for these projects does live in the same repo, but there are separate docs.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624129554

progman1 commented 4 years ago

ah, maybe it is because now using ocaml="git..." to get your fix? do you see a difference?

On 05/05/2020, kris cq.personal@gmail.com wrote:

can you post your cargo build output please!?

On 05/05/2020, kris cq.personal@gmail.com wrote:

thank you! one surprise, though I'm sure there is no toml / .cargo/config thing causing this is:

   Compiling ocaml-sys v0.11.0
(git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml v0.11.3 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml2rust v0.1.0 (/home/dev/experiments/ocaml-rust-starter)
    Finished release [optimized] target(s) in 13.66s

on each and every cargo build without changing lib.rs! even before incremental compilation I thought rust didn't recompile entire crates unnecessarily. it is taking appreciable time on my small system so I would say it really is compiling from scratch. confusingly, it is not recompiling ocaml-derive, which would not be surprising if it is bahaving completely bonkers anyway. any idea why the above is happening? cheers.

On 05/05/2020, zach notifications@github.com wrote:

Thanks!

I've just pushed some changes to master that will hopefully fix this. I don't have access to an armv7l machine, but it has been tested on armv8. Let me know if you run into any more issues getting things working on armv7.

In regards to the docs, here is ocaml-sys and here is ocaml - the source for these projects does live in the same repo, but there are separate docs.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624129554

zshipko commented 4 years ago

Ah yeah, when I switch to the git repo I see the same behavior!

I'm not sure how to fix that but I can make a release with the latest code by the end of the day to avoid using the git source.

progman1 commented 4 years ago

that's it! installed on another system ... will you publish a new version? I can then switch back and go full speed ahead :) it's curious that cargo doesn't notice a lack of change in the repo. I will raise an issue!

On 05/05/2020, kris cq.personal@gmail.com wrote:

ah, maybe it is because now using ocaml="git..." to get your fix? do you see a difference?

On 05/05/2020, kris cq.personal@gmail.com wrote:

can you post your cargo build output please!?

On 05/05/2020, kris cq.personal@gmail.com wrote:

thank you! one surprise, though I'm sure there is no toml / .cargo/config thing causing this is:

   Compiling ocaml-sys v0.11.0
(git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml v0.11.3 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml2rust v0.1.0
(/home/dev/experiments/ocaml-rust-starter)
    Finished release [optimized] target(s) in 13.66s

on each and every cargo build without changing lib.rs! even before incremental compilation I thought rust didn't recompile entire crates unnecessarily. it is taking appreciable time on my small system so I would say it really is compiling from scratch. confusingly, it is not recompiling ocaml-derive, which would not be surprising if it is bahaving completely bonkers anyway. any idea why the above is happening? cheers.

On 05/05/2020, zach notifications@github.com wrote:

Thanks!

I've just pushed some changes to master that will hopefully fix this. I don't have access to an armv7l machine, but it has been tested on armv8. Let me know if you run into any more issues getting things working on armv7.

In regards to the docs, here is ocaml-sys and here is ocaml - the source for these projects does live in the same repo, but there are separate docs.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624129554

progman1 commented 4 years ago

ok, thanks very much!

On 05/05/2020, kris cq.personal@gmail.com wrote:

that's it! installed on another system ... will you publish a new version? I can then switch back and go full speed ahead :) it's curious that cargo doesn't notice a lack of change in the repo. I will raise an issue!

On 05/05/2020, kris cq.personal@gmail.com wrote:

ah, maybe it is because now using ocaml="git..." to get your fix? do you see a difference?

On 05/05/2020, kris cq.personal@gmail.com wrote:

can you post your cargo build output please!?

On 05/05/2020, kris cq.personal@gmail.com wrote:

thank you! one surprise, though I'm sure there is no toml / .cargo/config thing causing this is:

   Compiling ocaml-sys v0.11.0
(git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml v0.11.3 (git://github.com/zshipko/ocaml-rs#b5f9c315)
   Compiling ocaml2rust v0.1.0
(/home/dev/experiments/ocaml-rust-starter)
    Finished release [optimized] target(s) in 13.66s

on each and every cargo build without changing lib.rs! even before incremental compilation I thought rust didn't recompile entire crates unnecessarily. it is taking appreciable time on my small system so I would say it really is compiling from scratch. confusingly, it is not recompiling ocaml-derive, which would not be surprising if it is bahaving completely bonkers anyway. any idea why the above is happening? cheers.

On 05/05/2020, zach notifications@github.com wrote:

Thanks!

I've just pushed some changes to master that will hopefully fix this. I don't have access to an armv7l machine, but it has been tested on armv8. Let me know if you run into any more issues getting things working on armv7.

In regards to the docs, here is ocaml-sys and here is ocaml - the source for these projects does live in the same repo, but there are separate docs.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624129554

zshipko commented 4 years ago

This has been now been released: https://crates.io/crates/ocaml

Thanks for reporting the issue, definitely let me know if you run into anything else!

progman1 commented 4 years ago

the feedback on the issue I opened https://github.com/rust-lang/cargo/issues/8209#issuecomment-624396503

points to stale: missing "/home/dev/.cargo/git/checkouts/ocaml-rs-da52f9c65e24ce66/40c8624/sys/ocamlopt"

could it be to do with the build.rs that is part of ocaml-sys? fyi: strangely the 2nd system I installed on to verify the problem demonstrated the recovery by going back to ocaml="*" but on the original system, now having downloaded your new release and compiling just fine, there is still the recompilation whether pointing to the git repo or not.

On 06/05/2020, zach notifications@github.com wrote:

Closed #27.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#event-3306375516

zshipko commented 4 years ago

Ah thank you for opening that issue, I will remove the ocamlopt check for recompilation and rerelease right now.

zshipko commented 4 years ago

Okay, a new release (0.12.1) has been pushed to crates.io. This should fix the issue with this missing ocamlopt file.

I was trying to force recompilation if a new opam switch has been activated, but I forgot that ocamlopt may not be an absolute path so will need to put a little more thought into how to make that work.

progman1 commented 4 years ago

it didn't work for me! now on 12.1 for ocaml-rs (ocaml-sys still at 12.0). but still failing on this missing file: [2020-05-07T09:58:24Z INFO cargo::core::compiler::fingerprint] stale: missing "/home/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/ocaml-sys-0.12.0/ocamlopt"

On 06/05/2020, zach notifications@github.com wrote:

Okay, a new release (0.12.1) has been pushed to crates.io. This should fix the issue with this missing ocamlopt file.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-624712449

zshipko commented 4 years ago

Sorry about that, I had forgotten to push ocaml-sys version 0.12.1 to crates.io, but it's up there now.

progman1 commented 4 years ago

that did the trick. a big thanks for this project - rust/ocaml makes a great combo...

On 07/05/2020, zach notifications@github.com wrote:

Sorry about that, I had forgotten to push ocaml-sys version 0.12.1 to crates.io, but it's up there now.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zshipko/ocaml-rs/issues/27#issuecomment-625270325