reasonml / ReasonNativeProject

Reason native compilation starter project
MIT License
203 stars 45 forks source link

Port to jbuilder #30

Open rgrinberg opened 7 years ago

rgrinberg commented 7 years ago

This PR requires a minimum version of jbuilder: 1.0+beta9. This is the first version when reason was introduced.

jordwalke commented 7 years ago

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.

In addition, I think what people would really want to see in a follow up diff:

  1. 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?
  2. 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.

rgrinberg commented 7 years ago

Sounds reasonable.

jordwalke commented 7 years ago

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 !

jordwalke commented 7 years ago

@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:

I notice people mess these steps up frequently - especially when they have existing packages already installed in the global switch, which conflict.

gilbert commented 7 years ago

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.

jordwalke commented 7 years ago

@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.

gilbert commented 7 years ago

@jordwalke I thought I was using the latest, but it turns out I wasn't. Using jbuilder 1.0+beta9 worked, thank you!

kennetpostigo commented 7 years ago

Hopefully this gets merged soon!