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

fix: Use .zip in archive path #119

Merged
merged 4 commits into from
Jun 24, 2024
Merged

Conversation

dnys1
Copy link
Contributor

@dnys1 dnys1 commented Dec 31, 2023

Fixes #118

Ensures that downloads of the Dart SDK zip file carry the .zip extension so that subsequent calls to Expand-Archive on Windows succeed.

Notes

  • The diff of index.mjs is quite large. I believe this is due to the version of Node I'm using (20.7.0). Happy to use a different version to keep the diff small, but wasn't sure which one is currently used. This could be noted in package.json (under engines), if desired, to ensure alignment with external contributions.

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@mit-mit
Copy link
Member

mit-mit commented Apr 29, 2024

Thanks @dnys1! Would you mind resolving conflicts? Then we'll take a look.

@dnys1
Copy link
Contributor Author

dnys1 commented May 1, 2024

@mit-mit Done 😄

Copy link
Member

@devoncarew devoncarew left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Can you also add a new changelog entry to the changelog file? You can start a new v1.6.5-wip entry.

The diff of index.mjs is quite large. I believe this is due to the version of Node I'm using (20.7.0). Happy to use a different version to keep the diff small, but wasn't sure which one is currently used. This could be noted in package.json (under engines), if desired, to ensure alignment with external contributions.

fwiw I'm using v20.6.1. If you think that this will reduce diffs then PRs here would be welcome. We're mostly treating the dist/index.mjs file as opaque - we know it works if all the CI tests pass. Do you think specifying a specific version of node would help? I'd be worried about then remembering to rev that version periodically. Plus, many of the diffs in the file may be from the npm packages in use?

lib/main.dart Outdated
await promiseToFuture<String>(toolCache.downloadTool(url));
final archivePath = path.join(
// `RUNNER_TEMP` variable is guaranteed to be present.
// https://github.com/actions/toolkit/blob/5430c5d84832076372990c7c27f900878ff66dc9/packages/tool-cache/src/tool-cache.ts#L756
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// https://github.com/actions/toolkit/blob/5430c5d84832076372990c7c27f900878ff66dc9/packages/tool-cache/src/tool-cache.ts#L756
// https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

lib/node/actions/tool_cache.dart Show resolved Hide resolved
Fixes dart-lang#118

Ensures that downloads of the Dart SDK zip file carry the `.zip` extension so that subsequent calls to `Expand-Archive` on Windows succeed.

## Notes

- The diff of `index.mjs` is quite large. I believe this is due to the version of Node I'm using (`20.7.0`). Happy to use a different version to keep the diff small, but wasn't sure which one is currently used. This could be noted in `package.json` to ensure alignment with external contributions.
Copy link
Contributor Author

@dnys1 dnys1 left a comment

Choose a reason for hiding this comment

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

Hey @devoncarew, apologies for the delay on this.

Can you also add a new changelog entry to the changelog file? You can start a new v1.6.5-wip entry.

Added 👍

fwiw I'm using v20.6.1. If you think that this will reduce diffs then PRs here would be welcome. We're mostly treating the dist/index.mjs file as opaque - we know it works if all the CI tests pass. Do you think specifying a specific version of node would help? I'd be worried about then remembering to rev that version periodically. Plus, many of the diffs in the file may be from the npm packages in use?

If you're okay with treating index.mjs as opaque, I think that's an equally good option. There could still be benefit in adding an engine reference, which would just be to ensure older (perhaps, deprecated) versions of Node are not used by mistake. In this case, the constraint could be more lax, e.g. >=20.

lib/node/actions/tool_cache.dart Show resolved Hide resolved
lib/main.dart Outdated
await promiseToFuture<String>(toolCache.downloadTool(url));
final archivePath = path.join(
// `RUNNER_TEMP` variable is guaranteed to be present.
// https://github.com/actions/toolkit/blob/5430c5d84832076372990c7c27f900878ff66dc9/packages/tool-cache/src/tool-cache.ts#L756
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ntkme ntkme mentioned this pull request Jun 20, 2024
1 task
@ntkme
Copy link

ntkme commented Jun 20, 2024

I'm blocked by this issue. I don't have access to directly contribute to this PR, so I opt to take the commits from this PR, and created a new PR with one more additional commit to fix the build issue: #134

@dnys1
Copy link
Contributor Author

dnys1 commented Jun 21, 2024

Thanks @ntkme I hadn't seen the build failure. I've pushed a new commit which runs the formatter, rebuilds, and signs the JS using npm run all on Dart 3.4.1.

@ntkme
Copy link

ntkme commented Jun 21, 2024

@dnys1 Thanks for the update. @devoncarew Can you please take another look and see if we can get this merged?

@kevmoo
Copy link
Member

kevmoo commented Jun 21, 2024

I'll leave for @devoncarew to hit the merge button!

@devoncarew
Copy link
Member

Thanks for the contribution!

@devoncarew devoncarew merged commit 4e61f04 into dart-lang:main Jun 24, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installation fails on Windows 11
5 participants