When defining the same parameter object structure multiple times in different scope, the values will overwrite (when keys match) or merge (when keys are unique for one of the 2 objects).
This seems very similar to issues reported earlier and fixed in #2485 a while ago. It is indeed fixed for those reported cases, but if you nest one level deeper the issue seems to return.
Expected: the value foo.baz.wrong equals root and foo.baz only contains 1 key: wrong
Actual: the value foo.baz.wrong equals nested and foo.baz contains 2 keys: wrong and only_nested
Steps to reproduce the problem
Store config from above in nextflow.config and create a main.nf:
workflow {
main:
println "$params"
}
Run nextflow run . and observe the wrong output
Program output
N E X T F L O W ~ version 24.04.0-edge
Launching `./main.nf` [sick_bohr] DSL2 - revision: d674ace2a4
[foo:[bar:bar1, baz:[wrong:nested, only_nested:value]], nested:[foo:[bar:bar2, baz:[wrong:nested, only_nested:value]]]]
Environment
Nextflow version: 24.04.0-edge, but also tested on 23.10.1
Java version: openjdk version "21.0.3" 2024-04-16
Operating system: Linux
Bash version: GNU bash, version 5.2.26(1)-release (x86_64-redhat-linux-gnu)
Additional info
A clearer example of the merging to illustrate that it doesn't just overwrite:
N E X T F L O W ~ version 24.04.0-edge
Launching `./main.nf` [magical_rubens] DSL2 - revision: d674ace2a4
[foo:[bar:[key1:value1, key2:value2]], nested:[foo:[bar:[key1:value1, key2:value2]]]]
Bug report
When defining the same parameter object structure multiple times in different scope, the values will overwrite (when keys match) or merge (when keys are unique for one of the 2 objects). This seems very similar to issues reported earlier and fixed in #2485 a while ago. It is indeed fixed for those reported cases, but if you nest one level deeper the issue seems to return.
Expected behavior and actual behavior
Given following config:
Expected: the value
foo.baz.wrong
equalsroot
andfoo.baz
only contains 1 key:wrong
Actual: the valuefoo.baz.wrong
equalsnested
andfoo.baz
contains 2 keys:wrong
andonly_nested
Steps to reproduce the problem
Store config from above in
nextflow.config
and create amain.nf
:Run
nextflow run .
and observe the wrong outputProgram output
Environment
24.04.0-edge
, but also tested on23.10.1
openjdk version "21.0.3" 2024-04-16
GNU bash, version 5.2.26(1)-release (x86_64-redhat-linux-gnu)
Additional info
A clearer example of the merging to illustrate that it doesn't just overwrite:
Gives as output: