-
Notifications
You must be signed in to change notification settings - Fork 704
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
Test suite runs repeated __init__
which may incorrectly mutate self.cfg
paremeter
#21393
Test suite runs repeated __init__
which may incorrectly mutate self.cfg
paremeter
#21393
Comments
#21392 is blocked due to the same problem. @Flamefire mentioned he would look into it. |
This is also causing trouble in:
|
The problem with the modifications done in #21143 is that the When the copy is taken, it simply keeps the populated |
Ok so that change just fixed the opposite case: We ended up with NO sources, now we have them twice. With the change in easybuilders/easybuild-easyblocks#3448 we should remove the copy at https://github.com/easybuilders/easybuild-easyconfigs/pull/21143/files#diff-c85885b053bd84deb5003a873b182bfc52bd3d72a3f3ab3b0bb23f18215f7c70R1051-R1059 because that should work now, shouldn't it? If not we have another similar bug |
In normal use, the easyblock init methods are only called once, but when running the easybuild-easyconfigs test suite the easyblock may be constructed multiple times, and if the easyconfig
cfg
is mutated, it may be done so repeatedly.This also means the problem would not occur running a single specific test.
Most easyblocks don't do much of anything, or just re-initialized the same content each time regardless, making them idempotent, but in the Cargo easyblock, we need to construct the sources list from the given list of crates.
As the sources list isn't necessarily empty from the start (you can have other sources + a list of crates), we can't very well clean out the sources either, and we end up appending the new sources to it.
And when we init multiple times,
Cargo.__init__
ends up appending multiple duplicated sources.After this change
easybuilders/easybuild-easyblocks@a9cadc4#diff-e47f470369ad66d27de6a7cb5fa577eeaf527afa731aa400c0fd20fcbb9c1c45L140
the problem reappeared here:
#21354
where the test suite fails because it's counting 2*x number of sources but only x checksums.
We either have to hack something into Cargo easyblock to make it idempotent,
or something like clearing out the list of crates again.
The text was updated successfully, but these errors were encountered: