-
Notifications
You must be signed in to change notification settings - Fork 437
Allow dune subst
to work inside a subfolder of a Git repository
#11760
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
Allow dune subst
to work inside a subfolder of a Git repository
#11760
Conversation
a99a9d7
to
729be42
Compare
I believe the issue is coming from (ln 309 in subst.ml): (* We have to do this because scanning the source tree evaluates [-p].
That's because [-p] is needed to interpret packages in dune projects
correctly. It should not be necessary, so we should probably make the
package loading lazier. *)
Dune_rules.Only_packages.Clflags.set No_restriction; It looks to me like that this doesn't get set if there is a Edit: Yes, that appears to have worked. I would move it (together with the comment) to the |
Another comment, it would be great if you could include a commit before with a reproduction cram test. That we can be sure this commit will fix the issue and have a nice commit history. You want to add the test in Let me know if you need any help. |
Awesome, thank you so much for the quick reply. I'll see what I can do for the test. |
e8bc5cb
to
8866b05
Compare
This is my first time using cram, but the test seems to be working: it fails without the fix, but passes afterwards. Let me know if there is anything I should have done differently. Side question: is there a way to run a single test file? I've been running |
8866b05
to
0fc16dc
Compare
1f7e88a
to
544b2e7
Compare
You can run a single cram test by building the alias given by its name. Simply do Good first try, just a couple of comments:
You should update the first commit to have this cram test:
In the second commit, you will of course have the updated output. |
af0d920
to
70782f9
Compare
@rgrinberg: Thank you for completing the fix! Is there anything else that needs to be done before the PR can be considered for merging? |
Signed-off-by: Richard Degenne <richard.degenne+github@gmail.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Fixes ocaml#11045 Signed-off-by: Richard Degenne <richard.degenne+github@gmail.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
70782f9
to
16f442b
Compare
CHANGES: ### Fixed - Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple times. (ocaml/dune#11547, @Alizter) - Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality flag would result in pkgconf not finding libraries in some contexts. (ocaml/dune#11619, @MisterDA) - Fix: Evaluate `enabled_if` when computing the stubs for stanzas such as `foreign_library` (ocaml/dune#11707, @Alizter, @rgrinberg) - Fix $ dune describe pp for libraries in the presence of `(include_subdirs unqualified)` (ocaml/dune#11729, fixes ocaml/dune#10999, @rgrinberg) - Fix `$ dune subst` in sub directories of a git repository (ocaml/dune#11760, fixes ocaml/dune#11045, @Richard-Degenne) - Fix a crash involving `Path.drop_prefix` when using Melange on Windows (ocaml/dune#11767, @nojb) ### Added - Added detection and warning for common typos in package dependency constraints (ocaml/dune#11600, fixes ocaml/dune#11575, @kemsguy7) - Added `(extra_objects)` field to `(foreign_library)` stanza with `(:include)` support. (ocaml/dune#11683, @Alizter) ### Changed - Allow build RPC messages to be handled by dune's RPC server in eager watch mode (ocaml/dune#11622, @gridbugs) - Allow concurrent build with RPC server (ocaml/dune#11712, @gridbugs)
CHANGES: ### Fixed - Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple times. (ocaml/dune#11547, @Alizter) - Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality flag would result in pkgconf not finding libraries in some contexts. (ocaml/dune#11619, @MisterDA) - Fix: Evaluate `enabled_if` when computing the stubs for stanzas such as `foreign_library` (ocaml/dune#11707, @Alizter, @rgrinberg) - Fix $ dune describe pp for libraries in the presence of `(include_subdirs unqualified)` (ocaml/dune#11729, fixes ocaml/dune#10999, @rgrinberg) - Fix `$ dune subst` in sub directories of a git repository (ocaml/dune#11760, fixes ocaml/dune#11045, @Richard-Degenne) - Fix a crash involving `Path.drop_prefix` when using Melange on Windows (ocaml/dune#11767, @nojb) ### Added - Added detection and warning for common typos in package dependency constraints (ocaml/dune#11600, fixes ocaml/dune#11575, @kemsguy7) - Added `(extra_objects)` field to `(foreign_library)` stanza with `(:include)` support. (ocaml/dune#11683, @Alizter) ### Changed - Allow build RPC messages to be handled by dune's RPC server in eager watch mode (ocaml/dune#11622, @gridbugs) - Allow concurrent build with RPC server (ocaml/dune#11712, @gridbugs)
I gave my best shot at fixing #11045, but tests fail with a runtime error that I have a hard time understanding. If anyone could give me some pointers or complete the fix, that would be awesome.