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

bootstrap in bytecode-only platform #177

Merged
merged 9 commits into from
Jun 7, 2018

Conversation

andyli
Copy link
Contributor

@andyli andyli commented May 20, 2018

Based on the work in #173. Fixes #174.

dougmencken and others added 3 commits May 19, 2018 19:07
suddenly obuild has no support for bytecode-only platforms
this commit is the first step to have such support
Instead of from ocamlopt, which doesn't exist in bytecode-only platforms.
@UnixJunkie
Copy link

Hello, wouldn't it be possible to patch the existing bootstrap file instead of creating a new one?

@andyli
Copy link
Contributor Author

andyli commented May 21, 2018 via email

@UnixJunkie
Copy link

It sounds reasonable to me.
If possible, the final exe should be compiled to native.
I guess that if ocamlopt.opt (or, ocamlopt) is present in the path,that would be your condition.

@andyli
Copy link
Contributor Author

andyli commented May 21, 2018

It should be good to go now. I've tested installing it with opam 4.04.0+bytecode-only and 4.06.0.

@UnixJunkie
Copy link

if @jeromemaloberti integrates this and tags a new obuild version, then the opam CI tests will test this with many different versions of the compiler (though I'm not sure if any of them is a bytecode-only compiler).

@andyli
Copy link
Contributor Author

andyli commented May 21, 2018

BTW, before tagging a release, remember to update the version number in obuild.obuild, which is still at 0.1.9 right now.

@jeromemaloberti
Copy link
Contributor

The script is fine, I didn't test it though, however the change in prog.ml means that obuild will not use ocamlopt when it is available. I would prefer that the configuration correctly uses the right compiler.
I will try to work on it.

@jeromemaloberti
Copy link
Contributor

@andyli , actually, could you try to change getOcamlOpt () in prog.ml line 35 to add "ocamlc" in the list ?
It should fall back to ocamlc if ocamlopt is not found. It is a hack though.

@andyli
Copy link
Contributor Author

andyli commented May 22, 2018

I don't think my prog.ml change will affect using ocamlopt or not for actually building. That line is to call -config, which from my testing, all ocamlc, ocamlopt, ocamlc.opt, and ocamlopt.opt output the same result.

I do fix an unrelated minor issue in the additional commit.

@jeromemaloberti
Copy link
Contributor

Yes, you're right.
Another potential problem that worry me, is the default targets in gconf.ml, target_options_defaults. So, on platform with ocamlc only, the users will have to set explicitly executable-bytecode to true, and executable-native to false. Ideally, the configure command in the bootstrap should be the same on all platforms. I will think about it.

@andyli
Copy link
Contributor Author

andyli commented May 23, 2018

Yeah, I also considered making the default smart, but then I figured it could be done later. So, I kept this PR minimal.

@andyli
Copy link
Contributor Author

andyli commented Jun 5, 2018

Is there any problem with this PR? It is incremental that shouldn't break anything but enabled building obuild in bytecode-only platforms.

@jeromemaloberti jeromemaloberti merged commit 55ed451 into ocaml-obuild:master Jun 7, 2018
@jeromemaloberti
Copy link
Contributor

Sorry, I was on holiday, and I missed the latest commit.

@UnixJunkie
Copy link

Hi Jerome, ping me if you create a new tag, I will update the opam package, as usual.

@UnixJunkie
Copy link

andyli reminded that we need a new tag to publish the fix

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