Skip to content

Simplify extraction of zip files#379

Open
kuhnroyal wants to merge 2 commits intosubosito:mainfrom
kuhnroyal:feature/iunzip
Open

Simplify extraction of zip files#379
kuhnroyal wants to merge 2 commits intosubosito:mainfrom
kuhnroyal:feature/iunzip

Conversation

@kuhnroyal
Copy link
Contributor

Refactor unzip/tar commands to directly extract to target directory without stripping components.
By keeping the /flutter directory from inside the archive, we avoid having to use a temp directory and move afterwards.

Fixes #378

This works fine but not exactly sure how it fares with existing caches.
The change might warrant a v3 release.

@kuhnroyal
Copy link
Contributor Author

@bartekpacia Can you please take a look at this?

@bartekpacia
Copy link
Collaborator

bartekpacia commented Mar 17, 2026

Hi @kuhnroyal, sure! Thanks for the contribution:)

Overall this looks solid, thanks for simplifying too.

This works fine but not exactly sure how it fares with existing caches.

I think it's fine if the existing caches will stop working and are evicted. Let's not do v3 unless absolutely necessary. The API stays the same.

2 more things:

@kuhnroyal
Copy link
Contributor Author

@bartekpacia Rebased

@kuhnroyal kuhnroyal marked this pull request as ready for review March 17, 2026 14:45
@bartekpacia bartekpacia requested a review from Copilot March 18, 2026 13:20
Repository owner deleted a comment from coderabbitai bot Mar 18, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors Flutter SDK extraction to keep the top-level flutter/ directory from the archive, avoiding a temp directory + move and aligning extraction behavior across .zip and tar archives (addresses cache failures on different drives due to symlink moves; see #378).

Changes:

  • Extract .zip and tar archives directly into the cache directory without stripping components.
  • Update installation paths to treat $CACHE_PATH/flutter as the Flutter SDK root (FLUTTER_ROOT and PATH updates).
  • Adjust main/master git clone destination to $CACHE_PATH/flutter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

setup.sh Outdated
if [ "$VERSION" != "any" ]; then
git config --global --add safe.directory "$CACHE_PATH"
git config --global --add safe.directory "$CACHE_PATH/flutter"
(cd "$CACHE_PATH" && git checkout "$VERSION")
Copy link
Collaborator

Choose a reason for hiding this comment

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

@kuhnroyal this seems reasonable, but I'm not sure. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have a CI job that checks out a specific master version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@kuhnroyal kuhnroyal Mar 18, 2026

Choose a reason for hiding this comment

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

I applied the change and added matrix jobs for specific versions and any (default).
Not sure if the additional jobs are overkill :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we do; I have just added it in #391

Copy link
Collaborator

Choose a reason for hiding this comment

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

please rebase and I'll run CI again

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

Refactor unzip command to directly extract to target directory.
By keeping the /flutter directory from inside the archive, we avoid having to use a temp directory and move afterwards.
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.

Custom RUNNER_TOOL_CACHE can fail on self-hosted

3 participants