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

Compatibility for /lib64 suffix #1594

Open
redin0s opened this issue Sep 26, 2023 · 1 comment
Open

Compatibility for /lib64 suffix #1594

redin0s opened this issue Sep 26, 2023 · 1 comment

Comments

@redin0s
Copy link

redin0s commented Sep 26, 2023

I was trying to build bap from source and I encountered an error when building.
Specifically in tools/rewrite.ml there is an issue when the ocaml library is present in the path /usr/lib64/ocaml and the following instruction raises an error.

String.chop_suffix_exn stdlib "/lib/ocaml"

I have attempted a naive fix by modifying the code.

let prefix =
  let stdlib = Cfg.ocaml_config_var_exn self "standard_library" in
  (
  try
      String.chop_suffix_exn stdlib "/lib/ocaml"
  with
  | exn ->
      String.chop_suffix_exn stdlib "/lib64/ocaml"
  ) in

I have not submitted a pull request since I don't really know if this is the standard way of dealing with this things in ocaml as it is my first time using.

@ivg
Copy link
Member

ivg commented Feb 16, 2024

Support for dune is still in the experimental stage. And indeed, I didn't consider that there could be another suffix. I think a better option here would be to chop two last path elements. A PR would be welcome, otherwise I will try to find some time to fix it. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants