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

Version dune-workspace and ~/.config/dune/config files #932

Merged
merged 18 commits into from Jul 1, 2018
Merged

Version dune-workspace and ~/.config/dune/config files #932

merged 18 commits into from Jul 1, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 29, 2018

This PR implements #929

@ghost ghost requested review from rgrinberg and emillon June 29, 2018 22:50
@ghost ghost added this to the 1.0.0 milestone Jun 29, 2018
src/main.ml Outdated
else
None)
let p = Path.of_string Workspace.filename in
if Path.exists p then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to the pr but we should change this to use Option.some_if

@rgrinberg
Copy link
Member

rgrinberg commented Jun 30, 2018

One thing I'm wondering about is that if we should move the first line handling to the Version_file itself. Currently, the error message for a missing first line is:

Invalid first line, expected: (lang <lang> <version>)

We should be able to do better if the Versioned_file.Make(X) itself is doing this parsing.

EDIT: Or even more simply, we can just change the message to substitute <lang> with dune (since I don't think other values are possible) and then simply list all the versions registered so far.

@@ -580,8 +579,10 @@ let installed_libraries =
let env = Main.setup_env ~capture_outputs:common.capture_outputs in
Scheduler.go ~log:(Log.create common) ~common
(Context.create
(Default { targets = [Native]
; profile = Config.default_build_profile })
(Default { loc = Loc.of_pos __POS__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this location will make it to the user, I wonder how useful it really is. Maybe a virtual location will be better?

-> 'a
end

module Make(Data : sig type t end) = struct
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering what application you have in mind for this data field. It took me more time than I will admit that this argument isn't actually used anywhere. Would be simpler to just keep Make generative for now.

@rgrinberg
Copy link
Member

@diml I ended up adding a minor test suite for this feature because it was quite sparsely tested before. In the process I fixed a minor bug and did some touch ups.

@rgrinberg
Copy link
Member

@diml apologies for the invasive rebasing, I needed one of your functions for #909 so I rebased and cherry picked it into master.

jeremiedimino and others added 18 commits July 1, 2018 01:46
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
- dune requires the (lang ...) line
- jbuilder accepts it but fallback to the jbuild syntax if it's not
  present

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
Added for testing but could come in handy elsewhere

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
@rgrinberg rgrinberg merged commit a877fc0 into ocaml:master Jul 1, 2018
@rgrinberg
Copy link
Member

Bleh, it's easier to just merge this thing for me now and the comments can be discussed later. I haven't made any important comments that need to be addressed promptly. @emillon feel free to review this asynchronously.

@ghost
Copy link
Author

ghost commented Jul 1, 2018

Thanks for adding tests. BTW, since the option to select the build profile is called profile on the command line and in the workspace file, I think the variable should be called profile as well.

@rgrinberg
Copy link
Member

rgrinberg commented Jul 2, 2018 via email

@emillon
Copy link
Collaborator

emillon commented Jul 2, 2018

👍 for me, thanks for the tests to document the feature.

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.

3 participants