-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix Cask download symlink creation errors due to long filenames #20718
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
Merged
Conversation
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
Copilot stopped work on behalf of
MikeMcQuaid due to an error
September 17, 2025 16:50
MikeMcQuaid
reviewed
Sep 18, 2025
MikeMcQuaid
reviewed
Sep 18, 2025
MikeMcQuaid
reviewed
Sep 18, 2025
Copilot finished work on behalf of
MikeMcQuaid
September 18, 2025 08:57
44f5a98
to
8c76677
Compare
8 tasks
MikeMcQuaid
approved these changes
Sep 19, 2025
samford
approved these changes
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just some small things, otherwise this makes sense to me. I can push a commit with these changes if that makes things easier.
Co-authored-by: MikeMcQuaid <[email protected]> Co-authored-by: Sam Ford <[email protected]>
6a13129
to
b1bd71c
Compare
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.
AbstractFileDownloadStrategy#symlink_location
"#{name}--#{version}#{ext}"
which can be too long for casks with long URLs and versionsdownload_name
inCask::Download
download_name
override conditional - only use cask token when URL-based symlink would exceed 255 characterssuper
instead of duplicating parent class logic (File.basename(determine_url.to_s)
)symlink_location
method to calculate potential symlink length instead of duplicating symlink creation logicUpdated Solution Summary
The fix now conditionally overrides the
download_name
method inCask::Download
:super
to get the URL basename from the parent class instead of duplicating logicsymlink_location
methodcask.full_token.gsub("/", "--")
Code improvements:
super
instead ofFile.basename(determine_url.to_s)
to avoid duplicating existing logicsymlink_location
method instead of duplicating symlink creation logicUtils.safe_filename
processing that happens in the real symlink creationExamples:
app.dmg--1.0.0.dmg
(18 chars) → Uses parent class result (URL basename) ✅qqmusic--...
(179 chars) ✅This preserves existing behavior for normal cases while fixing the filesystem limit issue for problematic URLs, and now properly uses existing methods instead of duplicating logic.
Fixes #20678.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.