-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Mutiple replaceRuntimeDependencies may reintroduce depenendices #4336
Copy link
Copy link
Closed
Labels
0.kind: bugSomething is brokenSomething is broken1.severity: securityIssues which raise a security issue, or PRs that fix oneIssues which raise a security issue, or PRs that fix one6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOSIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken1.severity: securityIssues which raise a security issue, or PRs that fix oneIssues which raise a security issue, or PRs that fix one6.topic: nixosIssues or PRs affecting NixOS modules, or package usability issues specific to NixOSIssues or PRs affecting NixOS modules, or package usability issues specific to NixOS
Fields
Give feedbackNo fields configured for issues without a type.
replaceRuntimeDependencies is implemented by doing a fold over the list of runtime dependency replacements. The issues is that after replacing one depencency, say bash, with an updated version, the next replacement might replace say firefox, with an updated version that depends on the old bash. This is probably unexpected from the user's perspective and could cause dangerous surprises if a user is using this as a security update mechanism.
I should say that this is only a theoretical issue; I haven't verified this acutally happens, but I wanted to file an issue before I forget about it.
One possible solution is to do some sort of topological sort of the list of replacements based on the dependency order of the "new" packages on the "old" packages so that outermost dependencies are replaced first. But some since "new" packages may have completely different run-time dependencies some though is needed to make sure this works right.
I think a better solution is to come up with an elegent way of simulateously processing all replacements directly in the replaceDependency code, but I would need to sit down and think about how to do this.