Solved devel/gettext portupgrade issue when compiling other ports (qjail/ezjail)

OK, I'm thoroughly stuck. I'm compiling inside a qjail jail on FreeBSD 10.1. For starters I followed UPDATING regarding gettext and removed the original packages and installed the new version of devel/gettext using pkg with these results:

Code:
expat-2.1.0_2  XML 1.0 parser written in C
gettext-0.19.4  GNU gettext meta package
gettext-runtime-0.19.4  GNU gettext runtime libraries and programs
gettext-tools-0.19.4  GNU gettext development and translation tools

Code:
FORCE_PKG_REGISTER  yes

Incidentally I'm using the new pkg system and have WITH_PKGNG=YES in my /etc/make.conf.

But when I try to compile something that depends on the gettext library such as PostgreSQL using portmaster -g databases/postgresql94-server I get the following error message:

Code:
====> Compressing man pages (compress-man)
===>  Installing for expat-2.1.0_2
===>  Checking if expat already installed
===>  expat-2.1.0_2 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of expat
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** Error code 1

So to sum it up, I upgraded gettext as instructed in UPDATING but it seems like the build environment is not detecting that the package is already installed and trying to reinstall it, causing a deadlock.

Any ideas where I can look?

Thanks!
 
Do not set FORCE_PKG_REGISTER, it means "wipe out an installed port with this new one". It overrides that safety.

pkg is the default now, there is no need to specify it in make.conf.

This type of problem is usually due to missed steps in /usr/ports/UPDATING that apply to the whole system rather than a single port. What happens if you manually delete expat and install it?
 
I've unset FORCE_PKG_REGISTER

Here is my current list of installed packages:

Code:
dialog4ports-0.1.5_2  Console Interface to configure ports
expat-2.1.0_2  XML 1.0 parser written in C
gettext-0.19.4  GNU gettext meta package
gettext-runtime-0.19.4  GNU gettext runtime libraries and programs
gettext-tools-0.19.4  GNU gettext development and translation tools
indexinfo-0.2.2  Utility to regenerate the GNU info page index
pkg-1.4.12  Package manager
portmaster-3.17.7  Manage your ports without external databases or languages
screen-4.2.1_5  Multi-screen window manager

So if I remove devel/gettext and all its dependencies with these commands:
Code:
pkg delete gettext
pkg delete gettext-tools
pkg delete gettext-runtime
pkg autoremove

I'm left with the following:
Code:
dialog4ports-0.1.5_2  Console Interface to configure ports
indexinfo-0.2.2  Utility to regenerate the GNU info page index
pkg-1.4.12  Package manager
portmaster-3.17.7  Manage your ports without external databases or languages
screen-4.2.1_5  Multi-screen window manager
portmaster -g devel/gettext

Initially I'm prompted with:
Code:
===>>> The following actions will be taken if you choose to proceed:
  Install devel/gettext
  Install devel/gettext-runtime
  Install devel/gettext-tools
  Install textproc/expat2

===>>> Proceed? y/n [y] y
I tell it to proceed, after a lot of output I next get:
Code:
===>>> Installation of devel/gettext-runtime (gettext-runtime-0.19.4) succeeded

===>>> Delete gettext-1.05.tar.gz? y/n [n]

I press enter and it starts to build devel/gettext-tools which fails with the following message:
Code:
===>  Installing for expat-2.1.0_2
===>  Checking if expat already installed
===>  expat-2.1.0_2 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of expat
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** Error code 1

Stop.
make[2]: stopped in /sharedfs/usr/ports/textproc/expat2
*** Error code 1

Stop.
make[1]: stopped in /sharedfs/usr/ports/devel/gettext-tools
*** Error code 1

Stop.
make: stopped in /sharedfs/usr/ports/devel/gettext-tools

===>>> make build failed for devel/gettext-tools
===>>> Aborting update

===>>> Update for devel/gettext-tools failed
===>>> Aborting update

===>>> The following actions were performed:
  Installation of devel/gettext-runtime (gettext-runtime-0.19.4)
  Installation of textproc/expat2 (expat-2.1.0_2)


===>>> You can restart from the point of failure with this command line:
  portmaster <flags> devel/gettext devel/gettext-tools

Executing pkg info I get:
Code:
dialog4ports-0.1.5_2  Console Interface to configure ports
expat-2.1.0_2  XML 1.0 parser written in C
gettext-runtime-0.19.4  GNU gettext runtime libraries and programs
indexinfo-0.2.2  Utility to regenerate the GNU info page index
pkg-1.4.12  Package manager
portmaster-3.17.7  Manage your ports without external databases or languages
screen-4.2.1_5  Multi-screen window manager
So we can see that the devel/gettext meta port triggered the installation of devel/gettext-runtime and textproc/expat2, but then when it went on to build devel/gettext-tools it failed to note it had already installed textproc/expat2.

It seems to me that something is broken in the build process where it isn't detecting that some packages have already been installed. This is causing it to collide with itself on installs that have multiple dependencies with common sub dependencies...

I can work around the problem for devel/gettext itself by installing it using pkg, but that doesn't solve the problem of ports colliding afterwards that aren't detecting that devel/gettext or textproc/expat2 are already installed and at the correct versions. I suspect if I keep trying other ports I will continue to find other ports that don't detect the dependencies already exist.

Thanks,

DigitalNight
 
The update has been already some time ago, but I remember of something close to that scenario above related to textproc/expat2. I do not remember if there has been an option to de-install that port or not. It is likely that I have just done pkg delete expat2. Please try this method. Finally the update of devel/gettext should pull in textproc/expat2 again.
 
Thanks chrbr so resuming where I left off:

pkg delete expat
Code:
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
  expat-2.1.0_2

The operation will free 470 KiB.
[maildbport] [1/1] Deinstalling expat-2.1.0_2...
[maildbport] [1/1] Deleting files for expat-2.1.0_2: 100%
Then I run portmaster again:

Code:
portmaster -g devel/gettext

===>>> devel/gettext >> (2)

===>>> The following actions will be taken if you choose to proceed:
  Install devel/gettext
  Install devel/gettext-tools
  Install textproc/expat2
===>>> Proceed? y/n [y]

And once again I get:

Code:
===>  Installing for expat-2.1.0_2
===>  Checking if expat already installed
===>  expat-2.1.0_2 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of expat
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** Error code 1

Stop.
make[2]: stopped in /sharedfs/usr/ports/textproc/expat2
*** Error code 1

Stop.
make[1]: stopped in /sharedfs/usr/ports/devel/gettext-tools
*** Error code 1

Stop.
make: stopped in /sharedfs/usr/ports/devel/gettext-tools

===>>> make build failed for devel/gettext-tools
===>>> Aborting update

===>>> Update for devel/gettext-tools failed
===>>> Aborting update

===>>> Installation of textproc/expat2 (expat-2.1.0_2) complete


===>>> You can restart from the point of failure with this command line:
  portmaster <flags> devel/gettext devel/gettext-tools

So even having built the other intermediate it still trips over its own feet....
 
Please try to leave out the option -g and just run portmaster devel/gettext. I have never used the option -g, therefore this is the only thing I can imagine right now which might introduce the issue.
 
There are a lot of variables, starting with doing this in a jail. What other entries are in /etc/make.conf?
 
chrbr

Once again I've removed textproc/expat
Code:
pkg delete expat
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
  expat-2.1.0_2

The operation will free 470 KiB.
[maildbport] [1/1] Deinstalling expat-2.1.0_2...
[maildbport] [1/1] Deleting files for expat-2.1.0_2: 100%

I've restarted portmaster without the -g, e.g. portmaster devel/gettext, initial output is:
Code:
portmaster devel/gettext

===>>> Port directory: /usr/ports/devel/gettext

===>>> Gathering distinfo list for installed ports

===>>> Gathering dependency list for devel/gettext from ports
===>>> Launching child to install devel/gettext-tools

===>>> devel/gettext >> devel/gettext-tools (1/1)

===>>> Port directory: /usr/ports/devel/gettext-tools

===>>> Launching 'make checksum' for devel/gettext-tools in background
===>>> Gathering dependency list for devel/gettext-tools from ports
===>>> Launching child to install textproc/expat2

===>>> devel/gettext >> devel/gettext-tools >> textproc/expat2 (2/2)

===>>> Port directory: /usr/ports/textproc/expat2

===>>> Launching 'make checksum' for textproc/expat2 in background
===>>> Gathering dependency list for textproc/expat2 from ports
===>>> Initial dependency check complete for textproc/expat2

===>>> Continuing initial dependency check for devel/gettext-tools
===>>> Initial dependency check complete for devel/gettext-tools

===>>> Continuing initial dependency check for devel/gettext
===>>> Initial dependency check complete for devel/gettext


===>>> devel/gettext >> (2)

===>>> The following actions will be taken if you choose to proceed:
  Install devel/gettext
  Install devel/gettext-tools
  Install textproc/expat2

===>>> Proceed? y/n [y]

and we have the same result:
Code:
====> Compressing man pages (compress-man)
===>  Installing for expat-2.1.0_2
===>  Checking if expat already installed
===>  expat-2.1.0_2 is already installed
  You may wish to ``make deinstall'' and install this port again
  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old port of expat
  without deleting it first, set the variable "FORCE_PKG_REGISTER"
  in your environment or the "make install" command line.
*** Error code 1

Stop.
make[2]: stopped in /sharedfs/usr/ports/textproc/expat2
*** Error code 1

Stop.
make[1]: stopped in /sharedfs/usr/ports/devel/gettext-tools
*** Error code 1

Stop.
make: stopped in /sharedfs/usr/ports/devel/gettext-tools

===>>> make build failed for devel/gettext-tools
===>>> Aborting update

===>>> Update for devel/gettext-tools failed
===>>> Aborting update

===>>> Installation of textproc/expat2 (expat-2.1.0_2) complete


===>>> You can restart from the point of failure with this command line:
  portmaster <flags> devel/gettext devel/gettext-tools

So the portmaster -g option doesn't make a difference. Which is good because I'm trying to generate packages that I can install in other jails...
 
wblock@

Here is my /etc/make.conf:
Code:
WRKDIRPREFIX=  /var/ports
DISTDIR=  /var/ports/distfiles
PACKAGES=  /var/ports/packages
INDEXDIR=  /var/ports
WITH_PKGNG=YES

I just removed the WITH_PKGNG=YES from the bottom of it, and have the same errors (which I expected).

I am using qjail so my root directory is:

Code:
/
bin -> /sharedfs/bin
lib -> /sharedfs/lib
libexec -> /sharedfs/libexec
sbin -> /sharedfs/sbing
sys -> /sharedfs/sys

/usr
bin -> /sharedfs/usr/bin
lib -> /sharedfs/usr/lib
lib32 -> /sharedfs/usr/lib32
libdata -> /sharedfs/usr/libdata
libexec -> /sharedfs/usr/libexec
ports -> /sharedfs/usr/ports
sbin -> /sharedfs/usr/sbin
share -> /sharedfs/usr/share
src -> /sharedfs/usr/src

The sharedfs is a readonly filesystem shared between all jails so I don't have to duplicate the system files and ports tree among all the jails :).
 
Those path settings are from the jail. I just rebuilt expat in an ezjail, which went fine:
Code:
...
====> Compressing man pages (compress-man)
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
   expat-2.1.0_2

The operation will free 470 KiB.
[icinga] [1/1] Deinstalling expat-2.1.0_2...
[icinga] [1/1] Deleting files for expat-2.1.0_2: 100%

===>  Installing for expat-2.1.0_2
===>  Checking if expat already installed
===>  Registering installation for expat-2.1.0_2 as automatic
[icinga] Installing expat-2.1.0_2...

===>>> Re-installation of expat-2.1.0_2 complete
 
wblock@ Thanks for you comment on ezjail.

First what I tried that didn't work:

I created a new jail using qjail and in it I removed the symbolic of /usr/ports -> /sharedfs/usr/ports, and used portsnap fetch ; portsnap extract to install a fresh copy of the ports tree to /usr/ports. I then modified make.conf and commented out all of the qjail port compilation options, which left a blank file.

I still got the same errors at that point.

Last night I installed ezjail and built a base jail with the ports tree. After switching to that jail I've been able to compile not just devel/gettext and its dependencies, but also ports-mgmt/pkg, ports-mgmt/portmaster, and am well underway in compiling databases/postgresql94-server.

So in the end it comes down to some difference in how qjail created the base file system vs how ezjail does it. Thanks for you and chrbr helping me with it. Do you think there is any value in comparing the two jail base filesystems / jails to see what actually made the difference?

Best regards.
 
The odd thing about that is that qjail is a fork of ezjail. ezjail is where the shared ports tree originated, although there it is called the "basejail".
 
Back
Top