Skip to content

fix the -runtime-variant option for bytecode#8537

Merged
dra27 merged 4 commits intoocaml:trunkfrom
damiendoligez:runtime-variant-fixes
Jun 11, 2019
Merged

fix the -runtime-variant option for bytecode#8537
dra27 merged 4 commits intoocaml:trunkfrom
damiendoligez:runtime-variant-fixes

Conversation

@damiendoligez
Copy link
Copy Markdown
Member

@damiendoligez damiendoligez commented Mar 22, 2019

The -runtime-variant option has been broken since 4.03.0 because the camlheaderd and camlheaderi files are installed under the wrong names. The first commit fixes this problem.

The failure is silent and a bytecode file is produced that has the executable flag but doesn't work because the header is missing. The second commit adds some error handling for this case (in particular when the user specifies a runtime variant that doesn't exist).

Note: the first bug was introduced by myself in commit 0225ca0

@damiendoligez
Copy link
Copy Markdown
Member Author

See also #2309 and #6199.

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also related to #2267. I appear to be in a very nitty mood this morning with the other comments.

Location.print_filename file
| Required_module_unavailable s ->
fprintf ppf "Required module `%s' is unavailable" s
fprintf ppf "Required module '%s' is unavailable" s
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the elimination of the back-tick here? FWIW, I'd prefer to see other instances of '%s' changed to `%s' rather than this way around?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dra27 some people from your faculty may disagree ;-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite possibly - but let's remove them wholesale, rather than piecemeal with other changes 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I'd also prefer them either to be post-processed to the correct Unicode character before going to the console, or for us finally to allow the correct Unicode characters directly in the message, both of which would keep Markus happy!)

@dra27
Copy link
Copy Markdown
Member

dra27 commented Mar 26, 2019

I have a nagging concern that the flexlink bootstrap relies on the "silent fail" behaviour when the header is missing - I just want to check what's going on there before this is merged (I'm suspicious that in bytecode-only mode, it may result in a corrupt flexlink.exe being installed).

@dra27
Copy link
Copy Markdown
Member

dra27 commented Mar 26, 2019

Just to confirm - this PR will break the flexdll bootstrap build the next time someone commits a bootstrap. Do you mind if I push fixes directly?

@dra27
Copy link
Copy Markdown
Member

dra27 commented Mar 26, 2019

I've rebased and added commits to fix the flexdll bootstrap in my fork

@damiendoligez damiendoligez force-pushed the runtime-variant-fixes branch 2 times, most recently from 2d7eef4 to 98c598d Compare May 10, 2019 12:49
@damiendoligez
Copy link
Copy Markdown
Member Author

@dra27 I've applied all your suggestions and integrated your flexdll fixes (tested by bootstrapping flexdll on mingw64).

I've also moved the Change entry to 4.09, as I intend to cherry-pick this patch.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Jun 10, 2019

@damiendoligez - squash or merge, and still good for 4.09?

@gasche
Copy link
Copy Markdown
Member

gasche commented Jun 10, 2019

This is a bugfix so it should be good for 4.09.
(I have a marked preference for having merge commits. In this case the history is not great, but we don't want an extra roundtrip with the contributor, and it's not so bad, so I would just Merge directly.)

damiendoligez and others added 4 commits June 10, 2019 11:17
… under

the wrong names, which made -runtime-variant fail for bytecode.
If OCaml was already installed, camlheader would be used from the
installation when building the bytecode flexdll/flexlink.exe
@dra27 dra27 force-pushed the runtime-variant-fixes branch from 98c598d to 5231ae1 Compare June 10, 2019 10:24
@dra27
Copy link
Copy Markdown
Member

dra27 commented Jun 10, 2019

FWIW, I just squashed the Changes bit - the flexdll and other changes are a bit subtle, so seem worth retaining cleanly for bisecting

@dra27
Copy link
Copy Markdown
Member

dra27 commented Jun 10, 2019

I'll merge and cherry-pick once CI passes

@dra27 dra27 merged commit 8153041 into ocaml:trunk Jun 11, 2019
dra27 added a commit that referenced this pull request Jun 11, 2019
fix the -runtime-variant option for bytecode

(cherry picked from commit 8153041)
@damiendoligez
Copy link
Copy Markdown
Member Author

Thanks!

@damiendoligez damiendoligez deleted the runtime-variant-fixes branch June 12, 2019 15:06
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.

4 participants