Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2015 22:10:13 +0800
From:      Ben Woods <woodsb02@gmail.com>
To:        FreeBSD ports <freebsd-ports@freebsd.org>, freebsd-kde@freebsd.org
Subject:   cmake fails if OSVERSION set in /etc/make.conf
Message-ID:  <CAOc73CC9F6DgpeoSFrgH97Lk3BqKuztT4D4uBFfY1Mr9BZnsUg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi everyone,

Yesterday I was having difficulty building a port in a jailed
environment (I am using iocage to create a FreeBSD 10.1 amd64 jail).

After a fair bit of investigation, suspecting either the port or clang
to be at fault due to the error message, I realised that cmake fails
to build a port if OSVERSION is set in /etc/make.conf.

I am confident it is not a problem with the port, as I have seen this
error message in two separate ports (output of trying to build lang/io
and science/InsightToolkit is below).

Why did I have OSVERSION set? I can't remember exactly why, but I must
have been having a problem building ports in the FreeBSD 10.1 jail on
my FreeBSD current host, and would have followed the advice in this
notice in /usr/ports/CHANGES:

20140930:
AUTHOR: bdrewery@FreeBSD.org

 Building ports in a chroot or jail have always required a particular
 environment be setup. This was not clear though and the ports framework
 did not enforce it. These requirements are:
 1. Either a SRC_BASE/sys/sys/param.h, or /usr/include/sys/param.h be
 present with the __FreeBSD_version_ number of the target system,
 or OSVERSION be set in the environment. Lack of these would fallback
 on kern.osreldate before, which is no longer the case.
 2. UNAME_r,UNAME_v,UNAME_s all must be set for the target system.

 Not having these values in sync will now cause the build to error until it is
 resolved.

 Setting these in the environment can be done via your own wrapper scripts,
 or /etc/login.conf (along with cap_mkdb /etc/login.conf) or
 via /etc/make.conf using appropriate values. Note that OSVERSION is redundant
 if a proper param.h is in the environment:

 OSVERSION+=     1100036
 UNAME_ENV+=     OSVERSION=${OSVERSION}
 UNAME_ENV+=     UNAME_s=FreeBSD
 UNAME_ENV+=     UNAME_r=11.0-CURRENT
 UNAME_ENV+=     UNAME_v="${UNAME_s} ${UNAME_r}"
 .MAKEFLAGS:     ${UNAME_ENV}
 MAKE_ENV+=      ${UNAME_ENV}
 CONFIGURE_ENV+= ${UNAME_ENV}
 SCRIPTS_ENV+=   ${UNAME_ENV}


Has anyone else come across this? What are the thoughts?

Regards,
Ben


*** FULL CONTENTS OF /ETC/MAKE.CONF INSIDE JAIL ***
WRKDIRPREFIX=/var/ports
DISTDIR=/var/ports/distfiles
PACKAGES=/var/ports/packages
INDEXDIR=/var/ports
USE_PACKAGE_DEPENDS_ONLY=yes
DEVELOPER=yes
#WITH_DEBUG=yes
OSVERSION+=     1001000
UNAME_ENV+=     OSVERSION=${OSVERSION}
UNAME_ENV+=     UNAME_s=FreeBSD
UNAME_ENV+=     UNAME_r=10.1-RELEASE
UNAME_ENV+=     UNAME_v="${UNAME_s} ${UNAME_r}"
.MAKEFLAGS:     ${UNAME_ENV}
MAKE_ENV+=      ${UNAME_ENV}
CONFIGURE_ENV+= ${UNAME_ENV}
SCRIPTS_ENV+=   ${UNAME_ENV}




