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

[Bug] Dart SDK Installation Fails When Enabling a Command via pub global #103

Closed
blendthink opened this issue Aug 9, 2024 · 2 comments
Closed
Assignees

Comments

@blendthink
Copy link
Contributor

Overview

When attempting to enable a command using pub global activate, the Dart SDK installation process fails. This issue occurs consistently. The error message does not provide a clear indication of the root cause, making it difficult to troubleshoot. This problem affects the usability of packages that rely on global activation for their commands.

Steps to reproduce

  1. Run dart pub global activate dvmx.
  2. Run dvm install --latest
  3. Observe that the Dart SDK installation fails.

Expected behavior

The Dart SDK should be installed successfully.

Actual behavior

The installation process fails.

Log

$ dvm install --latest
✗ Failed to install 3.5.0.
Exception: Could not find Dart SDK (6.8s)

Environment

  • Dart Version: 3.4.1
  • DVM Version: 0.0.7
  • OS Version: macOS 14.5

Note

If you enable the DVM command and install the Dart SDK using the following command, it works correctly:

brew install blendfactory/tap/dvm
@blendthink
Copy link
Contributor Author

brendan-duncan/image#670

@blendthink
Copy link
Contributor Author

Cause

When the dvm command is enabled from Pub.dev or Git, it disregards the pubspec.lock file and resolves package dependencies based on the Dart SDK version and pubspec.yaml, which results in packages being retrieved. Due to this, a version of the archive package with breaking changes was used, leading to issues. Specifically, in version 3.5.0 of the archive package, the extractArchiveToDisk() method was changed from a synchronous operation to an asynchronous one. As a result, the next process was executed before the extraction of the compressed file was completed, leading to exceptions being thrown because the necessary files could not be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant