Zulip Chat Archive

Stream: mathlib4

Topic: Caching of lints


๐š ๐š˜๐š“๐šŒ๐š’๐šŽ๐šŒ๐š‘ ๐š—๐šŠ๐š ๐š›๐š˜๐šŒ๐š”๐š’ (Oct 02 2024 at 01:00):

It looks like in #17341 I ran into an instance of missing cache invalidation. In the first commit, one file failed due to a linter warning. I modified one of the nolint files (no_lints_prime_decls.txt) to fix this, but it seems not to be included in Lake's list of build inputs. Thus, even after the change the file is replayed from cache and the build continues to fail. What should I do to fix this?

Kim Morrison (Oct 02 2024 at 01:16):

@Mac Malone, could you advise here?

Mac Malone (Oct 02 2024 at 02:40):

My suggestion would be to add the no lint files as a target (via inputTextFile) and an extraDepTargets of the relevant libaries (or the whole package). For example, something like this:

target no_lints pkg : Unit := do
  let noLintFiles := #[
    pkg.dir / "scripts" / "no_lints_prime_decls.txt",
    pkg.dir / "scripts" / "nolints-style.txt",
    pkg.dir / "scripts" / "nolints.json"
  ]
  BuildJob.mixArray (โ† noLintFiles.mapM (inputTextFile ยท))

package mathlib where
  extraDepTargets := #{`no_lints]

Yury G. Kudryashov (Oct 02 2024 at 02:40):

Why not add a docstring instead?

๐š ๐š˜๐š“๐šŒ๐š’๐šŽ๐šŒ๐š‘ ๐š—๐šŠ๐š ๐š›๐š˜๐šŒ๐š”๐š’ (Oct 02 2024 at 02:45):

@Yury G. Kudryashov as in, obey the lint? The lemma in question is

@[simp]
lemma coe_mk' (carrier : Set R) (hโ‚ hโ‚‚ hโ‚ƒ hโ‚„ hโ‚…) :
    (mk' carrier hโ‚ hโ‚‚ hโ‚ƒ hโ‚„ hโ‚… : Set R) = carrier

which I feel doesn't really deserve a docstring. Also, even though this particular issue can be fixed this way, the issue of overzealous caching would remain.


Last updated: May 02 2025 at 03:31 UTC