-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Regex behavior differs across platforms #1537
Comments
This is slightly painful because that happens to be the regex we use to filter junk from cc @edolstra |
Yeah, so I guess we moved from 1.11's calls to |
@edolstra do you have some sort of plan for the cutover to 1.12 with differing behavior in |
I don't have a plan. I would suggest rewriting that regexp into something that doesn't rely on Linux-specific behavior. Also, |
Anyway, the behavior no longer differs across platforms, so I'll close this. |
Still an issue on 2.0pre: Darwin:
Linux:
|
Verified that Darwin nix 2.0 also has this issue. |
That's surprising! The full source to Lines 1771 to 1806 in cfdbfa6
which suggests that |
Probably worth including the |
Probably the example case here is enough to reproduce independent of Nix? |
I'm assuming std::regex on Linux comes from libstdc++ and the one on Darwin comes from LLVM? |
This appears to be a bug in libstdc++. Empty regular expressions are not allowed according to the POSIX extended regex grammar (http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap09.html#tag_09_05_03). This also affects grep:
|
We could use |
Another variation of the same problem: |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
I marked this as stale due to inactivity. → More info |
Regex supported by `builtins.match` differ on Linux and Darwin (see NixOS/nix#1537) and the empty match group errors on Darwin. But simply removing it does not change the logic in the module in any way.
Regex supported by `builtins.match` differ on Linux and Darwin (see NixOS/nix#1537) and the empty match group errors on Darwin. But simply removing it does not change the logic in the module in any way. (cherry picked from commit ab94ea6, PR #100592)
on darwin, setting a custom gpg home directory results causes `nix flake check` to fail when using my customized gpg-agent module. this does not necessarily appear to be an issue with my implementation (though there are certainly issues with my implementation), but appears to be a result of a known nix language issue where regular expression matching behaves differently between linux and darwin. the issue only presents itself during *checks* for linux systems on darwin, which *should* be okay since i'm not trying to *build* or run nixos modules or systemd services. see NixOS/nix#1537 while that github issue and other issues/PRs referencing it provide numerous examples of how one might work around the regex issue, unfortunately the custom hashing functions in home-manager's gpg-agent module are pretty opaque and i haven't a clue about where to begin applying a possible fix. fortunately, the error is easy to avoid by using the default gnupg home directory. considering that the only real benefit to a custom home directory is decluttering $HOME, the solution for my immediate needs is clear. however, the underlying hash function logic will need to change before my custom gpg-agent module can ever be merged upstream...
…ixOS/nix#1537) Also avoid trimming single-line string values unnecessarily.
…ixOS/nix#1537) Also avoid trimming single-line string values unnecessarily.
…ixOS/nix#1537) Also avoid trimming single-line string values unnecessarily.
I seem to remember seeing some regex-related changes in 1.12 so this might no longer be an issue, but I want to capture it in case it is. If I fire up
nix-repl
on 1.11.x on Linux and Darwin and runDarwin will complain that
error: compiling pattern ‘^((|..*).sw[a-z]|.*~)$’: empty (sub)expression
, whereas Linux will returnnull
.The text was updated successfully, but these errors were encountered: