# p5-DBI-1.636 make install fails



## rtwingfield (May 13, 2016)

```
root@bravo:/usr/ports/databases/p5-DBI # make install
===>  License ART10 GPLv1 accepted by the user
===>  Found saved configuration for p5-DBI-1.636
===>  p5-DBI-1.636 depends on file: /usr/local/sbin/pkg - found
=> DBI-1.636.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://cpan.metacpan.org/modules/by-module/DBI/DBI-1.636.tar.gz
DBI-1.636.tar.gz  100% of  581 kB 1059 kBps 00m00s
===> Fetching all distfiles required by p5-DBI-1.636 for building
===>  Extracting for p5-DBI-1.636
=> SHA256 Checksum OK for DBI-1.636.tar.gz.
===>  Patching for p5-DBI-1.636
===>  p5-DBI-1.636 depends on package: perl5>=5.22<5.23 - found
===>  Configuring for p5-DBI-1.636
env: /usr/local/bin/perl5.22.2: No such file or directory
*** Error code 127

Stop.
make[1]: stopped in /usr/ports/databases/p5-DBI
*** Error code 1
```

. . .well, /usr/local/bin/perl5.22.1 does exist (as found)
The diagnostic implies that perl5 should be >= 5.22 < 5.23

5.22.1 is greater than 5.22
. . .so why is the make looking for 5.22.2 ?


```
# find / -name 'perl5.22*' -print
/usr/local/bin/perl5.22.1
```

. . .so what to do?


----------



## rtwingfield (May 13, 2016)

Apparently Perl v5.22.1  . . .less than 5.22.2, the latter  should be the lower limit per the previous diagnostic failure.  I upgraded Perl to 5.22.2 and have successfully installed the DBI.

Problem . . .solved?  . . .well maybe not.

. . .apparently, the p5-DBI apparently is not compatible with perl5.24.  What is the implication here?  Is there not a DBI for v.24?


----------



## rtwingfield (May 13, 2016)

Yet another problem:


```
# perl -T create_roster_db.pl
DBI.c: loadable library and perl binaries are mismatched (got handshake key 0x7ac0080, needed 0x7b80080)
```

. . .so now with a fresh perl5.22.2 and a fresh install of p5-DBI-1.636, why this mismatch?

Crickey . . .I just _googled-up_ this:  https://rt.perl.org/Public/Bug/Display.html?id=124201

4:32 PM CDT
. . .and I just repeated this same scenario on a different remote server, with the same results.


----------



## rtwingfield (May 14, 2016)

Several readers but no reply or suggestions.

Let me ask this question:  How do you install or compile the Perl XS module?  . . .the eXternal Subroutine, or xsub (see https://en.wikipedia.org/wiki/XS_(Perl)).  Is there a Perl module in the Ports?   If so, then perhaps recompiling it will coordinate the code.


----------



## talsamon (May 15, 2016)

The `perl`  error is reported on https://lists.freebsd.org/pipermail/freebsd-ports/2016-May/103059.html
and in PR 209173. Seems platform related.

and

with  `psearch p5|grep  XS` you can find a lot. (ports-mgmt/psearch port , if not installed)


----------



## rtwingfield (May 18, 2016)

Well, back to this thread:  I just deinstalled and remade perl 5, version 22, subversion 2 (v5.22.2) built for i386-freebsd-thread-multi-64int.  Next, I've followed with a deinstall and remake of p5-DBI.  Once again, it is failing with the following diagnostics:



> ===>  Installing for perl5-5.22.2_1
> ===>  Checking if perl5 already installed
> ===>  Registering installation for perl5-5.22.2_1 as automatic
> Installing perl5-5.22.2_1...
> ...



Why is this a problem?  From ports, /usr/ports/lang/perl5.22, I've run `make`, `make test`, `make install`, and followed with /usr/ports/databases/p5-DBI -- it crashes as described above.

Why should this be such a difficult task?  

Why should the p5-DBI module even concern itself with registering the installation for perl5-5.22.2_1 ???   What is with these obtuse version numbers???


----------



## wblock@ (May 18, 2016)

```
pkg-static: perl5-5.22.2_1 conflicts with perl5.22-5.22.2_1 (installs files into the same place). Problematic file: /usr/local/bin/perl5.22.2
```
This says to me that you have an extra Perl install with messed up version numbers, possibly from settings in /etc/make.conf.  The bad one would be perl5.22-5.22.2_1.  Note the repeated version numbers compared to the real one.

First, I would try to delete that obviously-wrong Perl.  But it might be that all your other Perl packages depend on it.  In that case, portmaster(8) has a way to change the "origin" of a package, to switch a bunch of packages to depending on a new package.  That is shown in the 20150914 entry in /usr/ports/UPDATING.


----------



## rtwingfield (May 18, 2016)

wblock@ said:


> ```
> pkg-static: perl5-5.22.2_1 conflicts with perl5.22-5.22.2_1 (installs files into the same place). Problematic file: /usr/local/bin/perl5.22.2
> ```
> This says to me that you have an extra Perl install with messed up version numbers, possibly from settings in /etc/make.conf.  The bad one would be perl5.22-5.22.2_1.  Note the repeated version numbers compared to the real one.
> ...



I am confused regarding where the "break" in the string 





> perl5.22-5.22.2_1.  Note the repeated version numbers compared to the real one.


 separated the good from bad.  Is it the "hyphen"?  in other words, perl5.22 vs. 5.22.2_1 ?

Well, I've reinstalled *perl 5, version 22, subversion 2 (v5.22.2) built for i386-freebsd-thread-multi-64int* yet again (as confirmed using `perl5.22.2 -v`), and the following objects are found in /usr/local/bin:


```
-rwxr-xr-x  1 root  wheel  44K May 18 13:39 perl5.22.2
-rwxr-xr-x  2 root  wheel  44K May 18 13:39 perlbug5.22.2
-rwxr-xr-x  1 root  wheel  248B May 18 13:39 perldoc5.22.2
-rwxr-xr-x  1 root  wheel  11K May 18 13:39 perlivp5.22.2
-rwxr-xr-x  2 root  wheel  44K May 18 13:39 perlthanks5.22.2
```

I confirmed that /etc/make.conf contains the specification:  
	
	



```
DEFAULT_VERSIONS+=  perl5=5.22
```

Now, I'm running make build on p5-DBI and it has once again choked complaining:


```
install  -m 0644 /usr/ports/lang/perl5.22/work/perl-man.conf /usr/ports/lang/perl5.22/work/stage/usr/local/etc/man.d/perl5.conf
====> Compressing man pages (compress-man)
===>  Installing ldconfig configuration file
===>  Installing for perl5-5.22.2_1
===>  Checking if perl5 already installed
===>  Registering installation for perl5-5.22.2_1 as automatic
Installing perl5-5.22.2_1...
pkg-static: perl5-5.22.2_1 conflicts with perl5.22-5.22.2_1 (installs files into the same place).  Problematic file: /usr/local/bin/perl5.22.2
*** Error code 70

Stop.
make[3]: stopped in /usr/ports/lang/perl5.22
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/lang/perl5.22
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/p5-DBI
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/p5-DBI
```

I simply cannot understand the diagnostic:
 pkg-static: *perl5-5.22.2_1* conflicts with *perl5.22-5.22.2_1* (installs files into the same place).  Problematic file: /usr/local/bin/perl5.22.2
. . .so if they are the same, then what is the problem?

Is there some problem with the port, p5-DBI?  Is it quibbling over the low-order suffix, "_1" and somehow looking for "5.22.2" without the "_1"?

In the first place, why is the  `make build` of the p5-DBI module apparently trying to Install perl5-5.22.2_1...
it's supposed to be the DBI module . . .not perl5-5.22.2_1.

I just need the Perl5/DBI to work.  I'm an applications programmer . . .not a compiler writer.  I've tried to wipe out all things Perl and start fresh with new installs . . .nothing seems to work.


----------



## rtwingfield (May 19, 2016)

FYI (if you can figure out how to move around in this forum), here is  a thread on the Perl Monks forum regarding the problem.


----------



## kpa (May 19, 2016)

You really should be building your own packages with ports-mgmt/synth since you have so heavily customized environment with a non-default version of perl, it would save you a lot of headaches.


----------



## wblock@ (May 19, 2016)

rtwingfield said:


> I am confused regarding where the "break" in the string




```
pkg-static: perl5-5.22.2_1 conflicts with perl5.22-5.22.2_1 (installs files into the same place). Problematic file: /usr/local/bin/perl5.22.2
```

You need perl5-5.22.2_1.  You have perl5.22-5.22.2_1.  Note how the version string 5.22 is repeated in the wrong one.  Run `pkg info -ix perl5` to see that the one with the wrong name is installed.



rtwingfield said:


> here is a thread on the Perl Monks forum regarding the problem.


It's not a Perl problem, it's a problem with the way that one version of Perl was built with the wrong package name on your system.  That might not be the only problem, but it is a problem.


----------



## rtwingfield (May 19, 2016)

kpa said:


> You really should be building your own packages with ports-mgmt/synth since you have so heavily customized environment with a non-default version of perl, it would save you a lot of headaches.


You know, I have been following the *Synth* port announcement with much interest.  Over the years, I have worked with/installed/designed source mgmt. systems for both unix and AS/400 systems.  Synth sounds very interesting, and honestly with apologies to others, _Portmaster_ is just awful.

But speaking of "non-default" version of Perl . . .I would be so willing to just wipe the slate clean and start new.  In fact, that is precisely what I've tried to do.  On these platforms (at least three), so far, not a lot of Perl dependent applications.  Nothing requiring the DBI . . .which I now need!  Problem is . . .it just will not install.  The guys at Perl Monks (see previous post) suggested fresh reinstall, but so far, no joy.

All I'm trying to install is *perl5.22* and the *p5-DBI* -- that's all I need on these platforms.

I'm starting to get the impression that source code in one module needs to be coded in _Calibri_ font, while another needs to be coded in _Courier New_.


----------



## Abriel (May 19, 2016)

I had some free time, so I checked your problem on fresh version on Hyper-V:
`uname -a`

```
FreeBSD zse 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
```
`cat /etc/make.conf`

```
WITH_OPENSSL_PORT=yes
WITH_PKGNG=yes
DEFAULT_VERSIONS+=  perl5=5.22
```
`portmaster databases/p5-DBI`

```
===>>> The following actions were performed:
        Upgrade of pkg-1.6.4 to pkg-1.7.2
        Installation of lang/perl5.22 (perl5-5.22.2_1)
        Installation of databases/p5-DBI (p5-DBI-1.636)
```
Even

```
===>>> The following actions were performed:
        Installation of lang/perl5.24 (perl5-5.24.0)
        Installation of databases/p5-DBI (p5-DBI-1.636)
```
Without any problem. Can you provide me your SUPER create_roster_db.pl And YES I am using portmaster.
Just clean your system.


----------



## SirDice (May 19, 2016)

What does `pkg info -r perl5\*` output?


----------



## rtwingfield (May 19, 2016)

SirDice said:


> What does `pkg info -r perl5\*` output?


`# pkg info -r perl5\*`

```
perl5.20-5.20.3_13:
perl5.22-5.22.2_1:
```



wblock@ said:


> Run  pkg info -ix perl5 to see that the one with the wrong name is installed.


`# pkg info -ix perl5`

```
perl5.20-5.20.3_13
perl5.22-5.22.2_1
```

Now here is the conundrum:  yesterday afternoon, I physically deleted all things perl* in /usr/local/bin and also attempted `make deinstall`'s in all suspect "perl5" ports -- _I mean I tried to wax all things perl . . .*period!*_

I started over with `# make install /usr/ports/lang/perl5.22` with
 /etc/make.conf configured as follows:

```
DEFAULT_VERSIONS+=  perl5=5.22
MAKE_JOBS_UNSAFE=yes
DISABLE_VULNERABILITIES=yes
```

After the successful install . . .the results as follows:
`# ls -lh /usr/local/bin | less`   . . ._and then searching for “perl”_

```
-rwxr-xr-x  1 root  wheel  44K May 18 13:39 perl5.22.2
-rwxr-xr-x  2 root  wheel  44K May 18 13:39 perlbug5.22.2
-rwxr-xr-x  1 root  wheel  248B May 18 13:39 perldoc5.22.2
-rwxr-xr-x  1 root  wheel  11K May 18 13:39 perlivp5.22.2
-rwxr-xr-x  2 root  wheel  44K May 18 13:39 perlthanks5.22.2
```

The next step was to attempt to `# make install /usr/ports/databases/p5-DBI` but just as before, it crashed, and apparently has left a legacy of trying to install perl5.20-5.20.3_13   . . .why?

So this morning, I'm going to try as demonstrated by Abriel (above) 





Abriel said:


> portmaster databases/p5-DBI



Apparently the `pkg info` list _thinks_ that perl5.20-5.20.3_13  is installed . . .but it's not (at least not in /usr/local/bin).  I'm just going to leave it wherever it's "file"
. . .there are these two directories in /var/db/ports:


```
drwxr-xr-x  2 root  wheel  512B May 18 14:04 lang_perl5.20
drwxr-xr-x  2 root  wheel  512B Jul  8  2015 lang_perl5.22
```
and also

```
drwxr-xr-x  2 root  wheel  512B Feb 14  2011 p5-DBD-mysql
drwxr-xr-x  2 root  wheel  512B Jan 25  2011 p5-libwww
```

. . .the _legacy_ dates are suspect.  Why they're still there, I have no idea.  I thought `portmaster` was supposed to handle such things.

Regardless, it's post time . . .off to the races___


----------



## SirDice (May 19, 2016)

Have you tried to delete the packages? Deleting the actual executables doesn't remove the package's registration in the database. 

I'd try something like this (there's nothing depending on any of them so it should be safe): `pkg delete perl5\*`. Make sure `pkg info -ix perl` doesn't return anything anymore. Then see if there are still some /usr/local/bin/perl* executables left behind and remove those too. Followed by a `rm -rf /usr/local/lib/perl5/`. That _should_ make sure you have a completely "perl-less" system. 

Once you're confident everything is gone and pkg(8) reports no Perl you can try building databases/p5-DBI again.


----------



## rtwingfield (May 19, 2016)

. . .this thing has done a Waltz Across Texas

and it FAILS!


```
===>>> Returning to dependency check for databases/p5-DBI
===>>> Dependency check complete for databases/p5-DBI

===>  Cleaning for p5-DBI-1.636
===>  License ART10 GPLv1 accepted by the user
===>  Found saved configuration for p5-DBI-1.636
===>  p5-DBI-1.636 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by p5-DBI-1.636 for building
===>  Extracting for p5-DBI-1.636
=> SHA256 Checksum OK for DBI-1.636.tar.gz.
===>  Patching for p5-DBI-1.636
===>  p5-DBI-1.636 depends on package: perl5>=5.22<5.23 - not found
===>  Installing for perl5-5.22.2_1
===>  Checking if perl5 already installed
===>  Registering installation for perl5-5.22.2_1 as automatic
Installing perl5-5.22.2_1...
pkg-static: perl5-5.22.2_1 conflicts with perl5.22-5.22.2_1 (installs files into the same place).  Problematic file: /usr/local/bin/perl5.22.2
*** Error code 70

Stop.
make[3]: stopped in /usr/ports/lang/perl5.22
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/lang/perl5.22
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/p5-DBI
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/p5-DBI

===>>> make build failed for databases/p5-DBI
===>>> Aborting update

===>>> Upgrade of pkg-1.6.2 to pkg-1.7.2 complete


===>>> You can restart from the point of failure with this command line:
  portmaster <flags> databases/p5-DBI
```


