Skip to content

nim-unwrapped-2_2: drop pcre - #525960

Closed
eclairevoyant wants to merge 1 commit into
NixOS:masterfrom
eclairevoyant:nim-pcre
Closed

eclairevoyant wants to merge 1 commit into
NixOS:masterfrom
eclairevoyant:nim-pcre

Conversation

@eclairevoyant

@eclairevoyant eclairevoyant commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

pcre isn't needed for nre2 anymore

Things done

@nixpkgs-ci
nixpkgs-ci Bot requested a review from a team May 30, 2026 13:52
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels May 30, 2026
@daylinmorgan

Copy link
Copy Markdown
Contributor

Should we add a patch to std/pcre with something like {.fatal: "NixOS no longer supports pcre1".}.

Mainly, I don't want to bother upstream when a user unexpectedly runs in to this.
In devel there is nre2 now, but there is also arguably better third-party implementations like https://github.com/nitely/nim-regex which nre2 is based on.

@eclairevoyant

Copy link
Copy Markdown
Contributor Author

Didn't realise nre2 was only in devel, fair enough. Yeah we'll have to point people elsewhere then.

@daylinmorgan

Copy link
Copy Markdown
Contributor

Should we add a patch to std/pcre with something like {.fatal: "NixOS no longer supports pcre1".}.

Although if it is still technically feasible through nix for an end-user to add their own pcre derivation maybe it would be better to use {.warn.}?

@daylinmorgan

Copy link
Copy Markdown
Contributor

@eclairevoyant here is a patch to add a warning to lib/wrappers/pcre.nim, feel free to change the verbage

diff --git a/lib/wrappers/pcre.nim b/lib/wrappers/pcre.nim
index 9144f6784..7a74a24da 100644
--- a/lib/wrappers/pcre.nim
+++ b/lib/wrappers/pcre.nim
@@ -471,3 +471,6 @@ proc study*(code: ptr Pcre,
 type
   PPcre* {.deprecated.} = ptr Pcre
   PJitStack* {.deprecated.} = ptr JitStack
+
+{.warning: "Nixpkgs no longer supports pcre v1. You must either provide it yourself or use a third-party regex implementation".}
+

@eclairevoyant

Copy link
Copy Markdown
Contributor Author

I'd prefer to use an error actually; if someone wants to implement it themselves they can easily override patches.

@daylinmorgan

Copy link
Copy Markdown
Contributor

if someone wants to implement it themselves they can easily override patches

Since pcre would only be a runtime dep I think overriding the patches (and propagating it out or through buildNimPackage) is significantly more work for novice users than inclusion of a different pcre derivation to a packages buildInputs.

I do think users are likely to ignore an a {.warning.} message. Perhaps we could instead patch std/pcre with a {.fatal.} guarded by a define (i.e. when not defined(enablePcre): {.fatal: "..., to enable use -d:enablePcre".} or something along those lines). Then overriding in buildNimPackage is just a matter of an additional item on nimFlags.

FWIW to drop pcre from nim-unwrapped we will also need to prevent koch from building nimgrep which makes use of std/re.

I ran nixpkgs-review locally when using a patch with {.fatal.} and a few more packages I think not picked up in the original issue will no longer compile:

  • nitter
  • nrpl
  • promexplorer
  • taskopen

Additionally min which was picked up on #356387 will fail to compile but it's currently unmaintained.

@nixpkgs-review-gha

Copy link
Copy Markdown

❌ nixpkgs-review result

Generated using nixpkgs-review-gha (620301f)

Command: nixpkgs-review pr 525960
Commit: d3b50679e4735f559cbbb03232d876477e322bb6 (subsequent changes)
Merge: 34318702d18826e451dba04b2ac9efff91d77774

Triggered by @eveeifyeve (88671402)
Logs: https://github.com/Eveeifyeve/nixpkgs-review-gha/actions/runs/28295949680/attempts/1


x86_64-linux

⏩ 1 package marked as broken and skipped:
  • nrpl
❌ 2 packages failed to build:
  • nitter
  • promexplorer
✅ 33 packages built:
  • auto-editor
  • balls
  • base45
  • c2nim
  • chawan
  • emocli
  • hottext
  • min
  • mosdepth
  • nim (nim-2_2, nim2)
  • nim1 (nim-1_0)
  • nim-2_0
  • nim-atlas
  • nim-unwrapped (nim-unwrapped-2, nim-unwrapped-2_2)
  • nim-unwrapped-1 (nim-unwrapped-1_0)
  • nim-unwrapped-2_0
  • nim_builder
  • nim_lk
  • nimble
  • nimdow
  • nimlangserver
  • nimlsp
  • nimmm
  • nitch
  • nph
  • snekim
  • swaycwd
  • taskopen
  • tests.writers.bin.nim
  • tests.writers.simple.nim
  • tests.writers.wrapping.nim
  • tridactyl-native
  • ttop

aarch64-linux

⏩ 1 package marked as broken and skipped:
  • nrpl
❌ 2 packages failed to build:
  • nitter
  • promexplorer
✅ 33 packages built:
  • auto-editor
  • balls
  • base45
  • c2nim
  • chawan
  • emocli
  • hottext
  • min
  • mosdepth
  • nim (nim-2_2, nim2)
  • nim1 (nim-1_0)
  • nim-2_0
  • nim-atlas
  • nim-unwrapped (nim-unwrapped-2, nim-unwrapped-2_2)
  • nim-unwrapped-1 (nim-unwrapped-1_0)
  • nim-unwrapped-2_0
  • nim_builder
  • nim_lk
  • nimble
  • nimdow
  • nimlangserver
  • nimlsp
  • nimmm
  • nitch
  • nph
  • snekim
  • swaycwd
  • taskopen
  • tests.writers.bin.nim
  • tests.writers.simple.nim
  • tests.writers.wrapping.nim
  • tridactyl-native
  • ttop

aarch64-darwin (sandbox = relaxed)

⏩ 1 package marked as broken and skipped:
  • nrpl
❌ 4 packages failed to build:
  • auto-editor
  • tests.writers.bin.nim
  • tests.writers.simple.nim
  • tests.writers.wrapping.nim
✅ 24 packages built:
  • base45
  • c2nim
  • chawan
  • emocli
  • hottext
  • min
  • nim (nim-2_2, nim2)
  • nim1 (nim-1_0)
  • nim-2_0
  • nim-atlas
  • nim-unwrapped (nim-unwrapped-2, nim-unwrapped-2_2)
  • nim-unwrapped-1 (nim-unwrapped-1_0)
  • nim-unwrapped-2_0
  • nim_builder
  • nim_lk
  • nimble
  • nimlangserver
  • nimlsp
  • nitter
  • nph
  • promexplorer
  • snekim
  • taskopen
  • tridactyl-native

@nixpkgs-ci nixpkgs-ci Bot added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels Jul 7, 2026
@eclairevoyant
eclairevoyant marked this pull request as draft August 6, 2026 02:46
@daylinmorgan

Copy link
Copy Markdown
Contributor

@eclairevoyant are you still working on this? I can take over and push the changes I mentioned above in a new PR (see master...daylinmorgan:nixpkgs:nim-unwrapped/drop-pcre) and follow up on the tracking issue to ping the relevant maintainers for the 5 nim packages that will be effected by this change.

@mweinelt

mweinelt commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Through a cease and desist nitter has been archived upstream and should be removed.

https://github.com/zedeus/nitter

What else is blocking here?

@daylinmorgan

Copy link
Copy Markdown
Contributor

there are a few downstream packages that will need to be addressed (besides the changes i mentioned above), see here

@mweinelt

Copy link
Copy Markdown
Member

Tomorrow is breaking changes freeze and this still hasn't been addressed. That way the only option is to mark nim 2.2 as broken.

@daylinmorgan daylinmorgan mentioned this pull request Oct 25, 2026
8 of 17 tasks
@daylinmorgan

Copy link
Copy Markdown
Contributor

That way the only option is to mark nim 2.2 as broken.

@mweinelt I've pushed a PR (#578899) that does address this. It would I think be preferable to not break the nim compiler as nearly all of the nim packages do not require PCRE.

@eclairevoyant
eclairevoyant deleted the nim-pcre branch October 26, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants