-
Notifications
You must be signed in to change notification settings - Fork 396
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
Add support for dynamic dependencies via (include ..)
in (deps)
#5442
Conversation
ecd5c5e
to
b5ddc71
Compare
src/dune_rules/dep_conf_eval.ml
Outdated
let+ contents = Build_system.read_file path ~f:Io.read_file in | ||
let asts = | ||
Dune_lang.Parser.parse_string ~fname:(Path.to_string path) | ||
~mode:Dune_lang.Parser.Mode.Many contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The choice of Many
isn't, but it's inconsistent with how use it in the ordered set lang. I suggest we use Builld_system.read_sexp
and interpret the list from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the implementation to use read_sexp
and it just results in:
Error: too many s-expressions found in input
Was your change that we add a ~mode
argument to it for the use case here? I'm gonna go ahead and propose that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal in 4341aa4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the problem that I'm trying to point.
In this example:
(deps (:include foo))
The expectation is that foo
is a Sexp.t list
.
While in:
(flags (:include foo))
The expectation is that foo
is Sexp.t
.
I found this inconsistence to be jarring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you’re saying maybe the file needs to be a sexp, got it now.
there’s also the include
vs :include
difference. I think (:include
here would bind a new named variable so I chose include
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there’s also the include vs :include difference. I think (:include here would bind a new named variable so I chose include
Yes, that's fine. In ordered set lang, we need to distinguish between literals and special forms somehow. That's not necessary for dependency specifications.
4341aa4
to
6b9d696
Compare
I had a change of heart wrt versioning. I think it would be better if we delayed this feature for 3.1.0. For the |
That sounds good to me. |
6efc383
to
c1f4eb7
Compare
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
c1f4eb7
to
1116088
Compare
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
1116088
to
7936c24
Compare
I just updated the PR after the latest suggestions. |
Cherry picked. Cheers. |
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.1.0) CHANGES: - Add `sourcehut` as an option for defining project sources in dune-project files. For example, `(source (sourcehut user/repo))`. (ocaml/dune#5564, @rgrinberg) - Add `dune coq top` command for running a Coq toplevel (ocaml/dune#5457, @rlepigre) - Fix dune exec dumping database in wrong directory (ocaml/dune#5544, @bobot) - Always output absolute paths for locations in RPC reported diagnostics (ocaml/dune#5539, @rgrinberg) - Add `(deps <deps>)` in ctype field (ocaml/dune#5346, @bobot) - Add `(include <file>)` constructor to dependency specifications. This can be used to introduce dynamic dependencies (ocaml/dune#5442, @anmonteiro) - Ensure that `dune describe` computes a transitively closed set of libraries (ocaml/dune#5395, @esope) - Add direct dependencies to $ dune describe output (ocaml/dune#5412, @esope) - Show auto-detected concurrency on Windows too (ocaml/dune#5502, @MisterDA) - Fix operations that remove folders with absolute path. This happens when using esy (ocaml/dune#5507, @EduardoRFS) - Dune will not fail if some directories are non-empty when uninstalling. (ocaml/dune#5543, fixes ocaml/dune#5542, @nojb) - `coqdep` now depends only on the filesystem layout of the .v files, and not on their contents (ocaml/dune#5547, helps with ocaml/dune#5100, @ejgallego) - The mdx stanza 0.2 can now be used with `(implicit_transitive_deps false)` (ocaml/dune#5558, fixes ocaml/dune#5499, @emillon) - Fix missing parenthesis in printing of corresponding terminal command for `(with-outputs-to )` (ocaml/dune#5551, fixes ocaml/dune#5546, @Alizter)
Signed-off-by: Antonio Nuno Monteiro anmonteiro@gmail.com
This implements "the full power of dynamic deps" in alternative to the more hacky #5440.