Skip to content
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

feature(pkg): improve checksum handling #7696

Merged
merged 1 commit into from May 9, 2023

Conversation

rgrinberg
Copy link
Member

  • Add locations to various checksum errors
  • Add locations to checksum parsing errors

Signed-off-by: Rudi Grinberg me@rgrinberg.com

@rgrinberg rgrinberg force-pushed the ps/rr/feature_pkg___improve_checksum_handling branch from 01431e4 to 5a35cd0 Compare May 8, 2023 16:32
src/dune_rules/pkg_rules.ml Outdated Show resolved Hide resolved
@rgrinberg rgrinberg force-pushed the ps/rr/feature_pkg___improve_checksum_handling branch from 5a35cd0 to 3262875 Compare May 8, 2023 17:17
| Some (loc, _) ->
User_error.raise ~loc
[ Pp.text "Invalid checksum, got"
; Dune_pkg.Checksum.pp actual_checksum
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
; Dune_pkg.Checksum.pp actual_checksum
; Checksum.pp actual_checksum

@snowleopard
Copy link
Collaborator

snowleopard commented May 8, 2023

According to the Dune monorepo benchmark, this PR introduces a regression in file-watching mode:

https://autumn.ocamllabs.io/ocaml/dune/pull/7696/base/main?worker=fermat&image=bench%2Fmonorepo%2Fbench.Dockerfile

Or maybe it's just noise? We should start looking at the benchmarks!

@rgrinberg
Copy link
Member Author

rgrinberg commented May 8, 2023

The particular benchmark where there's a "regression" oscillates between ~80 and ~100 seconds.

Also, this PR apparently speeds up another (hardly plausible) test by 16%.

Definitely seems like noise given that this PR doesn't touch these code paths at all.

@snowleopard
Copy link
Collaborator

Yeah, that seems right.

Nevertheless, I'd love to see that table copied here by a bot.

@rgrinberg rgrinberg force-pushed the ps/rr/feature_pkg___improve_checksum_handling branch from 3262875 to 83ae2cc Compare May 9, 2023 00:27
Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

Looks sensible to me.

@@ -998,37 +1007,53 @@ module Fetch = struct

let is_useful_to ~distribute:_ ~memoize = memoize

let encode_loc f (loc, x) =
Dune_lang.List
(* TODO use something better for locs here *)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we have some common loc representation in Sexp? Like (loc (file f.ml) (line 42))?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not that I could find.

@rgrinberg rgrinberg force-pushed the ps/rr/feature_pkg___improve_checksum_handling branch from 83ae2cc to 69818c8 Compare May 9, 2023 14:16
* Add locations to various checksum errors
* Add locations to checksum parsing errors

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: 594bfdad-fa2d-493e-b259-bc7486124b39 -->
@rgrinberg rgrinberg force-pushed the ps/rr/feature_pkg___improve_checksum_handling branch from 69818c8 to 4e068bd Compare May 9, 2023 17:15
@rgrinberg rgrinberg merged commit 20b9eed into main May 9, 2023
40 of 41 checks passed
@rgrinberg rgrinberg deleted the ps/rr/feature_pkg___improve_checksum_handling branch May 9, 2023 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants