Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
base: 7e1c85c5fbf4
Choose a base ref
...
head repository: NixOS/nix
compare: 7d6ba1dc90ec
Choose a head ref
  • 14 commits
  • 13 files changed
  • 3 contributors

Commits on Jul 3, 2019

  1. autoconf: Change quotes in description.

    The unbalanced single-quotes cause many editor syntax highlighters
    to interpret the rest of the file as a string literal, making it easier
    to make syntax mistakes in absence of proper highlighting.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    96cd3d6 View commit details
    Browse the repository at this point in the history
  2. autoconf: Detect boost, require version, set CXXFLAGS.

    This turns previous compiler errors complaining about missing files
    into proper ./configure time errors telling the user which version
    of boost is required.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    00a4500 View commit details
    Browse the repository at this point in the history
  3. autoconf: Work around editline not being found on Ubuntu 16.04.

    And probably other Linux distributions with long-term support releases.
    
    Also update manual stating what version is needed;
    I checked that 1.14 is the oldest version with which current nix compiles,
    and added autoconf feature checks for some functions added in that release
    that nix uses.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    1f97b16 View commit details
    Browse the repository at this point in the history
  4. autoconf: Fix C++17 detection not working on Ubuntu 16.04.

    And probably many other distributions.
    
    Until now, ./configure would fail silently printing a warning
    
        ./configure: line 4621: AX_CXX_COMPILE_STDCXX_17: command not found
    
    and then continuing, later failing with a C++ #error saying that some C++11
    feature isn't supported (it didn't even get to the C++17 features).
    
    This is because older distributions don't come with the
    `AX_CXX_COMPILE_STDCXX_17` m4 macro.
    
    This commit vendors that macro accordingly.
    
    Now ./configure complains correctly:
    
        configure: error: *** A compiler with support for C++17 language features is required.
    
    On Ubuntu 16.04, ./configure completes if a newer compiler is used, e.g. with
    gcc-7 from https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
    using:
    
        ./bootstrap.sh
        ./configure CXX=g++-7 --disable-doc-gen --with-boost=$(nix-build --no-link '<nixpkgs>' -A boost.dev)
    nh2 committed Jul 3, 2019
    Copy the full SHA
    57daa86 View commit details
    Browse the repository at this point in the history
  5. mk: add support for passing LDFLAGS to libs and bins

    autotools-based systems usually allow user to
    append own LDFLAGS like
        LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
    at ./configure stage
    
    This change plumbs LDFLAGS through similar to existing CXXFLAGS variable.
    
    Signed-off-by: Sergei Trofimovich <siarheit@google.com>
    trofi authored and nh2 committed Jul 3, 2019
    Copy the full SHA
    fe068ec View commit details
    Browse the repository at this point in the history
  6. autoconf: Fix AC_STRUCT_DIRENT_D_TYPE being used before AC_PROG_CC.

    That was incorrect, because checking the dirent type already requires
    a working compiler.
    
    It had the effect that setting e.g. `: ${CFLAGS=""}` before `AC_PROG_CC`
    as per `AC_PROG_CC`'s documentation would have no effect, because
    `AC_STRUCT_DIRENT_D_TYPE` would automatically set CFLASGS.
    
    (In a followup commit `: ${CFLAGS=""}` will be used, so it's important
    to get this working first.)
    nh2 committed Jul 3, 2019
    Copy the full SHA
    20129bd View commit details
    Browse the repository at this point in the history
  7. autoconf: Allow overriding CFLAGS/CXXFLAGS from outside.

    As is normal for autoconf-based projects.
    
    For example, it is a common use case to do
    
        ./configure CXXFLAGS=-O0
    
    This did not work for nix until now, because the `CXXFLAGS=` declaration
    would unconditionally erase what the user had specified.
    
    The custom `OPTIMIZE` flag is removed, but the default `-O3` is retained;
    autoconf would default to `-g -O2` by default otherwise as documented on:
    
    https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C-Compiler.html
    https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/C_002b_002b-Compiler.html
    nh2 committed Jul 3, 2019
    Copy the full SHA
    717e821 View commit details
    Browse the repository at this point in the history
  8. Makefile.config.in: Remove HAVE_READLINE.

    It was forgotten to be removed with
    commit c5f23f1
    and so it until now stayed unsubstituted as `HAVE_READLINE = @HAVE_READLINE@`
    in Makefile.config.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    b49c3a9 View commit details
    Browse the repository at this point in the history
  9. Fix C++ compatibility with older editline versions.

    For example, Ubuntu 16.04 and many similar long-term-support distros
    have older versions.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    d203c55 View commit details
    Browse the repository at this point in the history
  10. Get BOOST_LDFLAGS from autoconf, fix Ubuntu 16.04 build.

    Our use of boost::coroutine2 depends on -lboost_context,
    which in turn depends on `-lboost_thread`, which in turn depends
    on `-lboost_system`.
    
    I suspect that this builds on nix only because of low-level hacks
    like NIX_LDFLAGS.
    
    This commit passes the proper linker flags, thus fixing bootstrap
    builds on non-nix distributions like Ubuntu 16.04.
    
    With these changes, I can build Nix on Ubuntu 16.04 using:
    
        ./bootstrap.sh
        ./configure --prefix=$HOME/editline-prefix \
          --disable-doc-gen \
          CXX=g++-7 \
          --with-boost=$HOME/boost-prefix \
          EDITLINE_CFLAGS=-I$HOME/editline-prefix/include \
          EDITLINE_LIBS=-leditline \
          LDFLAGS=-L$HOME/editline-prefix/lib
        make
    
    where
    
    * g++-7 comes from gcc-7 from
      https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test,
    * editline 1.14 from https://github.com/troglobit/editline/releases/tag/1.14.0
    	was installed into `$HOME/editline-prefix`
      (because Ubuntu 16.04's `editline` is too old to have the function nix uses),
    * boost 1.66 from
    	https://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html
    	was installed into $HOME/boost-prefix (because Ubuntu 16.04 only has 1.58)
    nh2 committed Jul 3, 2019
    Copy the full SHA
    a96006d View commit details
    Browse the repository at this point in the history
  11. autoconf: Check if --nonet works. Fixes #967 #506.

    Also give a helpful error message on what package the user likely
    has to install to make it work.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    c3db9e6 View commit details
    Browse the repository at this point in the history
  12. autoconf: Add comment on use of false.

    This is to avoid confusion as in commit
    a0d2904.
    nh2 committed Jul 3, 2019
    Copy the full SHA
    cd8bc06 View commit details
    Browse the repository at this point in the history
  13. autoconf: Implement release tarball detection. Fixes #257.

    This should finally allow us to address all cases of build errors due to
    differences between release tarballs and building from git.
    
    See also #506 (comment)
    nh2 committed Jul 3, 2019
    Copy the full SHA
    82b7f0e View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    7d6ba1d View commit details
    Browse the repository at this point in the history