Repository navigation
[Merged by Bors] - refactor(Cache): rewrite getFileImports to use search path and return module names and source file location - #21815
Closed
joneugster wants to merge 35 commits into
Closed
joneugster wants to merge 35 commits into
joneugster wants to merge 35 commits into
Conversation
PR summary a387980404Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
17 tasks done
getFileImports to use search path and return modul names and source file locationgetFileImports to use search path and return module names and source file location
grunweg
reviewed
Feb 13, 2025
grunweg
left a comment
Contributor
There was a problem hiding this comment.
Superficially, this looks fine - but I am really not confident about any intricacies with e.g. searchPath, or findLean subtleties.
…rdcoded_package_dirs
…hardcoded_package_dirs
1 of 2 tasks
Co-authored-by: Eric Wieser <[email protected]>
…e_hardcoded_package_dirs
eric-wieser
reviewed
Feb 13, 2025
joneugster
commented
Feb 13, 2025
| def getFileImports (content : String) (fileName : String := "") : | ||
| CacheM <| Array (Name × FilePath) := do | ||
| let sp := (← read).srcSearchPath | ||
| let fileImports : Array Import ← Lean.parseImports' content fileName |
Member
Author
There was a problem hiding this comment.
One note to explain things: the main line of code in parseImports' is exactly the first line deleted:
def parseImports' (input : String) (fileName : String) : IO (Array Lean.Import) := do
let s := ParseImports.main input (ParseImports.whitespace input {}) -- this one!
match s.error? with
| none => return s.imports
| some err => throw <| IO.userError s!"{fileName}: {err}"…rdcoded_package_dirs
…hardcoded_package_dirs
…e_hardcoded_package_dirs
…rdcoded_package_dirs
…hardcoded_package_dirs
eric-wieser
reviewed
Feb 14, 2025
…rdcoded_package_dirs
eric-wieser
reviewed
Feb 14, 2025
eric-wieser
reviewed
Feb 22, 2025
eric-wieser
reviewed
Feb 22, 2025
Co-authored-by: Eric Wieser <[email protected]>
…er/cache_FileImports
Closed
1 task done
eric-wieser
reviewed
Feb 24, 2025
Member
|
bors merge Thanks! |
mathlib-bors Bot
pushed a commit
that referenced
this pull request
Feb 27, 2025
…rn module names and source file location (#21815) Rewrite `getFileImports` to not use `getPackageDirs` anymore. Additionally, `getFileImports` now returns module names like `Mathlib.Data.Set.Basic` and resolved `.lean` file locations instead of non-resolved file names (`Mathlib/Data/Set/Basic.lean`) like it used to. This is in preparation for #21238. This PR should not change any behaviour in how `cache` works. Co-authored-by: Jon Eugster <[email protected]>
Contributor
|
Pull request successfully merged into master. Build succeeded: |
getFileImports to use search path and return module names and source file locationgetFileImports to use search path and return module names and source file location
Closed
1 task done
18 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrite
getFileImportsto not usegetPackageDirsanymore.Additionally,
getFileImportsnow returns module names likeMathlib.Data.Set.Basicand resolved.leanfile locations instead of non-resolved file names (Mathlib/Data/Set/Basic.lean) like it used to. This is in preparation for #21238.This PR should not change any behaviour in how
cacheworks.