Skip to content

Conversation

@Flamefire
Copy link
Contributor

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.

# 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']
Copy link
Member

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?

Copy link
Member

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)?

Copy link
Contributor Author

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.

@boegel boegel added this to the 4.x milestone Oct 9, 2024
@Flamefire Flamefire force-pushed the cargo-checksums branch 3 times, most recently from 367617f to 74f2842 Compare July 22, 2025 14:36
@Flamefire Flamefire force-pushed the cargo-checksums branch 3 times, most recently from 2d391e5 to bfa5835 Compare October 8, 2025 15:10
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-
The added EC and EasyBlock requires changes to the expected output in
some tests.
…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.
@Flamefire
Copy link
Contributor Author

Rebased to resolve conflicts with recent updates.

@boegel boegel modified the milestones: 5.x, release after 5.2.0 Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants