DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 14th April 2015
ed.n1n2 ed.n1n2 is offline
Port Guard
 
Join Date: Mar 2015
Posts: 30
Default Another Perl question...

I'm busy installing a bunch of modules to satisfy the dependencies for my platform.

I've initially setup cpan for my user, confirmed there is plenty of space in /home, and installed cpanminus. Most modules don't seem to have a problem.

That being said, the logging seems pretty unhelpful (like a circular reference) with my current error for Net::SSLeay:

Code:
cpanm (App::cpanminus) 1.7027 on perl 5.018002 built for i386-openbsd
Work directory is /home/mtech/.cpanm/work/1429050542.3857
You have make /usr/bin/make
You have LWP 5.837
You have /bin/tar:
Searching Net::SSLeay on cpanmetadb ...    
--> Working on Net::SSLeay                 
Fetching http://www.cpan.org/authors/id/M/MI/MIKEM/Net-SSLeay-1.68.tar.gz
-> OK
Unpacking Net-SSLeay-1.68.tar.gz           
Entering Net-SSLeay-1.68
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 6.36 ... Yes (6.66)
Configuring Net-SSLeay-1.68
Running Makefile.PL
*** Found LibreSSL-2.0. installed in /usr  
*** That's newer than what this module was tested with
    You should consider checking if there is a newer release of this module
    available. Everything will probably work OK, though.
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?         
These tests *will* *fail* if you do not have network connectivity. [n] n
Checking if your kit is complete...        
Looks good
Writing Makefile for Net::SSLeay           
Writing MYMETA.yml and MYMETA.json                
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0.60_01 ... Yes (1.001014)
Checking if you have MIME::Base64 0 ... Yes (3.13)
Checking if you have ExtUtils::MakeMaker 6.36 ... Yes (6.66)
Building and testing Net-SSLeay-1.68       
cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm
AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay)
blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters:
 directory blib/lib/auto/Net/SSLeay:
  do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https
  do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx
  get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.al, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate $
  head_https.al, head_https3.al, head_https4.al, head_http.al, head_http3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al $
  post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al $
  put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate $
  ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
  ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
  tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read
  tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ
cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm
/usr/bin/perl "-Iinc" /usr/libdata/perl5/ExtUtils/xsubpp  -typemap /usr/libdata/perl5/ExtUtils/typemap -typemap typemap  SSLeay.xs > SSLeay$
cc -c  -I/usr/include  -DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE -fno-strict-aliasing -fno-delete-null-pointer-checks -pipe -fstack-protector$
Running Mkbootstrap for Net::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Net/SSLeay/SSLeay.so
LD_RUN_PATH="/usr/lib" cc  -shared -fPIC  -fstack-protector SSLeay.o  -o blib/arch/auto/Net/SSLeay/SSLeay.so      -L/usr -L/usr/lib -lssl -$
chmod 755 blib/arch/auto/Net/SSLeay/SSLeay.so
cp SSLeay.bs blib/arch/auto/Net/SSLeay/SSLeay.bs
chmod 644 blib/arch/auto/Net/SSLeay/SSLeay.bs
Manifying blib/man3/Net::SSLeay.3p
Manifying blib/man3/Net::SSLeay::Handle.3p
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/local/*.t t/handle/local$
t/handle/local/05_use.t ................ ok
t/local/01_pod.t ....................... ok
t/local/02_pod_coverage.t .............. skipped: these tests are for only for release candidate testing. Enable with RELEASE_TESTING=1
t/local/03_use.t ....................... ok
t/local/04_basic.t ..................... ok
t/local/05_passwd_cb.t ................. ok
t/local/06_tcpecho.t ................... ok
t/local/07_sslecho.t ................... ok
t/local/08_pipe.t ...................... ok
t/local/15_bio.t ....................... ok
t/local/20_autoload.t .................. skipped: Some tests need Test::Exception
t/local/21_constants.t ................. skipped: Some tests need Test::Exception
t/local/30_error.t ..................... skipped: Requires Test::Exception, Test::Warn and Test::NoWarnings
t/local/31_rsa_generate_key.t .......... skipped: Test::Exception required
t/local/32_x509_get_cert_info.t ........ ok
t/local/33_x509_create_cert.t .......... ok
t/local/34_x509_crl.t .................. ok
t/local/35_ephemeral.t ................. ok
t/local/36_verify.t .................... ok
t/local/37_asn1_time.t ................. ok
t/local/38_priv-key.t .................. ok
t/local/39_pkcs12.t .................... ok
t/local/40_npn_support.t ............... ok
Can't locate auto/Net/SSLeay/CTX_set_alp.al in @INC (@INC contains: /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68/inc /home/mtech/.cpanm/work/1429004231.31806/Net-SS
Leay-1.68/blib/lib /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68/blib/arch /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd
/usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/libdata/perl5/i386-openbsd/5.18.2 /usr/local/libdata/perl5/i386-openbsd/5.18.2 /usr/libdata/perl5 /usr/loca
l/libdata/perl5 .) at t/local/41_alpn_support.t line 84.
# Looks like you planned 6 tests but ran 3.
# Looks like your test exited with 2 just after 3.
Can't locate auto/Net/SSLeay/CTX_set_alp.al in @INC (@INC contains: /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68/inc /home/mtech/.cpanm/work/1429004231.31806/Net-SS
Leay-1.68/blib/lib /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68/blib/arch /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd
/usr/local/libdata/perl5/site_perl /usr/libdata/perl5/site_perl /usr/libdata/perl5/i386-openbsd/5.18.2 /usr/local/libdata/perl5/i386-openbsd/5.18.2 /usr/libdata/perl5 /usr/loca
l/libdata/perl5 .) at t/local/41_alpn_support.t line 52.
t/local/41_alpn_support.t ..............
Dubious, test returned 2 (wstat 512, 0x200)
Failed 6/6 subtests
t/local/42_info_callback.t ............. ok
t/local/50_digest.t .................... ok
t/local/61_threads-cb-crash.t .......... skipped: your perl is not compiled with ithreads or is pre-5.8
t/local/62_threads-ctx_new-deadlock.t .. skipped: your perl is not compiled with ithreads or is pre-5.8
t/local/kwalitee.t ..................... skipped: these tests are for only for release candidate testing. Enable with RELEASE_TESTING=1

Test Summary Report
----------------—
t/local/41_alpn_support.t            (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: Bad plan.  You planned 6 tests but ran 0.
Files=29, Tests=1834, 32 wallclock secs ( 2.04 usr  0.46 sys + 30.57 cusr  1.68 csys = 34.75 CPU)
Result: FAIL
Failed 1/29 test programs. 0/1834 subtests failed.
*** Error 255 in /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68 (Makefile:961 'test_dynamic')
-> FAIL Installing Net::SSLeay failed. See /home/mtech/.cpanm/work/1429004231.31806/build.log for details. Retry with –force to force install it.
-> FAIL Installing the dependencies failed: Module 'Net::SSLeay' is not installed
-> FAIL Bailing out the installation for IO-Socket-SSL-2.012.
Already tried Net::SSLeay. Skipping.
It says to see the log for more details, but that is the log!

I don't want to force the installation with something possible broken, as this is the SSLeay module. Most of my platform will depend on secure requests.

Any insight is appreciated. I've no idea why that file would be missing, or what package I might install to fix it.

P.S - I know I'm somewhat akin to double parked with an existing question, but I can't attempt to solve that one till this module is installed
Reply With Quote
  #2   (View Single Post)  
Old 14th April 2015
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,973
Default

I've never used cpan. When I need a 3rd party Perl module on OpenBSD, I install one with pkg_add(1).

For example: # pkg_add p5-Net-SSLeay

Last edited by jggimi; 14th April 2015 at 10:55 PM. Reason: typo
Reply With Quote
  #3   (View Single Post)  
Old 14th April 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,304
Default

Quote:
Originally Posted by ed.n1n2 View Post
I've initially setup cpan for my user...
Unless you and/or your user(s) are very astute, don't start with installing modules through CPAN.

The reason is that OpenBSD uses a different filesystem layout in comparison to other Unix-like operating systems such as Linux. Some modules will install as available on CPAN; others will require patching. Knowing the difference requires a deeper knowledge of both the Perl code & the OS.
  • The simplest solution is to determine if an officially sanctioned port has been ported to OpenBSD. Searching:
    • http://ports.su -- makes the SQLite database found in databases/sqlports available online. This information will be correct for -current at the time the database was created.
    • http://openports.se/ -- a third-party site not officially affilated with the OpenBSD project which provides information on ports available to -current. Be aware that the information found here may not entirely be correct as flaws are known to exist in the way they parse OpenBSD's /ports CVS branch.
    • http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/ -- the OpenBSD's Web interface to its CVS repository for the /ports branch.
    ...may save you & your user(s) significant time & effort.
  • If you port modules directly from CPAN, the nagging question will be whether sufficient testing has been made to ensure that all OS-centric issues have been resolved.
Officially sanctioned ports should resolve all the nits presented here. Starting here is the most prudent strategy. Installing through CPAN may mean reinventing the wheel which will require both time & prowess.

More information can be found in our local OpenBSD FAQ thread, & Section 15 of the project's official FAQ document.

Last edited by ocicat; 15th April 2015 at 01:01 AM. Reason: clarity
Reply With Quote
  #4   (View Single Post)  
Old 15th April 2015
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by ed.n1n2 View Post
I'm busy installing a bunch of modules to satisfy the dependencies for my platform.

I've initially setup cpan for my user, confirmed there is plenty of space in /home, and installed cpanminus. Most modules don't seem to have a problem.
Using CPAN is the wrong way to install Perl modules on OpenBSD. IIRC there is some ongoing work to create infrastructure which will enable you to use CPAN in the safe manner. Ibara probably knows more about it. I am not much of a Perl user.
Reply With Quote
  #5   (View Single Post)  
Old 15th April 2015
ed.n1n2 ed.n1n2 is offline
Port Guard
 
Join Date: Mar 2015
Posts: 30
Default

I think there may be some confusion. I'm using cpanimus, after installing that with cpan.

Code:
sudo cpanm {module name}
I am looking through the build logs. I can see there is quite a bit of testing after compiling. Are you saying even with those specific tests, that I need to search the ports for an equivalent?
Reply With Quote
  #6   (View Single Post)  
Old 15th April 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,304
Default

Quote:
Originally Posted by ed.n1n2 View Post
Are you saying even with those specific tests, that I need to search the ports for an equivalent?
Yes.

Wherever possible, use Perl modules already ported to OpenBSD. Don't attempt to download source from CPAN yourself if OpenBSD packages already exist for the same Perl module.

Your original example was a perfect example. Don't blindly use cpanminus. Use packages already ported by the OpenBSD project if they exist. Here, p5-Net-SSLeay has already been vetted for OpenBSD.

Last edited by ocicat; 15th April 2015 at 03:26 PM. Reason: corrected spelling
Reply With Quote
  #7   (View Single Post)  
Old 15th April 2015
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,304
Default

Quote:
Originally Posted by ed.n1n2 View Post
I'm using cpanimus, after installing that with cpan.
This is the issue. Anything coming from CPAN may need to be patched. cpanminus is not aware of differences in OpenBSD.

Last edited by ocicat; 15th April 2015 at 03:27 PM. Reason: corrected spelling
Reply With Quote
  #8   (View Single Post)  
Old 15th April 2015
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,973
Default

Highlights mine.
Quote:
15.1 - Introduction

There are a lot of third party applications available which one might want to use on an OpenBSD system. To make this software easier to install and manage, plus to help it comply with OpenBSD's policy and goals, the third party software is ported to OpenBSD. This porting effort can involve many different things. Examples are: making the software use the standard OpenBSD directory layout (e.g. configuration files go into /etc), conforming to OpenBSD's shared library specifications, making the software more secure whenever possible, etc.

The end result of the porting effort are ready-to-install binary packages. The aim of the package system is to keep track of which software gets installed, so that it may at any time be updated or removed very easily. This way, no unnecessary files are left behind, and users can keep their systems clean. The package system also helps ensure nothing is deleted by accident, causing software to stop functioning properly. Another advantage is that users rarely need to compile software from source, as packages have already been compiled and are available and ready to be used on an OpenBSD system. In minutes, a large number of packages can be fetched and installed, with everything in the right place.
Reply With Quote
  #9   (View Single Post)  
Old 21st April 2015
thirdm thirdm is offline
Spam Deminer
 
Join Date: May 2009
Posts: 234
Default

Quote:
Originally Posted by ed.n1n2 View Post
I'm busy installing a bunch of modules to satisfy the dependencies for my platform.

I've initially setup cpan for my user, confirmed there is plenty of space in /home, and installed cpanminus. Most modules don't seem to have a problem.

That being said, the logging seems pretty unhelpful (like a circular reference) with my current error for Net::SSLeay:
...
Can't locate auto/Net/SSLeay/CTX_set_alp.al in @INC (@INC contains: /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68/inc /home/mtech/.cpanm/work/1429004231.31806/Net-SS
Leay-1.68/blib/lib /home/mtech/.cpanm/work/1429004231.31806/Net-SSLeay-1.68/blib/arch /usr/local/libdata/perl5/site_perl/i386-openbsd /usr/libdata/perl5/site_perl/i386-openbsd
...
It says to see the log for more details, but that is the log!

I don't want to force the installation with something possible broken, as this is the SSLeay module. Most of my platform will depend on secure requests.

Any insight is appreciated. I've no idea why that file would be missing, or what package I might install to fix it.
Do you need ALPN? If you look at the port in CVS the maintainer only enabled it there 5 days ago. If you look at the release notes for LibreSSL you can find ALPN support was only added in 2.1.3 (released in January). I see the same test error on my 5.6 system here too when I run prove t/local/41_alpn_support.t. (You can get into the work directory with cpanm using the --look argument.)

So the funny thing here is that there's a line in that test to detect libressl and disable the whole .t file if detected. This test file that's failing shouldn't be running at all. Unfortunately, it was done subtely wrong (fortunately in current that wrongness is gone with ALPN being there):

Code:
BEGIN {
  plan skip_all => "openssl 1.0.2 required" unless Net::SSLeay::SSLeay >= 0x10002000;
  plan skip_all => "libressl not supported" if defined &Net::SSLeay::LIBRESSL_VERSION_NUMBER;
  plan skip_all => "fork() not supported on $^O" unless $Config{d_fork};
}
He shouldn't be asking defined &fun_sym here. Look at the documentation for the defined operator/function:
Quote:
You may also use "defined(&func)" to check whether subroutine
&func has ever been defined. The return value is unaffected by
any forward declarations of &func. A subroutine that is not
defined may still be callable: its package may have an
"AUTOLOAD" method that makes it spring into existence the first
time that it is called; see perlsub.
This is a "constant" (i.e. a function) that actually is expanded by an AUTOLOAD method, so it's not defined until called the first time. He should have just checked it's value. So, locally you could do that (remove the word "defined" in that line) and your tests will pass. I agree you don't want to skip all the remaining tests.

As far as running cpan vs. ports, I guess the words of caution are probably right. But personally I'd rather use cpan. Of course if you'd used ports in this instance you wouldn't have had to figure out this error.

How are you using CPAN? Do you use local::lib or direct sudo installs? Things can get a little hairy here. So I've been playing around on my local system with not using ports for perl modules and not using local::lib either, i.e. just using the sudo install method to put things right into the the various site_perl and other locations under /usr/local/. Once you do that installing from ports gets messy. Get ready for errors like the following:

Collision in p5-YAML-Tiny-1.51: the following files already exist

I don't mind this on this machine since it's only a "for fun" install. But if your user is not your user in the sense of your login but a human user you support, maybe that's not so much fun. It's interesting to speculate about what might go wrong when you get into upgrading dual life modules (modules in cpan and in Perl core). I've done one or two for the hell of it and gotten away with it, but at this point if I saw any Perl related problems on the machine I'd think twice before asking an OpenBSD person for help about it. But with local::lib I'd think you'd be safe enough. If you have a problem you just remove your local directory from @INC and all is well.

I find it sad people aren't using cpan directly. No one will ever write a port for most of what's up there. Plus there's that downside of packages in general that as long as packagers are doing the work it's only them that are learning about and helping test upstream. Maybe that's partly good, I don't know. Yet looking at the size of the patches on a few random p5- ports, there's not a whole lot going on there that warrants a packing system wrapping a package system. I guess it's worth it for the non-hobbyists as a time saver, but there's something lost there IMO.

Last edited by thirdm; 21st April 2015 at 02:07 PM. Reason: cpanm has look feature too. remove commentary about cpan vs. cpanm
Reply With Quote
Old 21st April 2015
thirdm thirdm is offline
Spam Deminer
 
Join Date: May 2009
Posts: 234
Default

Btw. there's a really good old thread on perl5-porters discussing the issues distributors of Perl have and the conventions for where to install modules. I link here into the middle of the thread at one of the informationally dense but useful posts:

http://www.nntp.perl.org/group/perl....msg135211.html

The Installation Directories section of the INSTALL document for Perl also makes good reading as does the pod for ExtUtils::MakeMaker:

http://cvsweb.openbsd.org/cgi-bin/cv...-cvsweb-markup

http://search.cpan.org/~bingos/ExtUt...m#make_install

As far as I can tell, OpenBSD ports perl packages install to "site". Hence the problems I have wanting to use cpan as is, which also will tend to install to "site". My experiment on that machine is to ignore the porters' efforts entirely. When I get Slackware replaced by OpenBSD on my main machine I think perhaps I'll configure cpan with a different INSTALL_BASE value, sort of the perl equivalent of an /opt directory for manually built programs, and prefer ports over cpan. I hate all this complexity though. For a machine with one user it seems pretty bent to have more than two or three directories in @INC.
Reply With Quote
Reply

Tags
openbsd perl cpan ssleay cpanm

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
new perl! thirdm OpenBSD General 0 26th March 2013 03:41 PM
Perl 5.16.0 now available J65nko News 1 22nd May 2012 05:37 PM
external drive partition question + fdisk question gosha OpenBSD General 15 15th June 2009 02:00 PM
Basic Perl arrays question stukov Programming 12 18th November 2008 08:44 PM
perl/tk bsdnewbie999 OpenBSD Packages and Ports 4 8th August 2008 12:34 AM


All times are GMT. The time now is 06:52 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick