conda-smithy: BUG: smithy spuriously dropping valid configurations
This has been one of the most painful debugging sessions in a long time - the bug went away with random debug prints at random points in the code, even if those prints were long after the (presumed) point of failure.
The situation is as follows, wanting to add another configuration to clang-win-activation, like so:
CLANG_VERSION:
- 16.0.6
- 17.0.6
- 18.1.8
+ - 19.1.0.rc1
the combination of conda-smithy 3.37.2 and conda-build 24.7.1 would spuriously drop the builds for 16.0.6, rather than doing something purely additively. Adding a 5th line would bring back all 5 variants, but 4 somehow means only 3 variants get created. There’s also some zipping involved, so I put the exact commit I was rerendering (over and over and over) here.
I ultimately managed to get this to render correctly without debug prints (on top of 3.37.2 & main) with the following diff:
--- a/conda_smithy/configure_feedstock.py
+++ b/conda_smithy/configure_feedstock.py
@@ -983,7 +983,7 @@ def _render_ci_provider(
config = conda_build.config.get_or_merge_config(
None,
- exclusive_config_file=forge_config["exclusive_config_file"],
+ exclusive_config_file=deepcopy(forge_config["exclusive_config_file"]),
platform=platform,
arch=arch,
)
Since this happens at the interface between smithy and conda-build, I cannot tell who is responsible here; whether conda-build incorrectly mutates state that’s passed in, or whether smithy incorrectly assumes that state will not be mutated.
It’s also possible that my diagnosis is still not correct, and that the deepcopy just happen to randomly enforce some collision/synchronization that’s not there otherwise, but doesn’t (fully) get rid of the bug yet (like the print statements before; sidenote, there was often - but not always - a difference that pprint.pprint would remove the bug, but bare print wouldn’t).
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (33 by maintainers)
FWIW, the ctng-compilers recipe has no such jinja-skip. Perhaps the issues are separate though.
Also smithy fails to render without the defaults, ending in an error inside conda-build. So it is not only the linter that needs the defaults.
The bug is here: https://github.com/conda-forge/conda-smithy/blob/main/conda_smithy/configure_feedstock.py#L895
For whatever reason, conda-build is marking the missing variant as skipped.
To that I counter “Any sufficiently advanced technology is indistinguishable from magic.” 😛
IOW, just because it’s reproducible doesn’t meant it isn’t (close to) magic. I wish python had a way to opt into pure functions… mutating self-referential state creates mind-bending puzzles. 😑
Fair enough, I did point out in the OP that that’s a distinct possibility (and that was even before I understood that the copied variable is just a string).
With
on top of 3.37.2, things fail again 🙃