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

Reconsider the source-controlled jbuild-workspace.dev #423

Closed
aantron opened this issue Jun 27, 2017 · 4 comments
Closed

Reconsider the source-controlled jbuild-workspace.dev #423

aantron opened this issue Jun 27, 2017 · 4 comments

Comments

@aantron
Copy link
Collaborator

aantron commented Jun 27, 2017

We currently have jbuild-workspace.dev in the root of the repo, but aren't sure what the best practice for this is. Should there be one checked in, or is this up to individual developers?

cc @andrewray

@aantron
Copy link
Collaborator Author

aantron commented Jul 7, 2017

So Jbuilder itself has such a file, however it has a comment:

;; This file is used by `make all-supported-ocaml-versions`

we don't have such a target, though I guess one could trigger this directly through jbuilder.

At the same time, this file contains switch names. I, for example, have separate, custom-named switches (--alias-of) for Lwt development, so these names are not useful to me. I'm also looking forward to OPAM 2.0 local switches.

My guess is that we aren't getting much value from this file, but cc @diml and @rgrinberg for guidance and FYI on the above.

@Drup
Copy link
Member

Drup commented Jul 7, 2017

The file also indicates what is the "root" of the repository. I believe jbuilder tries fancy heuristics otherwise, but it seems useful just for that.

@rgrinberg
Copy link
Contributor

Jbuilder itself checks in a workspace file. I find it pretty useful because I use the same switch naming scheme and I don't really need sand boxing when building jbuilder as it's a dependency free package:

https://github.com/janestreet/jbuilder/blob/master/jbuild-workspace.dev

It seems like it would definitely be a useful feature for you if you're testing Lwt against multiple switches. However, you're the main dev of Lwt, so you should probably tailor that file to be most useful to you in the first place.

@aantron
Copy link
Collaborator Author

aantron commented Jul 7, 2017

Regarding the heuristics, the build is triggered typically by make, so it is then triggered from the root directory of Lwt anyway. If there is no jbuild-workspace* file around, Jbuilder uses the current directory as the workspace root, so having it for this seems redundant.

On the other hand, if Lwt is nested in some other project that has its own jbuild-workspace* file, it seems Lwt's jbuild-workspace* file is redundant as well, since the outer one is used.

The only scenarios I currently see the root-finding heuristics being useful in are:

  1. Someone really wants to write jbuilder commands out from subdirectories of the Lwt repo.
  2. We are vendoring code into Lwt, and want to trigger the overall build from within vendored project directories.

But we are not doing (2) yet (or soon, I think), and I think we will still be triggering the whole build using a Makefile even then.

That leaves maybe only one use, which is if I rename my Lwt dev switches to standard names that I can expect other developers to have, then it's worth it to trigger builds on many versions at once. I don't want to put custom switch names into a checked-in file and annoy everyone. I'll probably do that soon.

Overall, the switches feature seems not 100% thought-out yet, due to the names, and due to the side effects of doing development on packages with dependencies in general-use switches. Hopefully this is some useful feedback.

@aantron aantron closed this as completed in 8116dad Jul 8, 2017
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

No branches or pull requests

3 participants