Skip to content

Update code to use the default definition of out_width on OCaml 5.4+#10

Merged
Leonidas-from-XIV merged 1 commit intomasterfrom
ocaml-5.4-support
Feb 14, 2025
Merged

Update code to use the default definition of out_width on OCaml 5.4+#10
Leonidas-from-XIV merged 1 commit intomasterfrom
ocaml-5.4-support

Conversation

@Leonidas-from-XIV
Copy link

Introduced in ocaml/ocaml#13570 this change reads the defaults and updates them instead of constructing the record from scratch. This way it should be compatible with older versions (Format.get_formatter_out_functions is from 4.01, so safe to use).

Introduced in ocaml/ocaml#13570

Signed-off-by: Marek Kubica <marek@tarides.com>
Copy link
Collaborator

@Alizter Alizter left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

@Alizter
Copy link
Collaborator

Alizter commented Feb 14, 2025

Did you check the build with many OCaml versions upstream (in Dune)?

@Leonidas-from-XIV
Copy link
Author

I haven't yet, since I can't build notty locally on 5.4 with current dune because I can't build Dune on 5.4. But I'll create a PR updating the vendored copy to the code in this PR, that should show that it works on 5.4 in CI, give me a moment...

Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this pull request Feb 14, 2025
PR in question is ocaml-dune/notty#10

Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV
Copy link
Author

@Alizter Looks like that this workaround builds fine on 5.4: https://github.com/ocaml/dune/actions/runs/13329716284/job/37230745602?pr=11482 Let's see if tests also succeed.

@Leonidas-from-XIV
Copy link
Author

Ok, tests are succeeding (or, well, failing for unrelated issues); merging.

@Leonidas-from-XIV Leonidas-from-XIV merged commit 83aad28 into master Feb 14, 2025
2 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the ocaml-5.4-support branch February 14, 2025 13:17
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this pull request Feb 14, 2025
PR in question is ocaml-dune/notty#10

Signed-off-by: Marek Kubica <marek@tarides.com>
Leonidas-from-XIV added a commit to ocaml/dune that referenced this pull request Feb 14, 2025
PR in question is ocaml-dune/notty#10

Signed-off-by: Marek Kubica <marek@tarides.com>
anmonteiro pushed a commit to anmonteiro/dune that referenced this pull request Apr 22, 2025
PR in question is ocaml-dune/notty#10

Signed-off-by: Marek Kubica <marek@tarides.com>
Sudha247 pushed a commit to Sudha247/dune that referenced this pull request Jul 23, 2025
PR in question is ocaml-dune/notty#10

Signed-off-by: Marek Kubica <marek@tarides.com>
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.

2 participants