----------



## rtwingfield (May 19, 2016)

SirDice said:


> Have you tried to delete the packages? Deleting the actual executables doesn't remove the package's registration in the database.
> 
> I'd try something like this (there's nothing depending on any of them so it should be safe): `pkg delete perl5\*`. Make sure `pkg info -ix perl` doesn't return anything anymore. Then see if there are still some /usr/local/bin/perl* executables left behind and remove those too. Followed by a `rm -rf /usr/local/lib/perl5/`. That _should_ make sure you have a completely "perl-less" system.
> 
> Once you're confident everything is gone and pkg(8) reports no Perl you can try building databases/p5-DBI again.



Looks like our posts crossed in the ether.  I'll follow your lead and see what happens.


----------



## wblock@ (May 19, 2016)

To summarize: at some point, you had an incorrect version string set in /etc/make.conf.  All the rest is just errors that are cascading off of that.

Until you delete the badly-named package, the problems will continue.  portmaster(8) cannot repair things, that is not what it does.
The badly-named package is perl5.22-5.22.2_1.
Delete it: `pkg delete -f perl5.22-5.22.2_1`

Then make certain the perl version string in /etc/make.conf is not still bad.
Then install the correct Perl as you have been trying:
`portmaster lang/perl5`

Then rebuild all of the p5-* ports so they depend on the right one:
`portmaster p5-`


----------



## rtwingfield (May 19, 2016)

wblock@ said:


