New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian Wheezy and libc6 #87

Closed
xtr3me opened this Issue Dec 11, 2014 · 14 comments

Comments

Projects
None yet
5 participants
@xtr3me
Copy link

xtr3me commented Dec 11, 2014

the new libc6 on your dl.hhvm.com repo breaks many packages in debian 7 like "locales-all, varnish" and some other.

most of this packages needs an older version of libc6

After a succesfull installation of HHVM i'm unable to install build-essential:

apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
dpkg --list | grep -i libc6
ii  libc6:amd64                        2.19-13                       amd64        GNU C Library: Shared libraries
dpkg --list | grep -i hhvm
ii  hhvm                               3.4.0~wheezy                  amd64        HHVM virtual machine, runtime, and JIT for the PHP language

How can I fix this successfully?

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 11, 2014

If you have any ideas I'd love to hear them -- I don't know myself. The best thing I know is to follow the directions for building on wheezy https://github.com/facebook/hhvm/wiki/Building-and-installing-HHVM-on-Debian-7 which tell you how to suck down all the packages you need from jessie -- but that will upgrade potentially a lot more of your system than you want. You will probably be better off just going all the way to jessie.

As for wheezy, the problem is that we need a fairly new gcc, 4.8 at least, and wheezy only has 4.7. (gcc 4.8 isn't that new, but it's newer than the glacial Debian stabilization process :)) This brings with it a new libstdc++, and therefore a new libc -- at least done naively, which is all I know how to do. There might be some more clever way to get a newish libstdc++ that doesn't require a new libc, at which point we could just ship that, or otherwise isolate things, I have no idea.

What I did is a total hack; I thought it worked "well enough" but that appears to not be the case.

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 11, 2014

For some historical context, what this used to do is silently just upgrade your libstdc++ to some version from some ubuntu that I couldn't trace the lineage of (it was set up by someone else a year ago who forgot where that came from). It was a similarly weird gcc that I couldn't trace the lineage of, which also just failed to build HHVM starting in November or so. I wanted to upgrade gcc just a little, but since as far as I could find the only place these packages existed was in our repo and on the one VM I had, just pulling stuff from jessie seemed the easiest route. (Otherwise have to figure out how to build gcc against the old libc, then distribute that libstdc++, and hope it all works together well...)

And then the VM with all this stuff fell over anyways, which forced the issue :)

@xtr3me

This comment has been minimized.

Copy link

xtr3me commented Dec 12, 2014

Thanks for your insights on this, as I don't have a specific reason not to use Jessie i have upgraded this machine to Jessie.

Maybe it is a good idea to add a extra comment after the installation of the package (or before if that is possible) and also a comment on the support/install pages
https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Debian-7

Something that states that libc6 is upgraded and that this definitely breaks other packages like build-essential.

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 12, 2014

https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Debian-7 already has a warning paragraph with lots of bold in it talking specifically about the libc upgrade. I'll word it a bit better.

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 13, 2014

Question for those affected: would it be better to just remove libc6/etc from the dl.hhvm.com repo? This would make the hhvm package contained in there uninstallable unless you pull packages from jessie, but at least it would lead to less surprising upgrades.

@Majkl578

This comment has been minimized.

Copy link
Contributor

Majkl578 commented Dec 13, 2014

@jwatzman: What about linking libc6/libstd++ statically into hhvm binary? Then you wouldn't need to bother about system's glibc version.

There is also another solution called APT Pinning. You add jessie/testing to the APT sources and tell APT about your preferences. On a stable system, you would prefer wheezy/stable by default, but pin glibc packages to their jessie/testing version/origin.

(Also, you shouldn't be suggesting using jessie as a base system, it's still a testing version.)

@ADDISON74

This comment has been minimized.

Copy link

ADDISON74 commented Dec 13, 2014

Please allow me a comment to that warning. Debian Wheezy is the latest stable version. Jessie is considered unstable, not for production. If we are running wheezy 7.7 is just fine. I am playing with Jessie but I will not switch my server to it until 1 - 2 releases.

Do not use "apt-get -f -y upgrade" or "apt-get -f -y dist-upgrade"! Both will install new versions but also to remove lot of things: locales, nfs-common, parts of virtualmin if you use it. In case you did it and now you have trouble with Varnish. Do the following steps:

  1. Remove from repository the one related to HHVM. You can check with "apt-cache policy package_name" those packages which are creating trouble. You will discover that first option is a new version from http://dl.hhvm.com/debian/. As you can see this creates trouble, instead of taking files from debian repository it is taking from hhvm repository.

  2. Do apt-get update, apt-get upgrade and apt-get dist-upgrade. All should run smooth and put back old versions.

  3. If Varnish is not working, just install it once again. apt-get install varnish. It will start working

  4. If you have trouble with locales (when doing repositories update you will see warning LC_...) just install it again. Then dpkg-reconfigure locale will help you solve this.

If you put back your HHVM repository you should see 5 packages with warnings. Do not put it back till someone will fix the repository. I did not check deeper what other packages could be affected. As an advice, do not update your Debian with HHVM repository active. You can active it, but be careful with warnings.

@ADDISON74

This comment has been minimized.

Copy link

ADDISON74 commented Dec 13, 2014

Also check file content /var/log/apt/history.log. All trouble started with libtirpc1. See how many packages removes!

Start-Date: 2014-12-12 21:08:57
Commandline: apt-get install libtirpc1
Upgrade: libtirpc1:amd64 (0.2.2-5, 0.2.5-1), libc6:amd64 (2.13-38+deb7u6, 2.19-13)
Remove: postgresql-9.1:amd64 (9.1.14-0+deb7u1), varnish:amd64 (3.0.6-1~wheezy), virtualmin-base:amd64 (1.0-36.1), locales:amd64 (2.13-38+deb7u6), postgresql:amd64 (9.1+134wheezy4), libc6-dev:amd64 (2.13-38+deb7u6), task-english:amd64 (3.14.1), libc-dev-bin:amd64 (2.13-38+deb7u6), nfs-common:amd64 (1.2.6-4)
End-Date: 2014-12-12 21:09:22

Start-Date: 2014-12-12 21:09:35
Commandline: apt-get dist-upgrade
Install: gcc-4.9-base:amd64 (4.9.1-19, automatic)
Upgrade: libstdc++6:amd64 (4.7.2-5, 4.9.1-19)
End-Date: 2014-12-12 21:09:37

Start-Date: 2014-12-12 22:05:44
End-Date: 2014-12-12 22:05:44

Start-Date: 2014-12-12 22:06:36
Install: libc6-dev:amd64 (2.13-38+deb7u6), libc-dev-bin:amd64 (2.13-38+deb7u6, automatic)
Downgrade: libstdc++6:amd64 (4.9.1-19, 4.7.2-5), libtirpc1:amd64 (0.2.5-1, 0.2.2-5), libc6:amd64 (2.19-13, 2.13-38+deb7u6)
End-Date: 2014-12-12 22:06:42

Start-Date: 2014-12-12 22:06:51
Commandline: apt-get install varnish
Install: varnish:amd64 (3.0.6-1~wheezy)
End-Date: 2014-12-12 22:06:54

Start-Date: 2014-12-12 22:10:46
Commandline: apt-get dist-upgrade
Upgrade: libstdc++6:amd64 (4.7.2-5, 4.9.1-19), libtirpc1:amd64 (0.2.2-5, 0.2.5-1), libc6:amd64 (2.13-38+deb7u6, 2.19-13)
Remove: varnish:amd64 (3.0.6-1~wheezy), libc6-dev:amd64 (2.13-38+deb7u6), libc-dev-bin:amd64 (2.13-38+deb7u6)
End-Date: 2014-12-12 22:15:24

Start-Date: 2014-12-12 22:16:43
Install: libc6-dev:amd64 (2.13-38+deb7u6), libc-dev-bin:amd64 (2.13-38+deb7u6, automatic)
Downgrade: libstdc++6:amd64 (4.9.1-19, 4.7.2-5), libtirpc1:amd64 (0.2.5-1, 0.2.2-5), libc6:amd64 (2.19-13, 2.13-38+deb7u6)
End-Date: 2014-12-12 22:16:50

Start-Date: 2014-12-12 22:17:03
Commandline: apt-get install varnish
Install: varnish:amd64 (3.0.6-1~wheezy)
End-Date: 2014-12-12 22:17:06

Start-Date: 2014-12-12 22:25:29
Commandline: apt-get install locales
Install: locales:amd64 (2.19-13)
Upgrade: libtirpc1:amd64 (0.2.2-5, 0.2.5-1), libc6:amd64 (2.13-38+deb7u6, 2.19-13)
Remove: varnish:amd64 (3.0.6-1~wheezy), libc6-dev:amd64 (2.13-38+deb7u6), libc-dev-bin:amd64 (2.13-38+deb7u6)
End-Date: 2014-12-12 22:25:52

Start-Date: 2014-12-12 22:30:18
Install: libc6-dev:amd64 (2.13-38+deb7u6), libc-dev-bin:amd64 (2.13-38+deb7u6, automatic)
Downgrade: locales:amd64 (2.19-13, 2.13-38+deb7u4), libtirpc1:amd64 (0.2.5-1, 0.2.2-5), libc6:amd64 (2.19-13, 2.13-38+deb7u6)
End-Date: 2014-12-12 22:30:25

Start-Date: 2014-12-12 22:35:04
Commandline: apt-get install varnish
Install: varnish:amd64 (3.0.6-1~wheezy)
End-Date: 2014-12-12 22:35:07

Start-Date: 2014-12-13 03:04:29
Commandline: apt-get upgrade
Upgrade: locales:amd64 (2.13-38+deb7u4, 2.13-38+deb7u6)
End-Date: 2014-12-13 03:04:35

@ADDISON74

This comment has been minimized.

Copy link

ADDISON74 commented Dec 13, 2014

I managed to put all back checking every removed package using apt-cache policy package-name. There are a few. Before this you have to remove hhvm repository.

@danslo

This comment has been minimized.

Copy link
Contributor

danslo commented Dec 13, 2014

I didn't have time to read all the messages in this thread, but I like to point you guys to a commit that I did earlier to packaging that is probably related. Came across this before with Ubuntu 12.04 and made changes to HHVM so that it's relatively easy to link libstdc++ statically and probably should be done in this case.

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 15, 2014

Came across this before with Ubuntu 12.04 and made changes to HHVM so that it's relatively easy to link libstdc++ statically and probably should be done in this case.

Hm, yeah, at that point we should be able to just install a new gcc from source against the old libc; the new libstdc++ can be linked in statically. That sounds like the most viable approach -- I'll play with it when I get a chance.

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 15, 2014

In the meantime: is it better to leave things as-is or should I pull the libc etc from the wheezy repo?

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 15, 2014

OK, @danslo's suggestion works AFAICT! I will shortly pull libc etc out of our repo, and update the packaging script and docs.

@jwatzman jwatzman closed this in 5280d80 Dec 15, 2014

@jwatzman

This comment has been minimized.

Copy link
Member

jwatzman commented Dec 16, 2014

Putting the build VM back together now. Turns out the option was actually already being specified :-P Next nightly build should have the fix; wheezy is likely uninstallable until then, unless you pull from jessie. It's exceedingly likely there will be a 3.3 and 3.4 point release by the end of the year, so those packages will get the fixed stuff then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment