-
Notifications
You must be signed in to change notification settings - Fork 82
Fix linking of .cmxs targets that link stubs. #159
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
Conversation
Makefile
Outdated
@@ -143,13 +143,22 @@ src/ocamlbuildlib.cmxa: src/ocamlbuild_pack.cmx $(EXTRA_CMX) | |||
|
|||
# The packs | |||
|
|||
# Build artifacts are first placed into tmp/ to avoid a race condition | |||
# described in https://caml.inria.fr/mantis/view.php?id=4991. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it not be simpler to just have src/ocamlbuild_pack.cmx
depend on src/ocamlbuild_pack.cmi
? This corresponds to serializing (byte before native), but it makes for simpler code (and makes sure there are no side-effects related to running in a different directory).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gasche It doesn't work. The ocamlopt command touches the cmi file, leading to a spurious rebuild afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah... Now we understand #128!
src/ocaml_specific.ml
Outdated
(Ocaml_compiler.native_shared_library_link ~tags:["profile";"linkall"] "%.p.cmxa" "%.p.cmxs");; | ||
|
||
rule "ocaml: cmxa & a -> cmxs & so" | ||
~prods:["%.cmxs"; x_dll] | ||
~deps:["%.cmxa"; x_a] | ||
~deps:["%.cmxa"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if .a
is not a dependency, the rule text/name should be cmxa -> cmxs & so
. (Same above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
I would still like to do a release without any of the |
Before the recent .cmxs refactor, i.e. 89888f2...f865497, .cmxs files were built from .cmx and .o files. After commit f865497, .cmxs files are built from .cmxa and .a files, which is wrong, because .cmxa files already contain the autolink instructions necessary to link the .a file; and on top of that, no -I flag was provided when linking the .cmxs file, which resulted in the linker being unable to follow the autolink instructions. This caused failures in the wild when ocamlbuild 0.10.0 got released: ocaml/opam-repository#8157. After this commit, .a files are no longer explicitly passed when building a .cmxs file. Additionally, for every linked file, a -I flag is passed, with the directory containing the file being linked.
@gasche CI is now green here. |
@gasche So, how exactly (in terms of workflow) do you imagine making this intermediate release? |
Two things:
|
Yes, this is exactly my argument. How about just installing a non-insignificant amount of packages using ocamlbuild? |
My idea was:
We can merge the present PR before all of this (it would be reverted, and then un-reverted), or only at step (3). Ideally I would have liked to test an opam build with the post-merge state (with the cmxs/mllib features in) before releasing it on the opam-repository, but I don't have the energy to setup this experiment right now. |
Is this really any better than the already-released 0.9.3? That's a lot of effort to expend on a number of minor fixes, and we still have to do the exactly same amount of testing for any more ambitious release on top of that. |
This is the reasoning I had when deciding to skip this step and release 10.x, and then I regretted it. That said, I am not in a strong position for negotiation right now. If you strongly think that we should go ahead and just release 11.x, I am willing to be convinced. (Especially if I have the impression impression that you might help mitigate potential regressions since 0.9.x that would appear after the release.) |
Yes, that's the idea, on both counts. In fact if anyone pinged me before reverting 0.10.x we might have avoided this whole thing. |
Ok, let's go with it then. I propose to merge this and open a separate issue to discuss release coordination -- I can do some Changelog stuff, but I think it would be nice if you sent the announce when it happens. Do you have plans on the testing front? |
Sounds good.
Yes, I'm running some tests now. |
See the individual commit messages. In general, this addresses the reasons 0.10.1 got reverted, and also fixes several glaring omissions in the build system and test suite that made writing the test for the fix quite obnoxious.