- 
                Notifications
    You must be signed in to change notification settings 
- Fork 452
          fix(melange + include_qualified): track correct .cmj dependencies in emit
          #12531
        
          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
  
    fix(melange + include_qualified): track correct .cmj dependencies in emit
  
  #12531
              Conversation
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.
A bug fix is a bug fix.
| Dep_rules.deps_of | ||
| ~obj_dir | ||
| ~modules | ||
| ~sandbox:Sandbox_config.default | 
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.
It's a bit sucky to generate all these rules just to drop them. It would be better to factor out deps_of in a way so that we don't have to do 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.
what do you suggest doing here? I don't fully understand what rules are being generated.
Happy to do it in a follow-up PR.
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.
actually it sounds like we'll have to do it here anyway. my current plan is to thread the rules as a return value of build_js back to gen_rules
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.
what do you suggest doing here? I don't fully understand what rules are being generated.
Sure, I can clarify. I'm suggesting an almost mechanical transformation that is equivalent to what this PR is doing:
- Take deps_ofand copy paste it to a new function
- In this new function, identify all the calls to add_ruleand delete them
- For all the functions being called in your new deps_of, identify the ones withadd_ruleand repeat step 1.
- Once this process is done and you have deps_ofthat creates no rules, rename the original function to begen_deps_of_rules
- Factor out all the copy pasting.
Hopefully the end result will give us two functions that share as much work as possible.
my current plan is to thread the rules as a return value of build_js back to gen_rules
That's possible as well, but there's a reason why we avoid doing this when possible. It leads to a massive amount of boilerplate managing this list of rules at every step.
32f6b02    to
    157af85      
    Compare
  
    …n emit Signed-off-by: Antonio Nuno Monteiro <[email protected]>
157af85    to
    ce1385b      
    Compare
  
    …n emit (ocaml#12531) Signed-off-by: Antonio Nuno Monteiro <[email protected]>
* 'main' of github.com:/ocaml/dune: (147 commits) cram test: test only parameter flags in merlin generation fix(oxcaml): import eta-expansion changes from opam-repo (ocaml#12563) address review comments Mask the path to the stdlib fix(oxcaml): generate merlin config for library parameters fix(melange + include_qualified): track correct `.cmj` dependencies in emit (ocaml#12531) refactor: remove some unused code in [Path] (ocaml#12558) dep_rules: don't run (transitive) `ocamldep` on single module buildables (ocaml#12555) fix(pkg): ignore project settings for building packages test(pkg): reproduce ocaml#12131 melange: add a test for module cycle checks (ocaml#12554) chore: lint check for new changes entries (ocaml#12553) feature(cram): allow for conflict detection (ocaml#12538) ci: update for ocaml 5.4 release (ocaml#12552) chore(script): generate changelog from structure (ocaml#12516) Reuse dependencies between project and tools (ocaml#12526) Introduce Io.overwrite_file test: fix dune install requiring a mandir Enable package management for more tests Add a `dune tools env` command to add dev tools to PATH (ocaml#12521) ...
depends on #12530