Apache log4cxx 0.12.0 cmake scripts fail during test configuration

197 Views Asked by At

Version: apache-log4cxx-0.12.0.tar.gz

Configuration:

mkdir build; cd build && cmake -DBUILD_SHARED_LIBS=off -DAPR_STATIC=yes -DAPU_STATIC=yes ..

Symptoms (log snippet):

32882          error: downloading 'https://www-us.apache.org/dist/logging/log4j/1.2.17/log4j-1.2.17.tar.gz' failed
32883          status_code: 6
32884          status_string: "Couldn't resolve host name"
32885          log:
32886          --- LOG BEGIN ---

This was building just last month. I can't 100% attest to the fact that the build procedure has not changed (since it was done manually) but I don't believe it was significantly different.

1

There are 1 best solutions below

0
SunSplat On

At first, I thought my DNS resolver was just out of date, but after some dig-ing and fiddling with /etc/resolv.conf, it has become apparent that the www-us.apache.org url log4cxx was using to get the tarball from has disappeared from the face of the earth.

Two methods you can use to fix this (which I wish someone had posted before me).

First

Hack your /etc/hosts file to spoof www-us.apache.org to actually go to www.apache.org (where you will find a redirect for the link). To give neophytes an idea of what I'm talking about, here is kinda how I did it on Debian.

sudo echo '151.101.2.132 www-us.apache.org' >> /etc/hosts

Second

Fix the cmake script src/test/java/CMakeLists.txt line 3 to point to the right link. The broken one is

https://www-us.apache.org/dist/logging/log4j/1.2.17/log4j-1.2.17.tar.gz

The right one is

https://downloads.apache.org/logging/log4j/1.2.17/log4j-1.2.17.tar.gz

Digging around the GitHub account we found this code merged and (I assume) ready to go out with the next release, whenever that is.

https://github.com/apache/logging-log4cxx/commit/341a23aa0d13278c8ae85b6017d49de9790f00fe

Here's hoping this helps someone not remain stuck, expecting the build to work like it did a month ago.