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

Regression from 1.6 to 1.7 for libraries with archives in subdirectories #1885

Closed
jberdine opened this issue Feb 26, 2019 · 1 comment · Fixed by ocaml/opam-repository#13542

Comments

@jberdine
Copy link
Contributor

I'm seeing build failures with 1.7.* that work well with 1.6.3, in particular due to bec9fbb from #1329.

I don't have a self-contained repro yet, but figured I'd open an issue in case there are any quick comments. The symptom is warnings (that a later commit makes into errors) such as:

File unavailable: /Users/jjb/.opam/sledge/lib/llvm/llvm_analysis.cmxa

This come from building a library with (libraries llvm.analysis ...) in its dune. Note that the llvm_analysis.cmxa file is actually present as /Users/jjb/.opam/sledge/lib/llvm/static/llvm_analysis.cmxa. Note the added static directory. This comes from the META.llvm file, which declares packages with archives in the static subdirectory:

name = "llvm"
version = "7.0.0svn"
description = "LLVM OCaml bindings"
archive(byte) = "static/llvm.cma"
archive(native) = "static/llvm.cmxa"
directory = "llvm"

package "analysis" (
    requires = "llvm"
    version = "7.0.0svn"
    description = "Intermediate representation analysis for LLVM"
    archive(byte) = "static/llvm_analysis.cma"
    archive(native) = "static/llvm_analysis.cmxa"
)

I don't know if META files are not supposed to do that, but it worked with dune 1.6.

FWIW, looking at the patch, the use of basename here looked suspicious to me.

@ghost
Copy link

ghost commented Feb 27, 2019

That's definitely a bug in Dune. The basename you pointed is indeed the culprit: the same make function is used to construct Lib.t` values for both internal and external libraries and it is wrong in the case of external libraries. Thanks for debugging this.

@ghost ghost closed this as completed in #1889 Feb 27, 2019
ghost pushed a commit that referenced this issue Feb 27, 2019
Fix #1885

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
rgrinberg pushed a commit that referenced this issue Feb 27, 2019
Fix #1885

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
rgrinberg added a commit to rgrinberg/opam-repository that referenced this issue Feb 27, 2019
CHANGES:

- Fix interpretation of `META` files containing archives with `/` in
  the filename. For instance, this was causing llvm to be unusable
  with dune (ocaml/dune#1889, fix ocaml/dune#1885, @diml)

- Make errors about menhir stanzas be located (ocaml/dune#1881, fix ocaml/dune#1876,
  @diml)
This issue was closed.
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

Successfully merging a pull request may close this issue.

1 participant