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

End the suffering, turn back on implicit_transitive_deps #14787

Merged
merged 3 commits into from
Jan 9, 2024

Conversation

mrmr1993
Copy link
Member

@mrmr1993 mrmr1993 commented Jan 4, 2024

This was a mistake, and we have now learned from it :)

Context:

We had hoped that this option would get dune to warn us when we were underspecifying our dependencies. In particular, since dune is able to infer the transitive dependencies, it has all the information that we need. However, in practice this is implemented in a way that's very inconvenient to use:

  • dune doesn't emit any warnings;
  • dune doesn't resolve upstream transitive dependencies (e.g. core -> core_kernel -> base -> base.caml), which makes our external dependencies unnecessarily and unhelpfully verbose;
  • the OCaml compiler is the only thing 'checking' the dependencies, and missing types are treated as 'abstract'
    • this causes unpleasant and confusing error messages,
    • the OCaml compiler uses head-normalising type path expansion, so if we have A.t = B.t = C.t = int * bool, the error will report that A.t is abstract even when B or C are the missing libraries.

The correct approach is to add a mode for dune to check the (local/workspace) dependency enumeration, using its internal tracking; this is explicitly not done here.

@mrmr1993 mrmr1993 requested review from a team as code owners January 4, 2024 21:20
@mrmr1993
Copy link
Member Author

mrmr1993 commented Jan 4, 2024

!ci-build-me

@emberian
Copy link
Contributor

emberian commented Jan 4, 2024

Our dune deps could be so pretty...

@bkase
Copy link
Member

bkase commented Jan 5, 2024

I get it ended up being too much pain, and not worth the benefit, but could you include a few bullet points at the top about why it ended up being a mistake so we have a record of it?

Here's the original issue on it:
#2451

@deepthiskumar
Copy link
Member

!ci-build-me

@emberian
Copy link
Contributor

emberian commented Jan 8, 2024

As a quick example of the pain, a recent change I introduced to wire types required changing exactly 100 of our packages to add a trivial line, otherwise getting annoying errors about the types being opaque.

It also makes it challenging to figure out which libraries are actually in use for a given library- and leads to cargo-culting huge library lists that may not even be precise anymore.

@mrmr1993
Copy link
Member Author

mrmr1993 commented Jan 8, 2024

!ci-build-me

@mrmr1993
Copy link
Member Author

mrmr1993 commented Jan 9, 2024

!approved-for-mainnet

@mrmr1993 mrmr1993 merged commit 8e71923 into rampup Jan 9, 2024
36 checks passed
@mrmr1993 mrmr1993 deleted the the-pain-ends-here branch January 9, 2024 18:00
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 this pull request may close these issues.

8 participants