# Error when compiling devel/gettext in jail



## serverhamster (Mar 19, 2013)

I fail to upgrade devel/gettext in all jails, while it succeeds on the host.


```
./localename.c: In function '_nl_locale_name_thread_unsafe':
./localename.c:2607: error: 'locale_t' undeclared (first use in this function)
./localename.c:2607: error: (Each undeclared identifier is reported only once
./localename.c:2607: error: for each function it appears in.)
./localename.c:2607: error: expected ';' before 'thread_locale'
./localename.c:2608: error: 'thread_locale' undeclared (first use in this function)
./localename.c:2608: error: 'LC_GLOBAL_LOCALE' undeclared (first use in this function)
*** Error code 1

Stop in /var/ports/basejail/usr/ports/devel/gettext/work/gettext-0.18.1.1/gettext-runtime/intl.
*** Error code 1

Stop in /var/ports/basejail/usr/ports/devel/gettext/work/gettext-0.18.1.1/gettext-runtime.
*** Error code 1

Stop in /var/ports/basejail/usr/ports/devel/gettext/work/gettext-0.18.1.1/gettext-runtime.
*** Error code 1

Stop in /var/ports/basejail/usr/ports/devel/gettext/work/gettext-0.18.1.1.
*** Error code 1

Stop in /basejail/usr/ports/devel/gettext.

===>>> make failed for devel/gettext
===>>> Aborting update

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

Terminated
===>>> The following actions were performed:
        Upgrade of libiconv-1.14 to libiconv-1.14_1


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

I'm using sysutils/ezjail, but I'm probably doing something wrong there. After upgrading the host to FreeBSD 9.1-RELEASE, I ran ezjail-admin update -u and that's probably not enough. Something must be wrong with the basejail.

But what?


----------



## SirDice (Mar 19, 2013)

Read /usr/ports/UPDATING:

```
20130316:
  AFFECTS: users of converters/libiconv and devel/gettext
  AUTHOR: bapt@FreeBSD.org

  libiconv now handles the lib/charset.alias file instead of devel/gettext.
  If you are using pkgng 'and' upgrading from source with portupgrade or
  portmaster, first delete gettext, upgrade libiconv, then reinstall gettext.

  # pkg delete -f devel/gettext
  # portmaster converters/libiconv devel/gettext
    or
  # pkg delete -f devel/gettext
  # portupgrade converters/libiconv devel/gettext
```


----------



## serverhamster (Mar 19, 2013)

I already learned (the hard way) about the importance of /usr/ports/UPDATING, so I followed the instructions. You can see that converters/libiconv was successfully upgraded.


```
===>>> The following actions were performed:
        Upgrade of libiconv-1.14 to libiconv-1.14_1
```

Also, the same method worked on the host. I get the same compile error in all jails.


----------



## serverhamster (Mar 20, 2013)

I found a solution, but I'm not sure if it's the right way.

Usually, I update the basejail with 
	
	



```
# ezjail-admin update -u
```
This time, I had to update by running 
	
	



```
# ezjail-admin -i
```

After that devel/gettext can be compiled, but I'm entirely unsure about this method. Is there something I'm missing here? Like running mergemaster?


----------



## konstantin (Mar 20, 2013)

I have the same issue in jails and have no issue on host. Can anybody help us? Looks like something goes wrong after updating the jails from 9.0-RELEASE to 9.1-RELEASE.

My upgrade method was:
[cmd=]# ezjail-admin update -U -s 9.0-RELEASE[/cmd]
[cmd=]# mergemaster in every jail[/cmd]

Rebuilt all packages in every jail.

Whats is going wrong?

I can't update glib-2.28.8_5 in jails either. Please see PR PR 177069.


----------



## allanjude@ (Mar 28, 2013)

serverhamster said:
			
		

> Usually, I update the basejail with
> 
> 
> 
> ...



*Y*ou probably want to do: `ezjail-admin update -up`

*T*he -p updates the ports tree in the jails as well, via portsnap.


----------



## konstantin (Mar 29, 2013)

Hi all!

Problem is solved for me. It was a mistake in the ezjail-admin script. The upgrade from 9.0 to 9.1 was not finished; `freebsd-update install` was issued only once instead of two times. Now it's fixed in SVN https://erdgeist.org/cvsweb/ezjail/ezjail-admin


----------



## Blackheart (Mar 30, 2013)

I'm having that same problem with my jails _and_ the host itself, so it seems *I* could have messed it up with my 9.0 to 9.1 upgrade as @konstantin says. I'm figuring what to do around freebsd-update.


----------



## serverhamster (Mar 31, 2013)

So, is there a way to force [cmd=]ezjail-admin update -u[/cmd] without it telling you

```
freebsd-update: Cannot upgrade from 9.1-RELEASE to itself
```
Or, can the basejail be reinstalled somehow?


----------



## Blackheart (Mar 31, 2013)

Well, [cmd=]freebsd-update IDS[/cmd] complains on half the userland for me and don't want to buildworld/kernel to _-STABLE_ or _-RELEASE_.

I don't see any other option than just store my configurations and do a clean install with the DVD.


----------



## Predy (Apr 2, 2013)

I have the same issue as you, but not on all jails. Some jails compile gettext just fine, some give the same error. But I have the same issue on the host, and on one other server that has no jails. I don't think it's really jail related. I've tried recompiling everything, but I can't get rid of the error. Removing gettext and reinstalling does not work either.


----------



## Blackheart (Apr 2, 2013)

Today *I* just did some "knife in mouth" stuff without luck at all. Yeah, *I* know *I* was just asking for trouble but maybe it can add more pointers to the problem.

I faked the $RELNUM variable on freebsd-update to _9.0-RELEASE_ then did `# freebsd-update upgrade -r 9.1-RELEASE` and `# freebsd-update install`.

It overwrote the new files, merged the configurations and everything. I rebooted, reverted the freebsd-update script to its original state and did `# freebsd-update fetch` and `# freebsd-update install` again to hit _9.1-RELEASE-p1_.

After that *I* tried to compile devel/gettext and failed again. Funnily *I* also compared the output of `# freebsd-update IDS` with my previous saved one and both were identical.


----------



## SirDice (Apr 3, 2013)

As this appears to be a localization problem, what are your locale(1) settings?


----------



## serverhamster (Apr 4, 2013)

Nothing out of the ordinary. I also usually compile ports without NLS.

```
lang=
lc_ctype="c"
lc_collate="c"
lc_time="c"
lc_numeric="c"
lc_monetary="c"
lc_messages="c"
lc_all=
```

Is this a bad idea?


----------



## Blackheart (Apr 4, 2013)

Crash after `# make clean && make` on /usr/ports/devel/gettext

```
./localename.c  -fPIC -DPIC -o .libs/localename.o
./localename.c: In function '_nl_locale_name_thread_unsafe':
./localename.c:2607: error: 'locale_t' undeclared (first use in this function)
./localename.c:2607: error: (Each undeclared identifier is reported only once
./localename.c:2607: error: for each function it appears in.)
./localename.c:2607: error: expected ';' before 'thread_locale'
./localename.c:2608: error: 'thread_locale' undeclared (first use in this function)
./localename.c:2608: error: 'LC_GLOBAL_LOCALE' undeclared (first use in this function)
*** Error code 1

Stop in /usr/ports/devel/gettext/work/gettext-0.18.1.1/gettext-runtime/intl.
*** Error code 1

Stop in /usr/ports/devel/gettext/work/gettext-0.18.1.1/gettext-runtime.
*** Error code 1

Stop in /usr/ports/devel/gettext/work/gettext-0.18.1.1/gettext-runtime.
*** Error code 1

Stop in /usr/ports/devel/gettext/work/gettext-0.18.1.1.
*** Error code 1

Stop in /usr/ports/devel/gettext.
```
`# locale`

```
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
```
/etc/make.conf

```
PKG_OPTIONS.postfix+=sqlite
NO_X="YES"
NO_X11="YES"
WITHOUT_X11="YES"
WITHOUT_GUI="YES"
WITHOUT_TK="YES"
ENABLE_GUI="NO"
# added by use.perl 2013-03-28 16:53:40
PERL_VERSION=5.14.2
```
`# uname -a`

```
FreeBSD zaibach.dyndns.org 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec  4 09:23:10 UTC 2012     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```

I have the same error on the host and the jails. I'll end checksuming all the involved headers on a clean install against mine.


----------



## danielr (Apr 4, 2013)

Same error for me! Can't install gettext anymore. UPDATING was no help. Please fix this!


----------



## danielr (Apr 4, 2013)

Thanks to @AllanJud,  I finally was able to install Gettext again. He referred to http://blog.pcbsd.org/2013/04/pc-bs...epository-for-pc-bsd-and-freebsd-9-1-release/

Since I could not compile Gettext anymore (same error as the authors) I wanted to install it with PKGNG. I added the following settings to my pkgng.conf, as mentioned here http://wiki.pcbsd.org/index.php/Turn_FreeBSD_into_PC-BSD® , to make use of the PC-BSD PKGNG repo:

```
#edit /usr/local/etc/pkgng.conff
packagesite: [url]ftp://mirrors.isc.org/pub/pcbsd/packages/9.1-RELEASE/amd64/[/url]
PUBKEY: /usr/local/etc/pkg-pubkey.cert
PKG_CACHEDIR: /usr/local/tmp
```
Next I downloaded the keyfile and copied it to /usr/local/etc/pkg-pubkey.cert 

Then I typed [cmd=]pkg install gettext[/cmd] which resulted in 
	
	



```
Installing gettext-0.18.1.1_1... done
```

I did compile packages before that, which worked fine all time. I don't understand why I can't compile Gettext anymore all of a sudden. I hope it will be fixed soon.


----------



## danielr (Apr 4, 2013)

CORRECTION: sorry, you have to edit /usr/local/etc/pkg.conf (there is no pkgng.conf)


----------



## kpa (Apr 4, 2013)

That's very odd, I can compile devel/gettext just fine in a jail but then again I'm using ports-mgmt/poudrire-devel that guarantees a clean starting point for every port compilation. This is most likely related to the port using old headers from /usr/local/include instead of using the headers from the work directory as it should.


----------



## DeciusMagnus (Apr 7, 2013)

I'm building from ports and not using any jails. I too am having this problem and following UPDATING doesn't help. Nothing seems to be working.


----------



## Blackheart (Apr 10, 2013)

I fixed it for me the hard way forcing ezjail to reinstall the basejail from base.txz, after that *I* was able to compile in a jail.

Regarding the host itself _I_ overwrote the files that `# freebsd-update IDS` was complaining about using the same basejail as a source.


----------



## serverhamster (Apr 30, 2013)

How did you force a reinstallation of the basejail? If I do `ezjail-admin update -U -s 9.1-RELEASE`, I get 
	
	



```
freebsd-update: Cannot upgrade from 9.1-RELEASE to itself
```


----------



## Blackheart (May 3, 2013)

I deleted the entire basejail and installed from scratch.


----------



## danielr (Jul 6, 2013)

Hi all. I still get this error when installing gettext on a new jail. Needed to do `pkg_add -r gettext`.


----------



## danielr (Jul 16, 2013)

http://forums.freebsd.org/showpost.php?p=227013&postcount=4


----------

