camlp5 / camlp5

Preprocessor / Pretty Printer for OCaml
Other
74 stars 26 forks source link

camlp5.8.00~alpha4 in opam doesn't have right depexts in BSD and Darwin #66

Closed Kakadu closed 3 years ago

Kakadu commented 4 years ago

Can't locate IPC/System/Simple.pm in @INC (you may need to install the IPC::System::Simple module) (@INC contains: /usr/local/lib/perl5/site_perl/mach/5.30 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.30/mach /usr/local/lib/perl5/5.30) at /usr/home/travis/.opam/ocaml-base-compiler.4.09.1/bin/mkcamlp5 line 6.

Ubuntu is OK

discovered it while hacking https://github.com/ocaml/opam-repository/pull/17285

chetmurthy commented 4 years ago

Can you tell me what the right package-name is for these? I don't have access to such systems. Google suggests p5.28-ipc-system-simple and p5.30-string-shellquote. But these names look suspicious, because they contain version-numbers.

Kakadu commented 4 years ago

I don't have access to these systems too :)

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Saturday, September 26, 2020 6:30 PM, chetmurthy notifications@github.com wrote:

Can you tell me what the right package-name is for these? I don't have access to such systems. Google suggests p5.28-ipc-system-simple and p5.30-string-shellquote. But these names look suspicious, because they contain version-numbers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

chetmurthy commented 4 years ago

Ha! I don't know what to do about it, my friend. If I could, I would add more depexts stanzas. But I don't know what goes in them, and I'm a little loath to just start submitting random patches to opam-repository, hoping to get it right: that'd make a lot of work for the maintainers.

LdBeth commented 4 years ago

I'm using camlp5 and opam on a Mac. However I don't install perl from popular package manager supported by depexts, but using the obscure Pkgsrc. Can you tell what specific setup you need to do? Maybe I can help with it.

Kakadu commented 4 years ago

@LdBeth Using the assumption "opam uses brew to install depexts on Mac" we would like to know which package names should be specified as depexts. We expect a package for Perl itself and maybe packages for libraries: "libstring-shellquote-perl" + "libipc-system-simple-perl" or something like that.

Also it would be great if opam suddenly will start to support this obscure Pkgsrc too.

chetmurthy commented 3 years ago

should be fixed now, as depexts have been moved into separate packages, and the ones that can work, have been made to work. closing.

nobrowser commented 2 years ago

FWIW, I install all perl modules not included by the OS (which may be any Unixoid) via local::lib. With a very few exceptions when I need them for scripts that root will run. But I guess it is not reasonable to expect opam to know how to use that.

Strangely, on my Mac this module is in fact included, in /System/Library/Perl/Extras/5.30/IPC/System/Simple.pm. I don't know how that happened! Maybe because I stick with MacOS Big Sur.

devosalain commented 2 years ago

.

chetmurthy commented 2 years ago

This is a known problem. Those Perl modules are needed for two things (in camlp5):

  1. for running the (extensive) testsuite
  2. for mkcamlp5[.opt]

But they're not needed for camlp5 other than that. Since I have no access to {BSD, Darwin} systems, I cannot make those conf-perl- modules work there. But if you want to figure out how to do that and update the conf-perl- modules, then everything will work. Or you can just install those perl packages, and then the opam install will work.

devosalain commented 2 years ago

On FreeBSD 13.1-RELEASE it works fine. Just installing one perl-IPC package from the O.S. repository. [ PS: Not related, I was able to make p5scm work by adding two softlinks in the p5scm git clone for gmake to finish.]

chetmurthy commented 2 years ago

Again, I have no access to such systems. if you do, then you can use opam install conf-perl-ipc-system-simple conf-perl-string-shellquote (I think those are the names of the two conf-perl packages) to check that they install correctly.

devosalain commented 2 years ago

They install fine with opam.

opam install conf-perl-ipc-system-simple [NOTE] Package conf-perl-ipc-system-simple is already installed (current version is 3). opam install conf-perl-string-shellquote [NOTE] Package conf-perl-string-shellquote is already installed (current version is 3).

chetmurthy commented 2 years ago

Oh right. What I meant was, modify the opam file for each of these two packages, so that it does the right thing for your OS/distro. More explicit:

  1. the packages are written so that they install silently on OSes that aren't supported (yet)
  2. Why? because for camlp5, we'd like them to install the required Perl packages if possible
  3. The idea being, that then the testsuite will run, and mkcamlp5[.opt] will work correctly
  4. but on OSes that aren't supported, we still want camlp5 to build if possible

Does that make sense? In any case, if you look at the two opam files, it should be obvious how to modify them. So you can modify the opam file, test it locally, and then submit a fix to opam.

devosalain commented 2 years ago

As far as I understand the problem on FreeBSD it is nothing more than, sudo "pkg install p5-IPC-System-Simple"

devosalain commented 2 years ago

If I understood it correctly there are two ways and only two. One is to install as superuser IPC using the default package of the O.S. The other is install as a regular user --user the same perl p5 module, or am i wrong? The O.S. package worked fine for me. So I don't see the problem.

chetmurthy commented 2 years ago

The question is how to get opam to understand this. Look at the conf-perl-* opam files and make necessary modifications so that they work correctly on your os/distribution.

I mean, yes, sure if I can run a "sudo" command I can install things. But for instance, on "homebrew" there is no such standard "brew install" command to install perl modules. And that's all that is supported by opam -- standard "brew install" commands.

Again, I'm not saying that it's hard to do. Rather, I'm saying that the trick is teaching opam how to do whatever it is that you're doing on the commandline. And without access to a machine running that os/distribution, I have no way of actually testing that out.

nobrowser commented 2 years ago

The way I install any Perl modules I need beyond the base system of any distro I'm on, is local::lib, which google.

It seems quite hard to tell opam about that, so I don't envy @chetmurthy his job ATM.

chetmurthy commented 2 years ago

While sometimes I find the opam rules painful, they result in a well-maintained and robust system. I'm OK with it; heck, I'm enthusiastic about it. But for new os/distro platforms, it can be painful at first.

devosalain commented 2 years ago

There is a reason the distro has it's own perl module. It's probably because of incompatibility. The workaround is also very easy: bailing out with an error a dependency is missing or can't be found & installing the module perl as root. In this case maybe opam is not the solution but a clear message, something like when detected using FreeBSD please "pkg install p5-IPC-System-Simple" as root.

chetmurthy commented 2 years ago

Please do submit a PR for that change for the conf-perl-* modules. Since I have no access to, and have never used, FreeBSD, I can't do the necessary work.

devosalain commented 2 years ago

Bugs can be entered here. https://bugs.freebsd.org/bugzilla/buglist.cgi?quicksearch=p5-ipc&list_id=484380 But i'm lacking the technical knowledge to formulate the problem in a good way. If you can formulate the problem i'll enter it into the database and it will get assigned to someone.

chetmurthy commented 2 years ago

I see nothing for me to do here. If you'd like me to do this work, I can quote you an hourly rate for my time to do it.

Please stop trying to convince me to do work for a platform that neither I use, nor anybody else who uses Camlp5.

devosalain commented 2 years ago

I understand. We don't live in a perfect world. And nor Linux, nor FreeBSD not windows is perfect. Nor are we. Thanks for the help this issue can be closed. Everything works fine on my lovely FreeBSD