Repository navigation
Conversation
|
Instance
|
|
Instance
|
|
Instance
|
trz42
left a comment
There was a problem hiding this comment.
Looks already quite good.
Added a few comments. Probably comments to the first kind of dependency (first double loop) applies to the other two too.
The bodies of the inner loops should be indented by three additional whitespaces.
Wonder a bit if we should add some tests for the Rust function? A test would create some test data (test ec, test eprefix), call Rust with the test data and then compares the result with what is expected.
| raise EasyBuildError("WRF-specific hook triggered for non-WRF easyconfig?!") | ||
|
|
||
|
|
||
| def Rustv(ec, eprefix): |
There was a problem hiding this comment.
Why is it called Rustv not just Rust?
|
|
||
|
|
||
| def Rustv(ec, eprefix): | ||
| """ For the new compat layer we use Rust-1.60.0 instead of Rust-1.52.1""" |
There was a problem hiding this comment.
I suggest to rather mention the compiler+version (GCC/10.3.0)similarly to changed description. Would also be good to stick to syntax package/version when referencing them. I'd remove the whitespace between """ and For.
Sorry for being picky.
There was a problem hiding this comment.
Probably good to mention when this function is called (parse_hook ?) and what we need to do/intend (if a dependency is Rust/1.52.1 we replace it with Rust/1.60.0).
| def Rustv(ec, eprefix): | ||
| """ For the new compat layer we use Rust-1.60.0 instead of Rust-1.52.1""" | ||
| for dep in ec['dependencies']: | ||
| for i in range(len(ec['dependencies'])): |
There was a problem hiding this comment.
Better not use single letter variable names. You might try index instead.
| for dep in ec['dependencies']: | ||
| for i in range(len(ec['dependencies'])): |
There was a problem hiding this comment.
Why do you need the double loop? If there is a good reason, it would be good to add a comment describing it a bit.
| """ For the new compat layer we use Rust-1.60.0 instead of Rust-1.52.1""" | ||
| for dep in ec['dependencies']: | ||
| for i in range(len(ec['dependencies'])): | ||
| dep = ec['dependencies'][i] |
There was a problem hiding this comment.
Here, you overwrite/set dep, so it looks to me as if you don't need the outer loop for dep in ....
| for i in range(len(ec['dependencies'])): | ||
| dep = ec['dependencies'][i] | ||
| if isinstance(dep, (list,tuple)) and (dep[0] == "Rust" and dep[1] == '1.52.1'): | ||
| print_msg("NOTE: Rust version has been modified to 1.60.0") |
There was a problem hiding this comment.
Would be good to add from which version it was changed Dependency Rust/x is replaced with Rust/1.60.0
| dep = ec['dependencies'][i] | ||
| if isinstance(dep, (list,tuple)) and (dep[0] == "Rust" and dep[1] == '1.52.1'): | ||
| print_msg("NOTE: Rust version has been modified to 1.60.0") | ||
| ec['dependencies'][i] = ["Rust", "1.60.0"] |
There was a problem hiding this comment.
Here, you replace dependency always with a list. Is that ok, ie, if dependency was a tuple, should it be replaced with a tuple too?
| if isinstance(dep, (list,tuple)) and (dep[0] == "Rust" and dep[1] == '1.52.1'): | ||
| print_msg("NOTE: Rust version has been modified to 1.60.0") | ||
| ec['dependencies'][i] = ["Rust", "1.60.0"] | ||
| for dep in ec['hiddendependencies']: |
| for dep in ec['dependencies']: | ||
| for i in range(len(ec['dependencies'])): | ||
| dep = ec['dependencies'][i] | ||
| if isinstance(dep, (list,tuple)) and (dep[0] == "Rust" and dep[1] == '1.52.1'): |
There was a problem hiding this comment.
I think would be good to add an else: part which at the start could just print that a different dependency type is used.
trz42
left a comment
There was a problem hiding this comment.
Looks good. Let's merge it and then try to build some software :-)
Some tests are failing ... need to understand why.
disable test that will always fail when replace Rust/1.52.1 with Rust/1.60.0
As Rust is guaranteed for backward compatibility: https://doc.rust-lang.org/edition-guide/editions, we are trying to replace Rust/1.52.1 by Rust/1.60.0 since the former generates errors when compiling it with GCC/10.3.0 in the NESSI pilot 2023.04.