-
Notifications
You must be signed in to change notification settings - Fork 218
add support for injecting checksums for cargo crates #4661
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
base: develop
Are you sure you want to change the base?
Conversation
52f0847 to
1622322
Compare
easybuild/framework/easyblock.py
Outdated
| # grab raw lines for source_urls, sources, patches | ||
| keys = ['patches', 'source_urls', 'sources'] | ||
| # grab raw lines for the following params | ||
| keys = ['source_urls', 'sources', 'crates', 'patches'] |
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.
Hmm, this approach is a bit weird, as it breaks the boundary between framework and easyblocks, since crates is not a general easyconfig parameter...
Thoughts on this @Micket?
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.
Maybe we come up with an approach that would also work for components (in Bundle easyblock)?
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.
As discussed in the confcall I added a method src_parameter_names to the easyblock class.
In the Cargo easyblock we can override this to also return "crates".
For components I don't think this is useful. For now they look like:
components = [
(name, version, {
'source_urls': ['https://poppler.freedesktop.org/'],
'sources': [SOURCE_TAR_XZ],
'checksums': ['86b09e5a02de40081a3916ef8711c5128eaf4b1fc59d5f87d0ec66f04f595db4'],
'configopts': "-DENABLE_BOOST=ON",
}),
('poppler-data', '0.4.10', {
'source_urls': ['https://poppler.freedesktop.org/'],
'sources': [SOURCE_TAR_GZ],
'checksums': ['6e2fcef66ec8c44625f94292ccf8af9f1d918b410d5aa69c274ce67387967b30'],
}),
]
While the Bundle easyblock seemingly supports specifying checksums for everything at the top-level (outside the components) I don't think it actually does: It creates a full list of sources, patches and checksums during __init__ but the actual checksum check (at least the contrib check) requires them in each component as above.
However with this design it would be possible to add the checksum list after the components but then we'd need to include logic to remove them from each component
The general approach is different here anyway: crates are just another way to specify sources while components are similar to exts_list which yield actual easyblock instances.
459450c to
95fa2a6
Compare
ca2ec56 to
1a9580f
Compare
367617f to
74f2842
Compare
2d391e5 to
bfa5835
Compare
Even though the `crates` are recognized as sources for `Cargo` easyconfigs the checksums are not written, at least when neither 'source_urls', 'sources' nor 'patches' are present. Handle `crates` like `sources` and add test-
…rs for "sources" Some easyblocks such as `Cargo` will use a custom EasyConfig parameters to fill the `sources` list. To avoid hard-coding them `inject_checksums` introduce a static method `src_parameter_names` to return a list of parameters that contribute to the final list of `sources` when parsing the EasyConfig.
bfa5835 to
a90d9b7
Compare
|
Rebased to resolve conflicts with recent updates. |
Even though the
cratesare recognized as sources forCargoeasyconfigs the checksums are not written, at least when neither 'source_urls', 'sources' nor 'patches' are present.Handle
crateslikesourcesand add test.