diff --git a/hydra/core/default_element.py b/hydra/core/default_element.py index 18a1421a44..693a6ee023 100644 --- a/hydra/core/default_element.py +++ b/hydra/core/default_element.py @@ -330,6 +330,9 @@ def __post_init__(self) -> None: raise ValueError("_self_@PACKAGE is not supported") if self.package == "_here_": self.package = "" + if self.package is not None: + # Deep copy is required to avoid mutating the original config so this mode is turned off if this condition is found + OmegaConf.default_flags["no_deepcopy_set_nodes"] = False def is_self(self) -> bool: return self.path == "_self_"