-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Order of dream
and caqti-driver-postgresql
in libraries stanza cause build to fail or succeed on MacOS
#298
Comments
Thank you! @paurkedal Would you be able to comment on this issue? Do we need to document this, or is there a way to address it technically? |
Does it compile if the ( |
When Logs:
You can reproduce the issue by running |
Yes, the runtime error is expected, but that confirms that the postgresql driver or library is involved in some way. The next I would try would be to repeat with I don't have MacOS, but I can try to reproduce on Linux tomorrow if it's not ruled out. |
AFAIK the issue does not exist on Linux. (I initially was developing on Linux and only found out about the issue when testing to MacOS). |
Ah yes, you already wrote that in the OP. Nice work with minimizing the code. Could the problem have the same underlying cause as facebookincubator/velox#5631? That is, two packages linking against different versions of libssl? |
It may also be instructive to try a further minimization, by reducing to let _digest = Ssl.digest
let _connect () = new Postgresql.connection () In light of the previous comment, note that the OpenSSL version used for the |
I reduced the program to the 2 line you suggested and replaced the libraries with the one you suggested and got the following error when building:
I then flipped the order of |
It seems almost clear now; at least the fact that some |
This solved my issue although I was using cryptokit, same thing though so if anyone else stumbles on this in the future it was the ordering as well for me. I had: (libraries lwt cryptokit petrol caqti caqti-lwt caqti-driver-postgresql) and got the following error on build:
Just changing the ordering of the libraries in the dune file to: (libraries lwt petrol caqti caqti-lwt caqti-driver-postgresql cryptokit) and everything built without an error. Wasted maybe 8 hours on this and went down a lot of rabbit holes with openssl and other fun stuff. |
Thank you! What system did you observe this on? Also macOS? |
yup I'm on macOS 14.2 (Sonoma) |
@paurkedal I'd like to close this issue here in this repo, as it seems not to be caused by Dream, though it's good that it started here because Dream's users are affected by it and can search for it. Where should it be reported? Caqti? |
Caqti is also just an intermediary is this, as far as I understand the problem. Though, I'm not sure what the postgresql-ocaml library can do if, as I assumed above, the issue is that the |
cc @toots, @anmonteiro, @mmottl about the linking options. Do you know what is causing this ordering issue on macOS? |
It would be nice if we could have the full linking command in the broken and working case to have a look at them. |
On MacOS, I have been trying to build a project that depends on
dream
andcaqti-driver-postgresql
but get the following error:The problem is caused by the order of which things are being linked. Once I ran the underyling
ocamlopt.opt
command run bydune
and using-ccopt
to force-lssl
to be included at the beginning and it worked. This problem does not exist on linux.Now switching the order of
dream
andcaqti-driver-postgresql
in thedune
file cause it to build without issues:The text was updated successfully, but these errors were encountered: