Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

SHA2 mismatch with sauce-code-powerline #118

Closed
jsborjesson opened this issue Mar 29, 2014 · 18 comments · Fixed by #129
Closed

SHA2 mismatch with sauce-code-powerline #118

jsborjesson opened this issue Mar 29, 2014 · 18 comments · Fixed by #129

Comments

@jsborjesson
Copy link

Hi, cool project!

Can't get source code powerline to work though:

$ brew cask install font-sauce-code-powerline
==> Checking out https://github.com/Lokaltog/powerline-fonts/trunk/SourceCodePro
Error: SHA2 mismatch
Expected: 8356da0aa36694517656ebe1638b0b37e29743aa0f86271b2491c0e05222d4ba
Actual: 02f30ae9bde68200d912edac3681d016a5ddb103c7562c66b7e4e047de975ee2
Archive: /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar
To retry an incomplete download, remove the file above.

Any ideas?

@jsborjesson jsborjesson changed the title Sauce Code Pro failing SHA2 mismatch with sauce-code-powerline Mar 29, 2014
@rolandwalker
Copy link
Contributor

Hi! I guess this is the same issue as #117, as both fonts use the Subversion download method.

Could you try out my suggestion there?

@jsborjesson
Copy link
Author

Still fails unfortunately.

==> Checking out https://github.com/Lokaltog/powerline-fonts/trunk/SourceCodePro
audit for font-sauce-code-powerline: failed
 - download not possible: SHA2 mismatch
Expected: 8356da0aa36694517656ebe1638b0b37e29743aa0f86271b2491c0e05222d4ba
Actual: 02f30ae9bde68200d912edac3681d016a5ddb103c7562c66b7e4e047de975ee2
Archive: /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar
To retry an incomplete download, remove the file above.
Error: audit failed

Just a question: why is it using SVN? It's a normal git-repo, no?

@rolandwalker
Copy link
Contributor

It is using the git/SVN gateway as a hack to download multiple files. Casks cannot (yet) have multiple url stanzas, and git does not offer a way to download just one subdirectory, at least not without downloading the entire revision history.

I still can't duplicate your problem, so I can't figure out how to work on it. Could you post the bad download font-sauce-code-powerline--svn-1.017.tar in dropbox or somewhere that I could inspect it?

Can anyone else duplicate? @jimbojsb ?

@jsborjesson
Copy link
Author

Strange, feels like it could be some stupid mistake on my part but I can't see anything I'm doing different, and other fonts work. Here is the file

@jimbojsb
Copy link
Contributor

Well this is maddening. Here is my output. Note the last manual shasum is the file provided from dropbox

[josh@orangeslice ~]$ brew cask cleanup && brew cask audit font-sauce-code-powerline --download
==> Removing dead symlinks
==> Removing cached downloads
/Library/Caches/Homebrew/font-droid-sans-mono--svn-1.00.tar
==> Checking out https://github.com/Lokaltog/powerline-fonts/trunk/SourceCodePro
audit for font-sauce-code-powerline: failed
 - download not possible: SHA2 mismatch
Expected: 8356da0aa36694517656ebe1638b0b37e29743aa0f86271b2491c0e05222d4ba
Actual: d12cebed0d83c669f79779237bef6ec919a91e812fc09bd6eadcb2c9b77ba363
Archive: /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar
To retry an incomplete download, remove the file above.

[josh@orangeslice ~]$ shasum -a256 /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar 
d12cebed0d83c669f79779237bef6ec919a91e812fc09bd6eadcb2c9b77ba363  /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar

[josh@orangeslice ~]$ shasum -a256 ~/Downloads/font-sauce-code-powerline--svn-1.017.tar 
02f30ae9bde68200d912edac3681d016a5ddb103c7562c66b7e4e047de975ee2  /Users/josh/Downloads/font-sauce-code-powerline--svn-1.017.tar

@rolandwalker
Copy link
Contributor

I don't think it is your mistake at all; sorry if I implied that. We got two similar reports within a few hours of each other.

The file you provided was useful, thanks: the contents are the same as on my machine, but the header is different, because the files are in a different order. By any chance, are you running on a case-sensitive filesystem?

@jsborjesson
Copy link
Author

No worries, it was I who implied it. :-)

yep that's it, osx journaled case sensitive.
On 31 Mar 2014 16:30, "Roland Walker" notifications@github.com wrote:

I don't think it is your mistake at all; sorry if I implied that. We got
two similar reports within a few hours of each other.

The file you provided was useful, thanks: the contents are the same as on
my machine, but the header is different, because the files are in a
different order. By any chance, are you running on a case-sensitive
filesystem?

Reply to this email directly or view it on GitHubhttps://github.com//issues/118#issuecomment-39094629
.

@rolandwalker
Copy link
Contributor

Thanks @jimbojsb ! But it is maddening, because yours is yet a third different checksum. Here is how I inspected the headers

$ /usr/bin/tar --list -f ~/Downloads/font-sauce-code-powerline--svn-1.017.tar
LICENSE.txt
README.rst
Sauce Code Powerline Black.otf
Sauce Code Powerline Bold.otf
Sauce Code Powerline ExtraLight.otf
Sauce Code Powerline Light.otf
Sauce Code Powerline Medium.otf
Sauce Code Powerline Regular.otf
Sauce Code Powerline Semibold.otf
fonts.dir
fonts.scale
$ /usr/bin/tar --list -f /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar
fonts.dir
fonts.scale
LICENSE.txt
README.rst
Sauce Code Powerline Black.otf
Sauce Code Powerline Bold.otf
Sauce Code Powerline ExtraLight.otf
Sauce Code Powerline Light.otf
Sauce Code Powerline Medium.otf
Sauce Code Powerline Regular.otf
Sauce Code Powerline Semibold.otf

@jsborjesson
Copy link
Author

They have been a little indecisive about the name, "Sauce Code Powerline", "Source Code Pro for Powerline" etc, it can't have anything to do with that, can it?

@jimbojsb
Copy link
Contributor

@rolandwalker my output matches yours for those commands. Also I am on a standard case-preserving journaled HFS.

FWIW the 2 files are exactly the same size as well.

@rolandwalker
Copy link
Contributor

@alcesleo great, then we know the cause.

However, we can't fix the Cask; I need to patch the Ruby code to be resilient against case-sensitive filesystems. It is arguable that creating the tarball is a needless step. One of the main reasons for doing that was to provide a stable target for checksums. It seems to need a little more work to actually be a stable target.

@rolandwalker
Copy link
Contributor

@jimbojsb I guess we only know one cause -- no idea yet what is happening on your machine (or in #117).

@jimbojsb
Copy link
Contributor

@rolandwalker I think all my hashes match others mentioned above at one point or another.

@jsborjesson
Copy link
Author

All this because of a little Linux-envy... Do you mean there is a problem with homebrew-cask?

@rolandwalker
Copy link
Contributor

@alcesleo yes. One could argue that the fundamental bug is Apple's, but homebrew-cask needs to work around it.

@thebengeu
Copy link
Contributor

@rolandwalker Same issue but fourth different checksum. Files seem to be in the same order as on your machine, on standard case-insensitive Mac OS Extended (Journaled). Also been having the same issue with other fonts using the Subversion download method. Here's my download: font-sauce-code-powerline--svn-1.017.tar.

$ brew cask install font-sauce-code-powerline
==> Checking out https://github.com/Lokaltog/powerline-fonts/trunk/SourceCodePro
Error: SHA2 mismatch
Expected: 8356da0aa36694517656ebe1638b0b37e29743aa0f86271b2491c0e05222d4ba
Actual: 075ae0e5f6a4e958997260322486cb16826a610159f93a796c2627e853773aae
Archive: /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar
To retry an incomplete download, remove the file above.
$ /usr/bin/tar --list -f /Library/Caches/Homebrew/font-sauce-code-powerline--svn-1.017.tar
fonts.dir
fonts.scale
LICENSE.txt
README.rst
Sauce Code Powerline Black.otf
Sauce Code Powerline Bold.otf
Sauce Code Powerline ExtraLight.otf
Sauce Code Powerline Light.otf
Sauce Code Powerline Medium.otf
Sauce Code Powerline Regular.otf
Sauce Code Powerline Semibold.otf

@rolandwalker
Copy link
Contributor

The conclusion is that the tar format (while pretty minimal) is not a sufficiently lightweight wrapper around multiple files for this use-case. It introduces enough variation to break checksums.

So we need to reimplement the SVN download strategy without tar -- and then change almost every checksum in the fonts repo.

@andrewmwhite
Copy link

I'm currently having this issue (well, #117, but this seems to be where the discussion is). I'm not using a case-sensitive file-system.

I get the SHA2 mismatch error with 'font-droid-sans', 'font-droid-serif', 'font-droid-mono', 'font-cousine', 'font-oxygen', and 'font-sauce-code-powerline'. I was successfully able to download and install a number of other fonts, though. I grepped through the formulae: ALL the failures used the 'svn' method and ALL the successes did not.

brew doctor/config/cask doctor output here: https://gist.github.com/andrewmwhite/a02ec2089e87dabbd5b4

$ brew cask cleanup && brew cask audit font-droid-sans-mono --download
==> Removing dead symlinks
==> Removing cached downloads
<snip>
/Library/Caches/Homebrew/font-droid-sans-mono--svn-1.00.tar
<snip>
==> Checking out https://github.com/w0ng/googlefontdirectory/trunk/fonts/droidsansmono
audit for font-droid-sans-mono: failed
 - download not possible: SHA2 mismatch
Expected: 84143210681b91f6c4de1fb25b5d865038c4c5f5881de4fc88d955c5006198ad
Actual: 0efe50c72e3ae9b94adf3cd803df27acc7652d694d9f7b37007fc7ea45b8cb31
Archive: /Library/Caches/Homebrew/font-droid-sans-mono--svn-1.00.tar
To retry an incomplete download, remove the file above.
Error: audit failed

Not case-sensitive (had to double-check ;)):

$ diskutil info /dev/disk1                                                                           
<snip>
   Mounted:                  Yes
   Mount Point:              /
   Escaped with Unicode:     /

   File System Personality:  Journaled HFS+
   Type (Bundle):            hfs
   Name (User Visible):      Mac OS Extended (Journaled)
   Journal:                  Journal size 40960 KB at offset 0xe8d000
   Owners:                   Enabled
<snip>

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants