Allow dune subst to work inside a subfolder of a Git repository#11760
Allow dune subst to work inside a subfolder of a Git repository#11760rgrinberg merged 4 commits intoocaml:mainfrom Richard-Degenne:fix-11045-git-subfolders
dune subst to work inside a subfolder of a Git repository#11760Conversation
|
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. |
|
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 |
|
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. |
|
@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 #11045 Signed-off-by: Richard Degenne <richard.degenne+github@gmail.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
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.