ReasonNativeProject
ReasonNativeProject copied to clipboard
Port to jbuilder
This PR requires a minimum version of jbuilder: 1.0+beta9. This is the first version when reason was introduced.
Wow thanks for providing an example so I can get a sense for how to use jBuilder. I don't have a lot of experience setting up native opam projects, so this is helpful to see.
- I think you mis-named the opam file (it should say
reason-nativenotreact-native). - How does the README change? Does anything else get simpler?
In addition, I think what people would really want to see in a follow up diff:
- How you depend on another opam package. Supposed you wanted to depend on @bordoley's Immutable opam package. Maybe in a follow up diff you could show what that would look like?
- How you would export a consumable library, and a binary.
I can create a playground branch if you want to push your work to it. We probably wouldn't want to encourage using jBuilder until it stabilizes, but a playground branch would be an easy way for you to try things out while jBuilder stabilizes.
Sounds reasonable.
The pin is no longer necessary! Might want to update and we can start pointing people to this PR so they can test it out and get some feedback. Thanks again, @rgrinberg !
@rgrinberg It would also be really great if we could use this as an opportunity to teach people how to use opam effectively for local projects. For example, would you be able to suggest a workflow to teach newcomers:
- How to create a switch just for this project.
- How to install just the dependencies for the project into the switch in one command.
I notice people mess these steps up frequently - especially when they have existing packages already installed in the global switch, which conflict.
Bug report: When I clone down this PR and run make build, I get the following error:
Executable test in _build/default/reason-native-project doesn't have a corresponding .ml file
It seems it is overlooking the .re within that folder.
@gilbert Which version of jbuilder are you using? I hear the latest does not require you to pin that git URL - you merely need to install beta v9.
@jordwalke I thought I was using the latest, but it turns out I wasn't. Using jbuilder 1.0+beta9 worked, thank you!
Hopefully this gets merged soon!