Skip to content

Conversation

@anmonteiro
Copy link
Collaborator

No description provided.

@anmonteiro anmonteiro force-pushed the anmonteiro/source-preview-ppxed branch from 8114ac4 to ba8200c Compare November 23, 2025 02:53

let source_without_pp ~ml_kind t =
let source =
match (ml_kind : Ml_kind.t) with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might need an adjustment for sources without mli's. That is, when ml_kind = Intf but there's not t.source.files.intf we should fall back to the .impl.

Would be great to have a test for this as well if you have the time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will have a look.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @rgrinberg I've expanded the test case to account for .mli files as well, but I think I'm confused about your suggestion here: when's ever the case that we want to find source files when compiling interfaces?

Copy link
Collaborator Author

@anmonteiro anmonteiro Nov 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've merged this to unblock #12688 but open to fixing once I have a better understanding.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have a point. When there's no explicit mli, and there's an error message to display, it will always be in the .ml anyway.

@nojb
Copy link
Collaborator

nojb commented Nov 24, 2025

@anmonteiro Can you say a few words what this change is needed?

@Alizter
Copy link
Collaborator

Alizter commented Nov 24, 2025

Here is the reproduction case: #12770

@nojb
Copy link
Collaborator

nojb commented Nov 24, 2025

Here is the reproduction case: #12770

Thanks!

@anmonteiro
Copy link
Collaborator Author

@nojb any other questions or concerns about this change or its implementation that I should consider?

; A "-c"
; Command.Ml_kind.flag ml_kind
; Dep src
; Hidden_deps (Dep.Set.of_files (Option.to_list original))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to leave a comment why we need the source file here. It is in fact only needed for sandboxed builds as far as I can tell.

@nojb
Copy link
Collaborator

nojb commented Nov 26, 2025

@nojb any other questions or concerns about this change or its implementation that I should consider?

Nothing from my side, thanks!

@anmonteiro anmonteiro force-pushed the anmonteiro/source-preview-ppxed branch from ba8200c to 4ea04ec Compare November 30, 2025 02:26
@anmonteiro anmonteiro merged commit f783f81 into ocaml:main Nov 30, 2025
28 checks passed
@anmonteiro anmonteiro deleted the anmonteiro/source-preview-ppxed branch November 30, 2025 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants