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

No progress indicator for a long time when downloading a project in VSCode #5615

Closed
kim-em opened this issue Oct 4, 2024 · 5 comments · Fixed by #5684
Closed

No progress indicator for a long time when downloading a project in VSCode #5615

kim-em opened this issue Oct 4, 2024 · 5 comments · Fixed by #5684
Assignees
Labels
bug Something isn't working Lake Lake related issue P-high We will work on this issue

Comments

@kim-em
Copy link
Collaborator

kim-em commented Oct 4, 2024

When downloading a project using the VSCode extension, if that project is downstream of Mathlib there is a very long wait with no visual feedback or explanation of what is happening, while lake is cloning all of Mathlib.

This corresponds to the following terminal output:

/home/mhuisi/Lean/MathlibTest> lake exe cache get
<<<<<<< Very long pause here with no explanation of what is happening >>>>>>>>>>>>
info: batteries: cloning https://github.com/leanprover-community/batteries to '././.lake/packages/batteries'
info: Qq: cloning https://github.com/leanprover-community/quote4 to '././.lake/packages/Qq'
info: aesop: cloning https://github.com/leanprover-community/aesop to '././.lake/packages/aesop'
info: proofwidgets: cloning https://github.com/leanprover-community/ProofWidgets4 to '././.lake/packages/proofwidgets'
info: importGraph: cloning https://github.com/leanprover-community/import-graph to '././.lake/packages/importGraph'
info: LeanSearchClient: cloning https://github.com/leanprover-community/LeanSearchClient to '././.lake/packages/LeanSearchClient'
info: Cli: cloning https://github.com/leanprover/lean4-cli to '././.lake/packages/Cli'

Even though I know this is an issue, the cancel button or ctrl-c is very tempting because it feels like something is wrong.

@tydeu, my suggestion here is to hard-code a check for Mathlib (yes, I know you don't like the idea :-) and before cloning Mathlib print a "info: cloning Mathlib, depending on your connection this may take some time".

There needs to be something to tell the user something is happening.

An alternative solution would be to investigate doing a shallow clone of Mathlib, but I'm not sure how viable that is.

See zulip discussion.

@kim-em kim-em added the Lake Lake related issue label Oct 4, 2024
@tydeu tydeu added the bug Something isn't working label Oct 4, 2024
@tydeu
Copy link
Member

tydeu commented Oct 4, 2024

I think the best solution here is to eagerly print the log lines for dependency resolution.

@utensil
Copy link

utensil commented Oct 16, 2024

I think the best solution here is to eagerly print the log lines for dependency resolution.

👍

And this would not be noisy as long as such print is erased like the building progress bar, or erased and updated to the final print for the finished clone like what is already printed out now.

Context: coming from zulip.

@tydeu
Copy link
Member

tydeu commented Oct 19, 2024

@utensil

And this would not be noisy as long as such print is erased like the building progress bar, or erased and updated to the final print for the finished clone like what is already printed out now.

Unfortunately, the solution in #5684 does not have any fancy ANSI updates. There are not many log lines, though, and lake update is an infrequently executed command, so hopefully it is not too noisy.

@utensil
Copy link

utensil commented Oct 19, 2024

@tydeu No worries, my casual comment was only because I had no idea how many outputs would be there, and whether they are proportional to other informative outputs. Thanks!

@leanprover-bot leanprover-bot added the P-high We will work on this issue label Oct 25, 2024
@mhuisi
Copy link
Contributor

mhuisi commented Oct 25, 2024

With leanprover/vscode-lean4#542 (still to be released), the progress bar now displays that something is going on in the background more clearly, even when the command doesn't report any output. This doesn't resolve this issue entirely, but it should help a bit.

github-merge-queue bot pushed a commit that referenced this issue Nov 4, 2024
Lake will now update a package's `lean-toolchain` file on `lake update`
if it finds the package's direct dependencies use a newer compatible
toolchain. To skip this step, use the `--keep-toolchain` CLI option.

Closes #2582. Closes #2752. Closes #5615.

### Toolchain update details

To determine "newest compatible" toolchain, Lake parses the toolchain
listed in the packages' `lean-toolchain` files into four categories:
release , nightly, PR, and other. For newness, release toolchains are
compared by semantic version (e.g., `"v4.4.0" < "v4.8.0"` and
`"v4.6.0-rc1" < "v4.6.0"`) and nightlies are compared by date (e.g.,
`"nightly-2024-01-10" < "nightly-2014-10-01"`). All other toolchain
types and mixtures are incompatible. If there is not a single newest
toolchain, Lake will print a warning and continue updating without
changing the toolchain.

If Lake does find a new toolchain, Lake updates the workspace's
`lean-toolchain` file accordingly and restarts the update process on the
new Lake. If Elan is detected, it will spawn the new Lake process via
`elan run` with the same arguments Lake was initially run with. If Elan
is missing, it will prompt the user to restart Lake manually and exit
with a special error code (4).

### Other changes

To implement this new logic, various other refactors were needed. Here
are some key highlights:

* Logs emitted during package and workspace loading are now eagerly
printed.
* The Elan executable used by Lake is now configurable by the `ELAN`
environment variable.
* The `--lean` CLI option was removed. Use the `LEAN` environment
variable instead.
* `Package.deps` / `Package.opaqueDeps` have been removed. Use
`findPackage?` with a dependency's name instead.
* The dependency resolver now uses a pure breadth-first traversal to
resolve dependencies. It also resolves dependencies in reverse order,
which is done for consistency with targets. Latter targets shadow
earlier ones and latter dependencies take precedence over earlier ones.
**These changes mean the order of dependencies in a Lake manifest will
change after the first `lake update` on this version of Lake.**
JovanGerb pushed a commit to JovanGerb/lean4 that referenced this issue Nov 4, 2024
Lake will now update a package's `lean-toolchain` file on `lake update`
if it finds the package's direct dependencies use a newer compatible
toolchain. To skip this step, use the `--keep-toolchain` CLI option.

Closes leanprover#2582. Closes leanprover#2752. Closes leanprover#5615.

### Toolchain update details

To determine "newest compatible" toolchain, Lake parses the toolchain
listed in the packages' `lean-toolchain` files into four categories:
release , nightly, PR, and other. For newness, release toolchains are
compared by semantic version (e.g., `"v4.4.0" < "v4.8.0"` and
`"v4.6.0-rc1" < "v4.6.0"`) and nightlies are compared by date (e.g.,
`"nightly-2024-01-10" < "nightly-2014-10-01"`). All other toolchain
types and mixtures are incompatible. If there is not a single newest
toolchain, Lake will print a warning and continue updating without
changing the toolchain.

If Lake does find a new toolchain, Lake updates the workspace's
`lean-toolchain` file accordingly and restarts the update process on the
new Lake. If Elan is detected, it will spawn the new Lake process via
`elan run` with the same arguments Lake was initially run with. If Elan
is missing, it will prompt the user to restart Lake manually and exit
with a special error code (4).

### Other changes

To implement this new logic, various other refactors were needed. Here
are some key highlights:

* Logs emitted during package and workspace loading are now eagerly
printed.
* The Elan executable used by Lake is now configurable by the `ELAN`
environment variable.
* The `--lean` CLI option was removed. Use the `LEAN` environment
variable instead.
* `Package.deps` / `Package.opaqueDeps` have been removed. Use
`findPackage?` with a dependency's name instead.
* The dependency resolver now uses a pure breadth-first traversal to
resolve dependencies. It also resolves dependencies in reverse order,
which is done for consistency with targets. Latter targets shadow
earlier ones and latter dependencies take precedence over earlier ones.
**These changes mean the order of dependencies in a Lake manifest will
change after the first `lake update` on this version of Lake.**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Lake Lake related issue P-high We will work on this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants