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

cask: skip sha256 generation on directories #13354

Closed
wants to merge 1 commit into from

Conversation

bevanjkay
Copy link
Member

@bevanjkay bevanjkay commented May 31, 2022

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

This is an idea for fixing - Homebrew/homebrew-cask-fonts#5855

Because svn is used to download the fonts, the Digest::SHA256 is failing on the contents because it is a directory not a file.
I have added a check to not return a value in these cases so that no shasum is stored.
The downside of running the check there is that I believe that we may still be fetching the download when the cask is version :latest.
We could potentially add a check for URLs using :svn instead, however there may be other edge cases?

I am not aware of a way to gather a shasum for a directory, if there is then that could be another approach.

CC: @apainintheneck

@BrewTestBot
Copy link
Member

Review period will end on 2022-06-01 at 14:04:32 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label May 31, 2022
@bevanjkay bevanjkay force-pushed the skip-sha256-for-svn branch from 7351a4d to cad53aa Compare May 31, 2022 14:06
@bevanjkay bevanjkay added the critical Critical change which should be shipped as soon as possible. label May 31, 2022
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label May 31, 2022
@apainintheneck
Copy link
Contributor

Another thing I overlooked. 😰

Yeah, there doesn't seem to be a default way to get a checksum for a directory. You could always tarball it but that's probably more trouble than it's worth. I think this is a good band-aid for now but ideally we'd want to check if it's :svn before downloading like you already mentioned. I can look into that.

@MikeMcQuaid
Copy link
Member

Might want to make sure whatever solution is adopted here can be used for #13232 too.

@apainintheneck
Copy link
Contributor

apainintheneck commented May 31, 2022

Would it be possible to check for :svn with cask.url.using?

Edit: Yes, that is possible but wouldn't work with the new git sparse checkout download strategy mentioned above.

@bevanjkay
Copy link
Member Author

Closing in favour of #13358 - as it avoids fetching any downloads before making a decision on shasum generation.

@bevanjkay bevanjkay closed this Jun 1, 2022
@github-actions github-actions bot added the outdated PR was locked due to age label Jul 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants