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

Wrap vendored modules to avoid build conflicts #250

Merged
merged 2 commits into from
Mar 13, 2023
Merged

Wrap vendored modules to avoid build conflicts #250

merged 2 commits into from
Mar 13, 2023

Conversation

aantron
Copy link
Owner

@aantron aantron commented Mar 10, 2023

This FYI PR renames the vendored Gluten, http/af, h2, websocket/af, to Dream_gluten, etc., to avoid conflicts with versions of these modules installed from opam.

I took a different, much less invasive and much more maintainable approach to the renaming than in #200. I used that we replace all the dune files of the vendored modules with src/vendor/dune to wrap e.g. Gluten as Dream_gluten.Gluten, and then added module aliases at the top of each file that used Gluten, so module Gluten = Dream_gluten.Gluten. This is in contrast to #200, which renamed the Gluten to Dream_gluten throughout the code in all the files, and renamed the files. I will check that this truly doesn't conflict with parallel installations of the "real" Gluten.

I still have paf to rename afterwards, but it should go the same way as the other four libraries.

cc @clecat @anmonteiro @dinosaure @hannesm @TheLortex

Fixes #198.
Closes #200.

@aantron aantron changed the title Rename vendored modules to avoid build conflicts Wrap vendored modules to avoid build conflicts Mar 10, 2023
@dinosaure
Copy link
Contributor

It's good for me as far as it fixes the initial issue explained by #200 👍 .

@hannesm
Copy link
Contributor

hannesm commented Mar 10, 2023

Thanks, this looks like a reasonable path forwards. I'm curious why gluten, h2, and paf are still vendored -- can't you just use the latest releases thereof? Removing vendored projects should ease the maintenance.

For http/af I understand it hasn't seen a release in quite some while (and there's still inhabitedtype/httpaf#203 open). websocket/af don't know much about.

Thanks for your work on dream and picking up the outstanding issues.

@aantron
Copy link
Owner Author

aantron commented Mar 10, 2023

I'm curious why gluten, h2, and paf are still vendored

h2 depends on http/af. An opam h2 will build against an opam http/af, but we need it to build against Dream's http/af. The same is true for paf.

Gluten indeed can be used from opam, and before I settled on this approach I started a branch which unvendored it. But because everything else depends on http/af, it's the only library that can be taken out, and I decided that it's not worth it for the time being. In the past, Gluten was released less frequently and it was convenient (actually, necessary), to be able to point it to any commit. It's best to just keep this benefit for now, given that Gluten is directly related to all the other vendored libraries, and the very incremental benefit of unvendoring only Gluten.

@aantron aantron merged commit c394615 into master Mar 13, 2023
@aantron aantron deleted the rename-alt branch April 21, 2023 05:21
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.

Prefix the vendored libraries
3 participants