Skip to content

substituteAll: deprecate#395275

Merged
wolfgangwalther merged 9 commits intoNixOS:masterfrom
wolfgangwalther:no-substitute-all
Apr 23, 2025
Merged

substituteAll: deprecate#395275
wolfgangwalther merged 9 commits intoNixOS:masterfrom
wolfgangwalther:no-substitute-all

Conversation

@wolfgangwalther
Copy link
Contributor

@wolfgangwalther wolfgangwalther commented Apr 1, 2025

One step towards #237216.

Q1: Should we adjust the docs immediately? If yes, just add a deprecation or remove them already and point to ... (ah, we don't have replaceVars in the docs, yet?).

Q2: What to do about substituteAllFiles? It's unused in nixpkgs, so we could deprecate it immediately as well? Although we don't have a replacement for it.

Things done

  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Apr 1, 2025
@nix-owners nix-owners bot requested review from GameDungeon, aware70 and jtojnar April 1, 2025 20:32
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm accepting with feedback about the deprecation schedule.

@philiptaron
Copy link
Contributor

philiptaron commented Apr 1, 2025

substituteAllFiles

https://github.com/search?q=lang%3Anix+substituteAllFiles&type=code

It's used, but not widely. Immediate deprecation sounds good, with removal in 26.05 with the other one.

I don't believe that it's a useful thing to implement and is better implemented as a patch with multiple similar replacements.

@wolfgangwalther
Copy link
Contributor Author

Another question comes to mind: Should we immediately deprecate the bash function substituteAll as well? We have not replaced its usage throughout nixpkgs, yet, but even if we add bash/docs warnings now, eval would not fail, so we don't need to wait with deprecation until we're clean.

We can then clean this up in the next cycle - and remove the function itself immediately, too.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 2, 2025
@philiptaron
Copy link
Contributor

Should we immediately deprecate the bash function substituteAll as well? We have not replaced its usage throughout nixpkgs, yet, but even if we add bash/docs warnings now, eval would not fail, so we don't need to wait with deprecation until we're clean.

I don't have a strong opinion other than that going off half-cocked is a bad idea. We're tracking the removal of the Nix function / build helper in #237216, not the Bash function, as I read it. So let's keep the course and merge this.

@github-actions github-actions bot added the 6.topic: GNOME GNOME desktop environment and its underlying platform label Apr 5, 2025
@wolfgangwalther
Copy link
Contributor Author

It's used, but not widely. Immediate deprecation sounds good, with removal [..] with the other one.

I don't believe that it's a useful thing to implement and is better implemented as a patch with multiple similar replacements.

Did that.

I don't have a strong opinion other than that going off half-cocked is a bad idea.

OK, agreed. Will not deprecate it, yet.

We're tracking the removal of the Nix function / build helper in #237216, not the Bash function, as I read it.

#237216 is about both the nix and the bash function, at least for me. I'm 100% set on removing the bash function, too, because it's even worse, at least for my efforts around structuredAttrs.

Q1: Should we adjust the docs immediately? If yes, just add a deprecation or remove them already and point to ... (ah, we don't have replaceVars in the docs, yet?).

I now replaced the docs for substituteAll and substituteAllFiles with some basic docs for replaceVars (and replaceVarsWith).

Does that make sense at this stage?

@wolfgangwalther wolfgangwalther requested a review from emilazy April 12, 2025 15:11
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 17, 2025
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still good to go.

@wolfgangwalther
Copy link
Contributor Author

Just resolved conflicts, ready to merge once CI is through.

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 23, 2025
@github-actions github-actions bot added the 6.topic: rocm ROCm is an Advanced Micro Devices software stack for graphics processing unit programming. label Apr 23, 2025
@wolfgangwalther
Copy link
Contributor Author

Eval told me about 3 new offenders, the refactor tractor took care of them.

@github-actions github-actions bot added 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. and removed 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Apr 23, 2025
@nix-owners nix-owners bot requested review from 7c6f434c and primeos April 23, 2025 21:38
@wolfgangwalther wolfgangwalther merged commit eb48ed1 into NixOS:master Apr 23, 2025
23 of 27 checks passed
@wolfgangwalther wolfgangwalther deleted the no-substitute-all branch April 23, 2025 21:57
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Apr 28, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Apr 29, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request May 3, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request May 4, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request May 4, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request May 8, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request May 12, 2025
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request May 18, 2025
brianmcgillion added a commit to tiiuae/ghaf that referenced this pull request May 19, 2025
brianmcgillion added a commit to brianmcgillion/microvm.nix that referenced this pull request May 21, 2025
substituteAll has been deprecated so will start to cause warnings on 25.05 and
nixos-unstable.

NixOS/nixpkgs#395275

Signed-off-by: Brian McGillion <[email protected]>
astro pushed a commit to microvm-nix/microvm.nix that referenced this pull request May 21, 2025
substituteAll has been deprecated so will start to cause warnings on 25.05 and
nixos-unstable.

NixOS/nixpkgs#395275

Signed-off-by: Brian McGillion <[email protected]>
jian-lin added a commit to linj-fork/dream2nix that referenced this pull request Jun 5, 2025
substituteAll has been deprecated[1] and removed[2].

[1]: NixOS/nixpkgs#395275
[2]: NixOS/nixpkgs#410058
DavHau pushed a commit to nix-community/dream2nix that referenced this pull request Jun 13, 2025
substituteAll has been deprecated[1] and removed[2].

[1]: NixOS/nixpkgs#395275
[2]: NixOS/nixpkgs#410058
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: rocm ROCm is an Advanced Micro Devices software stack for graphics processing unit programming. 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants