Skip to content

Remove usages of re, clean up libraries fields in dune#1489

Merged
WardBrian merged 3 commits intomasterfrom
libraries-field-cleanup
Jan 16, 2025
Merged

Remove usages of re, clean up libraries fields in dune#1489
WardBrian merged 3 commits intomasterfrom
libraries-field-cleanup

Conversation

@WardBrian
Copy link
Copy Markdown
Member

This started with me testing building the compiler under OCaml 5.3.0. After installing the most recent version of our dependencies, the build was still failing, because re wasn't installed. It turns out, it's no longer in the Jane Street dependency tree in the next version (0.17.x)

I then realized we were not documenting this dependency anywhere, and it's also completely unnecessary based on its usages. So I pulled it out, and then updated the dune files to not request linking it. It turns out that the str library we were listing was also just requesting a link to our own alias of module Str = Re.Str, which was... messy, to say the least!

Submission Checklist

  • Run unit tests
  • Documentation
    • If a user-facing facing change was made, the documentation PR is here:
    • OR, no user-facing changes were made

Release notes

Removed usages of the re library

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

@WardBrian WardBrian requested a review from nhuurre January 16, 2025 14:48
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 90.45%. Comparing base (f13066b) to head (52e425a).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/analysis_and_optimization/Dataflow_types.ml 0.00% 3 Missing ⚠️
src/analysis_and_optimization/Factor_graph.ml 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1489      +/-   ##
==========================================
+ Coverage   90.07%   90.45%   +0.38%     
==========================================
  Files          66       66              
  Lines       10759    10706      -53     
==========================================
- Hits         9691     9684       -7     
+ Misses       1068     1022      -46     
Files with missing lines Coverage Δ
src/frontend/Ast_to_Mir.ml 93.73% <100.00%> (-0.02%) ⬇️
src/frontend/Environment.ml 95.34% <ø> (+25.85%) ⬆️
src/frontend/SignatureMismatch.ml 85.16% <ø> (+3.46%) ⬆️
src/frontend/Typechecker.ml 93.05% <100.00%> (ø)
src/stan_math_backend/Cpp_Json.ml 100.00% <100.00%> (ø)
src/stan_math_backend/Mangle.ml 100.00% <100.00%> (ø)
src/stan_math_backend/Transform_Mir.ml 95.77% <100.00%> (ø)
src/analysis_and_optimization/Factor_graph.ml 70.33% <0.00%> (ø)
src/analysis_and_optimization/Dataflow_types.ml 0.00% <0.00%> (ø)

Comment on lines +1084 to +1086
| LTupleProjection (lv1, idx1), LTupleProjection (lv2, idx2) ->
let idx_comp = Int.compare idx1 idx2 in
if idx_comp = 0 then compare_no_indexing lv1 lv2 else idx_comp
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was a "fun" one I realized after getting a build on 5.3.0, which is as previously implemented the sort here could actually be non-transitive, which led to a newly-optimized version of the List.find_all_dups function to miss some duplicates and allow an existing bad test to instead compile

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's reassuring to know that our test coverage is wide enough to catch even such subtle bugs.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's certainly true -- it was painful to debug, but would have been much worse to not know about it at all

@WardBrian WardBrian merged commit d13e71e into master Jan 16, 2025
@WardBrian WardBrian deleted the libraries-field-cleanup branch January 16, 2025 17:55
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