Open
mdx: inherit link_flags from env stanza for mdx_gen executable#15614
Conversation
Copilot
AI
changed the title
[WIP] Fix mdx targets to use link flags
mdx: inherit link_flags from env stanza for mdx_gen executable
Jul 28, 2026
Alizter
reviewed
Jul 28, 2026
Collaborator
|
@copilot address comments |
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter
force-pushed
the
copilot/fix-mdx-link-flags
branch
from
July 28, 2026 22:23
c40c778 to
fd9a747
Compare
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Alizter
force-pushed
the
copilot/fix-mdx-link-flags
branch
from
July 29, 2026 08:56
63b5462 to
e65c461
Compare
Alizter
marked this pull request as ready for review
July 29, 2026 09:14
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The generated
mdx_gen.bc.exewas linked with only the MDX-specific-linkallargument, solink_flagsfromenvstanzas were skipped. This made environment-level linker configuration ineffective for MDX, including flags used to suppress duplicate-library warnings on macOS.This restores the existing expectation that
envlink flags apply when Dune links an executable.Implementation
-cclib -lmin a workspaceenvstanza and prints those flags from themdx_gen.bc.exelinker trace.Ocaml_flags_db.link_flags sctx ~dir Dune_lang.Link_flags.Spec.standard, the same default link-flag path used by ordinary executable rules.-linkallargument prepended to the evaluated flags.Using
Link_flags.Spec.standardavoids a separate env-only lookup and gives MDX the normal executable link-flag semantics. Since this restores existing behavior, it is applied as a bug fix rather than being gated on Dune language 3.25.Test plan
./dune.exe runtest test/blackbox-tests/test-cases/stanzas/mdx-stanza/env-link-flags.t./dune.exe fmtFixes #15613
Checklist
envbehavior.