*** OUTPUT WHEN TRYING TO BUILD SCIENCE/INSIGHTTOOLKIT ***
root@jail:/usr/ports/science/InsightToolkit # make
===>   InsightToolkit-4.8.0 depends on file: /usr/local/bin/cmake - found
===>  Configuring for InsightToolkit-4.8.0
===>  Performing out-of-source build
/bin/mkdir -p /var/ports/usr/ports/science/InsightToolkit/work/.build
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang 3.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:61
(message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /var/ports/usr/ports/science/InsightToolkit/work/.build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/make" "cmTryCompileExec2149568943/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec2149568943.dir/build.make
  CMakeFiles/cmTryCompileExec2149568943.dir/build

  /usr/local/bin/cmake -E cmake_progress_report
  /var/ports/usr/ports/science/InsightToolkit/work/.build/CMakeFiles/CMakeTmp/CMakeFiles
  1

  Building C object
  CMakeFiles/cmTryCompileExec2149568943.dir/testCCompiler.c.o

  /usr/bin/cc -O2 -pipe -fstack-protector -fno-strict-aliasing -o
  CMakeFiles/cmTryCompileExec2149568943.dir/testCCompiler.c.o -c
  /var/ports/usr/ports/science/InsightToolkit/work/.build/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTryCompileExec2149568943

  /usr/local/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec2149568943.dir/link.txt --verbose=1

  /usr/bin/cc -O2 -pipe -fstack-protector -fno-strict-aliasing
  -fstack-protector
  CMakeFiles/cmTryCompileExec2149568943.dir/testCCompiler.c.o -o
  cmTryCompileExec2149568943



  make[2]: stopped in
  /var/ports/usr/ports/science/InsightToolkit/work/.build/CMakeFiles/CMakeTmp


  make[2]: don't know how to make 1001000.  Stop





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (project)


-- Configuring incomplete, errors occurred!
See also "/var/ports/usr/ports/science/InsightToolkit/work/.build/CMakeFiles/CMakeOutput.log".
See also "/var/ports/usr/ports/science/InsightToolkit/work/.build/CMakeFiles/CMakeError.log".
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/science/InsightToolkit
*** Error code 1

Stop.
make: stopped in /usr/ports/science/InsightToolkit




*** OUTPUT WHEN TRYING TO BUILD LANG/IO ***
root@jail:/usr/ports/lang/io # make
===>   io-2013.12.04_3 depends on file: /usr/local/bin/cmake - found
===>   io-2013.12.04_3 depends on executable: gcc48 - found
===>   io-2013.12.04_3 depends on file: /usr/local/bin/as - found
===>  Configuring for io-2013.12.04_3
===>  Performing out-of-source build
/bin/mkdir -p /var/ports/usr/ports/lang/io/work/.build
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/local/bin/gcc48
-- Check for working C compiler: /usr/local/bin/gcc48 -- broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:61
(message):
  The C compiler "/usr/local/bin/gcc48" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /var/ports/usr/ports/lang/io/work/.build/CMakeFiles/CMakeTmp



  Run Build Command:"/usr/bin/make" "cmTryCompileExec2060595359/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec2060595359.dir/build.make
  CMakeFiles/cmTryCompileExec2060595359.dir/build

  /usr/local/bin/cmake -E cmake_progress_report
  /var/ports/usr/ports/lang/io/work/.build/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object
  CMakeFiles/cmTryCompileExec2060595359.dir/testCCompiler.c.o

  /usr/local/bin/gcc48 -O2 -pipe -fstack-protector
  -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing -o
  CMakeFiles/cmTryCompileExec2060595359.dir/testCCompiler.c.o -c
  /var/ports/usr/ports/lang/io/work/.build/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTryCompileExec2060595359

  /usr/local/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec2060595359.dir/link.txt --verbose=1

  /usr/local/bin/gcc48 -O2 -pipe -fstack-protector
  -Wl,-rpath=/usr/local/lib/gcc48 -fno-strict-aliasing
  CMakeFiles/cmTryCompileExec2060595359.dir/testCCompiler.c.o -o
  cmTryCompileExec2060595359

  make[2]: don't know how to make 1001000.  Stop



  make[2]: stopped in
  /var/ports/usr/ports/lang/io/work/.build/CMakeFiles/CMakeTmp





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:29 (project)


-- Configuring incomplete, errors occurred!
See also "/var/ports/usr/ports/lang/io/work/.build/CMakeFiles/CMakeOutput.log".
See also "/var/ports/usr/ports/lang/io/work/.build/CMakeFiles/CMakeError.log".
*** Error code 1

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

Stop.
make: stopped in /usr/ports/lang/io



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOc73CC9F6DgpeoSFrgH97Lk3BqKuztT4D4uBFfY1Mr9BZnsUg>