> you had an incorrect version string set in /etc/make.conf.


  I don't understand because the content of /etc/make.conf was (for weeks . . .months) 

```
DEFAULT_VERSIONS+=  perl5=5.22
MAKE_JOBS_UNSAFE=yes
DISABLE_VULNERABILITIES=yes
```
 Per your reminder, 





wblock@ said:


> That is shown in the 20150914 entry in /usr/ports/UPDATING.


 I've actually been aware of that caveat since that 2015 date.

And following SirDice's lead, (this thread) at https://forums.freebsd.org/threads/56247/#post-320291, the build/install did complete successfully . . .finally!  (though haven't tested yet).  This was accomplished with the /etc/make.conf content left "as-is".

Also regarding your suggestion, 


wblock@ said:


> Then install the correct Perl as you have been trying:
> `portmaster lang/perl5`


 I think that a significant aspect of the problem is associated with the behavior of the p5-DBI port to _automatically_ install the perl5.22 port as part-and-parcel of the DBI.  This is counter-intuitive because, seems to me, that the perl5.22 (whatever version) is the Perl "core".  Think of it like a work truck.  You bought it, works fine, you drive it daily.  Later, you want to add something to it,  a new Sirius XM radio!  Yeah!!!   But you don't tear the truck apart . . .destroy it in the process.  You just add a module to it, and in Perl's example, the DBI. 

So, rather than `portmaster lang/perl5.22`, I simply started with `portmaster databases/p5-DBI`.  As I mentioned, this is counter-intuitive because it seems to me that you need the truck before you install the radio. 

But, and a big BUT,

I just tested the fresh install against my little Perl script, `# perl -T create_roster_db.pl`, 
and it fails . . .right back where we started:

```
DBI.c: loadable library and perl binaries are mismatched (got handshake key 0x7ac0080, needed 0x7b80080)
```


----------



## rtwingfield (May 19, 2016)

wblock@ said:


> Then make certain the perl version string in /etc/make.conf is not still bad.


Warren, may I ask what your perception of the correct version string should be?

I've got 
	
	



```
DEFAULT_VERSIONS+=  perl5=5.22
```

BTW,
`# perl -v`

```
This is perl 5, version 22, subversion 2 (v5.22.2) built for i386-freebsd-thread-multi-64int
```
 . . .same as from days ago.

In a nutshell, here is the sequence of events:

`# pkg delete perl5\*`
`# pkg info -ix perl`  . . .returns nothing
`# rm -rf /usr/local/lib/perl5/`  . . .actually nothing was there to begin with.
/etc/make.conf  . . . specifies 
	
	



```
DEFAULT_VERSIONS+=  perl5=5.22
```
`# portmaster databases/p5-DBI`     . . .installed perl5.22 and p5-DBI

Test still complains,

```
DBI.c: loadable library and perl binaries are mismatched (got handshake key 0x7ac0080, needed 0x7b80080)
```

Sincere thanks,


----------



## wblock@ (May 19, 2016)

rtwingfield said:


> may I ask what your perception of the correct version string should be?
> 
> I've got
> 
> ...


That looks correct, as shown in /usr/ports/UPDATING.

Note the other part of that entry:

```
If your Perl package name is not called perl5-5.xx.y but perl5.xx-5.xx.y,
  you will need to rename it so that portupgrade and portmaster do not get
  confused:

  pkg set -n perl5.xx:perl5
```


----------



## rtwingfield (May 19, 2016)

Yeah, understand, but not applicable.  I deleted all things perl before reinstalling yet again as previously noted.  This is crazy.  I simply ask `# portmaster databases/p5-DBI` to do the whole thing.  One would think that the p5-DBI makefile would use the same compiler as used to compile the perl5.22 core . . .as it used to create the DBI, i.e., itself.


----------



## rtwingfield (May 19, 2016)

Some of the comments at http://www.perlmonks.org/?node_id=1163254  are related to this "handshake key value" thing (way above my pay grade).  If they or guys at CPAN can't explain it, then what to do?   (at this point, almost a rhetorical question___)


----------



## kpa (May 19, 2016)

Do you happen to have an /usr/local/etc/perl_version file or /etc/perl_version? Remove them if found because they should no longer be in the system and may interfere with building of perl modules.


----------



## rtwingfield (May 19, 2016)

Thanks, but no hits on  `# find / -name perl_version -print`


----------

