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

-use-runtime is broken without -custom #6616

Closed
vicuna opened this issue Oct 18, 2014 · 7 comments

Comments

Projects
None yet
1 participant
@vicuna
Copy link

commented Oct 18, 2014

Original bug ID: 6616
Reporter: @whitequark
Assigned to: @whitequark
Status: closed (set by @xavierleroy on 2016-12-07T10:49:01Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Fixed in version: 4.02.2+dev / +rc1
Category: ~DO NOT USE (was: OCaml general)
Tags: junior_job
Monitored by: @gasche

Bug description

ocamlc -use-runtime without -custom simply embeds the value as the path to the runtime interpreter at the beginning of the file. However, it doesn't prepend '#!', and as a result the executables can't be ran, at least not without directly invoking ocamlrun (which sort of defeats the point of using -use-runtime). It's possible to pass a path starting with #!, but this fails when Symtable tries to autodetect the primitive list. This can be worked around using -use-prims, but then Bytelink tries to absolutize a path starting with #! and breaks it.

This couldn't possibly ever work, and based on git blame, it was never changed since 2001 (!) Am I the first one using it?..

File attachments

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 17, 2014

Comment author: @damiendoligez

It worked on MacOS 9 with MPW, which didn't need the #!
As far as I know it was never even tried on anything else.

Feel free to write a patch.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 19, 2014

Comment author: @whitequark

gasche, can you please merge the attached patch?

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 21, 2014

Comment author: @gasche

Merged in trunk and 4.02.

@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 12, 2015

Comment author: @whitequark

@gasche, I've discovered this patch requires a bootstrap in order to be effective for the compiler itself. Could you bootstrap 4.02?

@vicuna

This comment has been minimized.

Copy link
Author

commented Feb 12, 2015

Comment author: @gasche

Yes, I will do that.

@vicuna

This comment has been minimized.

Copy link
Author

commented May 2, 2015

Comment author: @whitequark

Bootstrap still needed...

@vicuna

This comment has been minimized.

Copy link
Author

commented May 2, 2015

Comment author: @gasche

Thanks for the reminder, this change had slipped out. It is done now.

@vicuna vicuna closed this Dec 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.