Skip to content

Commit

Permalink
solana{,-program-library}-crates.inc: refresh with checksums using na…
Browse files Browse the repository at this point in the history
…me param for all crates

:Release Notes:
Some of these crates use different version, which is handled correctly by
the bbclass when multiple versions are used from the same Cargo.lock file,
but in this case there are cases where there is only version per Cargo.lock
(so it doesn't get the name parameter), but then different version in other
Cargo.lock file processed into the same .inc file (and the checksums overwrite
each other), see:
https://lists.openembedded.org/g/openembedded-core/message/179358

:Detailed Notes:
This is 90 crates like this in solana, and 79 in solana-program-library update
the bbclass to use name parameter for all creates, not only the duplicate ones,
because otherwise we would need to process all Cargo.lock files at the same time,
refreshed with modified bbclass from:
https://git.openembedded.org/openembedded-core-contrib/commit/?h=jansa/cargo&id=0690ca2ef3bbc5faf84bb48dd046434cde6fffad

This issue has also nasty side effect that which leads to ugly exception as reported in:
https://lists.openembedded.org/g/openembedded-core/message/179356
which is caused by race condition between sugar.do_unpack and solana-cli.do_fetch where
sugar already fetched and varified downloads/arrayvec-0.7.2.crate just fine, but then
solana-cli decides to rename this file to:
arrayvec-0.7.2.crate_bad-checksum_8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6
because of the checksum mismatch because it was seeing the checksum of 0.7.1 before they were
changed to be version specific:
-SRC_URI[arrayvec.sha256sum] = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
+SRC_URI[arrayvec-0.7.2.sha256sum] = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-SRC_URI[arrayvec.sha256sum] = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd"
+SRC_URI[arrayvec-0.7.1.sha256sum] = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd"

NOTE: recipe sugar-1.1.0-r0: task do_unpack: Started
ERROR: sugar-1.1.0-r0 do_unpack: Error executing a python function in exec_func_python() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_func_python() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:base_do_unpack(d)
     0003:
File: '/OE/lge/build/webos/mickledore/oe-core/meta/classes-global/base.bbclass', lineno: 160, function: base_do_unpack
     0156:        return
     0157:
     0158:    try:
     0159:        fetcher = bb.fetch2.Fetch(src_uri, d)
 *** 0160:        fetcher.unpack(d.getVar('WORKDIR'))
     0161:    except bb.fetch2.BBFetchException as e:
     0162:        bb.fatal("Bitbake Fetcher Error: " + repr(e))
     0163:}
     0164:
File: '/OE/lge/build/webos/mickledore/bitbake/lib/bb/fetch2/__init__.py', lineno: 1882, function: unpack
     1878:
     1879:            if ud.lockfile:
     1880:                lf = bb.utils.lockfile(ud.lockfile)
     1881:
 *** 1882:            ud.method.unpack(ud, root, self.d)
     1883:
     1884:            if ud.lockfile:
     1885:                bb.utils.unlockfile(lf)
     1886:
File: '/OE/lge/build/webos/mickledore/bitbake/lib/bb/fetch2/crate.py', lineno: 84, function: unpack
     0080:        """
     0081:        Uses the crate to build the necessary paths for cargo to utilize it
     0082:        """
     0083:        if ud.type == 'crate':
 *** 0084:            return self._crate_unpack(ud, rootdir, d)
     0085:        else:
     0086:            super(Crate, self).unpack(ud, rootdir, d)
     0087:
     0088:    def _crate_unpack(self, ud, rootdir, d):
File: '/OE/lge/build/webos/mickledore/bitbake/lib/bb/fetch2/crate.py', lineno: 113, function: _crate_unpack
     0109:            # ensure we've got these paths made
     0110:            bb.utils.mkdirhier(cargo_bitbake)
     0111:
     0112:            # generate metadata necessary
 *** 0113:            with open(thefile, 'rb') as f:
     0114:                # get the SHA256 of the original tarball
     0115:                tarhash = hashlib.sha256(f.read()).hexdigest()
     0116:
     0117:            metadata['files'] = {}
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/OE/lge/build/webos/mickledore/downloads/arrayvec-0.7.2.crate'

ERROR: Logfile of failure stored in: /OE/lge/build/webos/mickledore/BUILD/work/qemux86_64-webos-linux/sugar/1.1.0-r0/temp/log.do_unpack.2600442
NOTE: recipe sugar-1.1.0-r0: task do_unpack: Failed

...

NOTE: recipe solana-cli-1.14.5-r0: task do_fetch: Started
WARNING: solana-cli-1.14.5-r0 do_fetch: Checksum failure encountered with download of crate://crates.io/arrayvec/0.7.2 - will attempt other sources if available
ERROR: solana-cli-1.14.5-r0 do_fetch: Fetcher failure for URL: 'https://crates.io/api/v1/crates/arrayvec/0.7.2/download'. Checksum mismatch!
File: '/OE/lge/build/webos/mickledore/downloads/arrayvec-0.7.2.crate.tmp' has sha256 checksum '8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6' when 'be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd' was expected
If this change is expected (e.g. you have upgraded to a new version without updating the checksums) then you can use these lines within the recipe:
SRC_URI[arrayvec.sha256sum] = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
Otherwise you should retry the download and/or check with upstream to determine if the file has become corrupted or otherwise unexpectedly modified.

:Testing Performed:
Only build tested.

:QA Notes:
No change to image.

:Issues Addressed:
[WRP-412] Create GPVB with Yocto 4.2 Mickledore

Change-Id: I28886a08bfdf0fbae083eade5abd34acfd002b66

solana-program-library-crates.inc
  • Loading branch information
shr-project committed Apr 4, 2023
1 parent 1678360 commit 84dc9f3
Show file tree
Hide file tree
Showing 2 changed files with 3,363 additions and 3,363 deletions.

0 comments on commit 84dc9f3

Please sign in to comment.