Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More string fixes #367757

Merged
merged 2 commits into from
Jan 8, 2025
Merged

More string fixes #367757

merged 2 commits into from
Jan 8, 2025

Conversation

piegamesde
Copy link
Member

Oh well. So turns out due to a silly mistake, my script previously only ran onto the pkgs subfolder. So here's the remaining fixes for the rest of Nixpkgs. Follow-up to #350296, #350774 and #365186.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • 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
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 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
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: hardware 6.topic: module system About "NixOS" module system internals 6.topic: lib The Nixpkgs function library 6.topic: nvidia labels Dec 23, 2024
@piegamesde piegamesde force-pushed the string-fixes branch 2 times, most recently from 66ac215 to 08f3db0 Compare December 23, 2024 22:13
@piegamesde piegamesde requested a review from pbsds December 25, 2024 08:41
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 31, 2024
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 31, 2024
nixos/modules/services/misc/snapper.nix Outdated Show resolved Hide resolved
@@ -105,27 +105,27 @@ in
virtualHosts.${cfg.hostname} = {
locations = {
# /etc/nginx/includes/ds-docservice.conf
"~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps\/apps\/api\/documents\/api\.js)$".extraConfig =
"~ ^(\\/[\\d]+\\.[\\d]+\\.[\\d]+[\\.|-][\\d]+)?\\/(web-apps\\/apps\\/api\\/documents\\/api\\.js)$".extraConfig =
Copy link
Member

@pbsds pbsds Dec 31, 2024

Choose a reason for hiding this comment

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

nix-repl> "~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps\/apps\/api\/documents\/api\.js)$"
"~ ^(/[d]+.[d]+.[d]+[.|-][d]+)?/(web-apps/apps/api/documents/api.js)$"

nix-repl> "~ ^(\\/[\\d]+\\.[\\d]+\\.[\\d]+[\\.|-][\\d]+)?\\/(web-apps\\/apps\\/api\\/documents\\/api\\.js)$"
"~ ^(\\/[\\d]+\\.[\\d]+\\.[\\d]+[\\.|-][\\d]+)?\\/(web-apps\\/apps\\/api\\/documents\\/api\\.js)$"

These strike me as broken due to the use of / when i think | was intended

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Apparently that's how it is in the source, see $(nix-build '<nixpkgs>' -A onlyoffice-documentserver)/etc/nginx/includes/ds-docservice.conf:

#disable caching for api.js
location ~ ^(\/[\d]+\.[\d]+\.[\d]+[\.|-][\d]+)?\/(web-apps\/apps\/api\/documents\/api\.js)$ {
  expires -1;
  # gzip_static on;
  alias  /var/www/onlyoffice/documentserver/$2;
}

nixos/modules/services/x11/display-managers/lightdm.nix Outdated Show resolved Hide resolved
nixos/modules/hardware/video/nvidia.nix Outdated Show resolved Hide resolved
@pbsds
Copy link
Member

pbsds commented Dec 31, 2024

@infinisil, i remember you onboarding someone new to help with lib, but i don't remember who. Please CC them :)

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 31, 2024
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 4, 2025
@@ -93,7 +93,7 @@ let
# The idea is to match everything that looks like `$term =`
# but not `# $term something something`
# or `# $term = some value` because those are comments.
configContainsSetting = lines: term: (match "^[^#]*\b${term}\b.*=" lines) != null;
configContainsSetting = lines: term: (match "^[^#]*${term}[[:blank:]]*=.*" lines) != null;
Copy link
Contributor

Choose a reason for hiding this comment

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

@piegamesde:

@2xsaiko Nix does not know about \b (or any other escape sequence), what's the intent of the regex here?

I didn't write that, but I think this now almost does what is intended. It matches "xfoo =" for term="foo" though. I would write

Suggested change
configContainsSetting = lines: term: (match "^[^#]*${term}[[:blank:]]*=.*" lines) != null;
configContainsSetting = lines: term: (match "[[:blank:]]*${term}[[:blank:]]*=.*" lines) != null;

@RaitoBezarius what do you think? Looks like you wrote this originally.

Good to know it doesn't support these escapes.

Copy link
Member Author

Choose a reason for hiding this comment

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

So my version more closely matches the original regex which has the same over-matching, but I'm unsure if it is intended like that or not. I read up on the dovecot configuration docs, still unclear.

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

Should ideally hook up CI to check for future regressions, but this seems fine. The manual failure is unrelated, I tested that it works after a merge with recent master.

@piegamesde piegamesde merged commit 31777a5 into NixOS:master Jan 8, 2025
26 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: hardware 6.topic: lib The Nixpkgs function library 6.topic: module system About "NixOS" module system internals 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: nvidia 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants