Reconsider software dependencies for PCRE support (with SmPL)
Hello,
I got into the mood to try another script variant out (like the following) for the semantic patch language.
// See also:
// update candidate: c4iw_rdev_open()
// https://elixir.bootlin.com/linux/v6.15-rc6/source/drivers/infiniband/hw/cxgb4/device.c#L908-L909
@Delete_unnecessary_checks@
expression x;
@@
if (...
- && x
)
kfree(x);Such SmPL code does not use features according to regular expressions. But I observed the following test result with the software combination “Coccinelle 1.3-00083-g4093aad2d” on my openSUSE Tumbleweed system.
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> spatch --parse-cocci delete_unnecessary_checks7.cocci
spatch: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --version
spatch: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
Under which circumstances can the corresponding software dependencies become up-to-date again?
Regards,
Markus
Quoted 22 lines · Markus Elfring
Hello,
I got into the mood to try another script variant out (like the following) for the semantic patch language.
// See also:
// update candidate:c4iw_rdev_open()
// https://elixir.bootlin.com/linux/v6.15-rc6/source/drivers/infiniband/hw/cxgb4/device.c#L908-L909
@Delete_unnecessary_checks@
expression x;
@@
if (...
- && x) kfree(x);Such SmPL code does not use features according to regular expressions. But I observed the following test result with the software combination “Coccinelle 1.3-00083-g4093aad2d” on my openSUSE Tumbleweed system.
Quoted 8 lines
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> spatch --parse-cocci
delete_unnecessary_checks7.cocci
spatch: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --version
spatch: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directoryUnder which circumstances can the corresponding software dependencies become up-to-date again?
We will look into it. Thanks for the report.
julia
Hi,
I believe the installation instructions in install.txt should be useful here - specifically the last 2 bullet points of the Ubuntu / Debian section.
It depends on your current setup and what you want to achieve, so I can't provide exact instructions here, but if you cannot figure it out from the instructions, please provide your OS, the output of apt list --installed (or the equivalent command of your distribution to list installed packages), specify if you're using opam, and the output of spatch --version.
Thanks,
Victor
Quoted 33 lines · Markus Elfring
Hello,
I got into the mood to try another script variant out (like the following) for the semantic patch language.
// See also:
// update candidate:c4iw_rdev_open()
// https://elixir.bootlin.com/linux/v6.15-rc6/source/drivers/infiniband/hw/cxgb4/device.c#L908-L909
@Delete_unnecessary_checks@
expression x;
@@
if (...
- && x) kfree(x);Such SmPL code does not use features according to regular expressions. But I observed the following test result with the software combination “Coccinelle 1.3-00083-g4093aad2d” on my openSUSE Tumbleweed system.
Markus_Elfring@Sonne:…/Projekte/Coccinelle/janitor> spatch --parse-cocci
delete_unnecessary_checks7.cocci
spatch: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory Markus_Elfring@Sonne:…/Projekte/Coccinelle/Probe> spatch --version
spatch: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directoryUnder which circumstances can the corresponding software dependencies become up-to-date again?
Regards,
Markus
Quoted 1 line
It depends on your current setup and what you want to achieve, …
Did you stumble on undesirable understanding difficulties?
Quoted 1 line
… and the output of
spatch --version.
I informed you that also this program call variant can not work any more with my Linux software distribution because the library for PCRE1 became outdated and the corresponding package vanished therefore.
* I assume that the usage of regular expressions might not be required for some command variants.
* The program can eventually be built without PCRE support (for a while).
* Olaf Hering showed how the PCRE2 support could be activated.
https://lore.kernel.org/cocci/[email protected]/
https://sympa.inria.fr/sympa/arc/cocci/2025-03/msg00161.html
Regards,
Markus
Quoted 1 line
* Olaf Hering showed how the PCRE2 support could be activated.
I tried this update approach out.
Unfortunately, I wonder about the following information now.
Markus_Elfring@Sonne:…/Projekte/Coccinelle/20160205> git checkout f622b07ade674191e849ff428ff63089498169bc && git checkout master && git pull && git apply …/Projekte/Coccinelle/my_tweaks6.diff && ./autogen && ./configure …
Markus_Elfring@Sonne:…/Projekte/Coccinelle/20160205> make world
…
File "globals/regexp_pcre.ml", line 1:
Error: /usr/lib64/ocaml/pcre2/pcre2.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
make: *** [Makefile:455: globals/regexp_pcre.cmo] Fehler 2
With which delay can the current Coccinelle software be properly built again?
Regards,
Markus
Wed, 21 May 2025 13:56:52 +0200 Markus Elfring <[email protected]>:
Quoted 3 lines
Error:
/usr/lib64/ocaml/pcre2/pcre2.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.
Run either 'zypper dup' first, or make sure OCaml from /usr is used.
Olaf
Quoted 5 lines
Quoted 3 lines
Error:
/usr/lib64/ocaml/pcre2/pcre2.cmi
is not a compiled interface for this version of OCaml.
It seems to be for an older version of OCaml.Run either 'zypper dup' first,
I tend to execute such a command regularly.
Quoted 1 line
or make sure OCaml from /usr is used.
I usually expect that OCaml components should be picked up from my OPAM system configuration.
Regards,
Markus
I'm thinking the issue is simply due to weird dependency issues that are documented in the file I mentioned. If you'd like me to help you, please provide me the information I asked for.
Victor
Quoted 21 lines · Markus Elfring
Quoted 1 line
It depends on your current setup and what you want to achieve, …
Did you stumble on undesirable understanding difficulties?
Quoted 1 line
… and the output of
spatch --version.I informed you that also this program call variant can not work any more with my Linux software distribution because the library for PCRE1 became outdated and the corresponding package vanished therefore.
* I assume that the usage of regular expressions might not be required for some command variants.
* The program can eventually be built without PCRE support (for a while).
* Olaf Hering showed how the PCRE2 support could be activated.
https://lore.kernel.org/cocci/[email protected]/
https://sympa.inria.fr/sympa/arc/cocci/2025-03/msg00161.htmlRegards,
Markus
Quoted 1 line
I'm thinking the issue is simply due to weird dependency issues
Something is questionable here.
Further software build configuration challenges can be reconsidered.
Markus_Elfring@Sonne:~> opam show pcre2
<><> pcre2: information on all versions <><><><><><><><><><><><><><><><><><><><>
name pcre2
all-versions 7.5.1 7.5.2 8.0.1 8.0.2 8.0.3
…
Markus_Elfring@Sonne:~> rpm -qi ocaml-pcre2-devel
…
Source RPM : ocaml-pcre2-8.0.3-2.1.src.rpm
Build Date : Fr 04 Apr 2025 06:04:04 CEST
…
Quoted 1 line
that are documented in the file I mentioned.
The software documentation is probably improvable. Do you plan any releases accordingly?
Regards,
Markus
Quoted 1 line
I'm thinking the issue is simply due to weird dependency issues …
How do you expect that known software dependencies should be resolved here?
https://opam.ocaml.org/packages/pcre2/
Which installation sources would be preferred for involved components?
Are you looking for any adjustments according to software build systems?
Regards,
Markus