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

Automatic support for jbuilder projects #123

Closed
ghost opened this issue Dec 19, 2017 · 10 comments
Closed

Automatic support for jbuilder projects #123

ghost opened this issue Dec 19, 2017 · 10 comments

Comments

@ghost
Copy link

ghost commented Dec 19, 2017

Pretty much all jbuilder projects use the same pkg/pkg.ml file, which is:

#use "topfind"
#require "topkg-jbuilder.auto"

Can topkg automatically use this configuration when it detects a jbuilder project and there is no pkg/pkg.ml? This will avoid having to write the same file everywhere.

@dbuenzli
Copy link
Owner

Can you give me a robust algorithm to detect a jbuilder project ?

@ghost
Copy link
Author

ghost commented Dec 19, 2017

Checking if the project contains at least one jbuild file.

@dbuenzli
Copy link
Owner

Isn't there something more evident ? Tools that start scanning your whole hard drive because you happen to invoke them at the wrong place are not very user friendly and I don't want topkg to be one of these.

@ghost
Copy link
Author

ghost commented Dec 19, 2017

Unfortunately no. Maybe we need some toplevel file to mark the root of projects, I guess we can look at this when we rename jbuilder. Looking for a jbuild file at depth 0, 1 and 2 without following symlinks should be enough for most projects, is that acceptable?

@dbuenzli
Copy link
Owner

Yes seems ok.

@dbuenzli
Copy link
Owner

I'm not up-to-date with what topkg-jbuilder.auto does but wouldn't the easiest be to upstream what this does in topkg itself and then simply invoke this whenever a jbuilder is detected and it lacks a pkg/pkg.ml files ?

@ghost
Copy link
Author

ghost commented Jan 18, 2018

That would be better indeed! /cc @samoht who is now the maintainer of topkg-jbuilder.

@samoht
Copy link
Contributor

samoht commented Jan 18, 2018

yea upstreaming stuff in topkg would definitely makes thing simpler. The code is there: https://github.com/samoht/topkg-jbuilder/blob/master/src/topkg_jbuilder.ml

It's a bit hackish (especially the doc command) but if we put that in topkg-care we could probably remove all the unix stuff and use bos. @dbuenzli where's the best place to copy this in topkg?

@dbuenzli
Copy link
Owner

If I understand correctly jbuilder users are only interested in the topkg-care aspect (i.e. the topkg tool) so I guess simply into topkg_care_jbuilder.ml and as a submodule in the Topkg_care API.

@dbuenzli
Copy link
Owner

@samoht is working on brining the topkg release experience to dune via a dedicated tool (https://github.com/samoht/dune-release) so I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants