Skip to content

[SR-58] Problem building using bootstrapped ninja #42680

Open

Description

@swift-ci
Previous ID SR-58
Radar None
Original Reporter dowobeha (JIRA User)
Type Bug
Environment

Scientific Linux 7.1

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, BuildScript, Linux
Assignee smikes (JIRA)
Priority Medium

md5: d176f61f71c26cf8b306c2e254f2e055

Issue Description:

Failure to build when using a bootstrapped ninja.

Steps to reproduce:

  • On Scientific Linux 7.1, install llvm, llvm-devel, clang, and cmake (version 2.8.11)

  • Create new directory for swift repos, and in that directory, clone all swift-related repos from github, as per README.md in the swift repo

  • In that same new directory, also clone ninja

  • Run ./swift/utils/build-script

See also swift-users mailing list thread titled "Bootstrapping ninja and building from source" started on Fri, 4 Dec 2015.

Results of running ./swift/utils/build-script:

which: no ninja in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/lanes/.local/bin:/home/lanes/bin)
Building the standard library for: swift-stdlib-linux-x86_64
Running Swift tests for: check-swift-linux-x86_64

  • rm -rf /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
  • cp -r /home/lanes/swift/ninja /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
    ++ uname -s
  • [[ Linux == \D\a\r\w\i\n ]]
  • cd /home/lanes/swift/build/Ninja-DebugAssert/ninja-build
  • python ./configure.py --bootstrap
    bootstrapping ninja...
    warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build.
    wrote build.ninja.
    bootstrap complete. rebuilding...
    [24/24] LINK ninja
    cmark: using standard linker
  • cd /home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64
  • /usr/bin/cmake -G Ninja -DCMAKE_C_COMPILER:PATH=clang -DCMAKE_CXX_COMPILER:PATH=clang++ -DCMAKE_BUILD_TYPE:STRING=Debug /home/lanes/swift/cmark
    CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_C_COMPILER_ENV_VAR
    CMake Error: Could not find cmake module file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCCompiler.cmake
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER_ENV_VAR
    CMake Error: Could not find cmake module file:/home/lanes/swift/build/Ninja-DebugAssert/cmark-linux-x86_64/CMakeFiles/2.8.11/CMakeCXXCompiler.cmake
    • Configuring incomplete, errors occurred!
      ./swift/utils/build-script: command terminated with a non-zero exit status 1, aborting

Activity

  1. swift-ci commented on Jan 8, 2016

    @swift-ci
    ContributorAuthor

    Comment by Sam Mikes (JIRA)

    Similar issue with bootstrapped ninja on OEL6.5

  2. swift-ci commented on Jan 11, 2016

    @swift-ci
    ContributorAuthor

    Comment by Sam Mikes (JIRA)

    Candidate fix: #937

  3. swift-ci commented on Jan 11, 2016

    @swift-ci
    ContributorAuthor

    Comment by Lane Schwartz (JIRA)

    Adding this note (from my emails to the Swift list in December):

    I can confirm that using newer versions of cmake >= 2.8.12.2 fix this problem. I'm now getting other problems, which I'll post in a separate thread. The strange thing is that llvm/CMakeLists.txt contains the line cmake_minimum_required(VERSION 2.8.12.2), so when I ran with cmake 2.8.11 I would have expected cmake to die at that point with an error message saying I had too old of a version, but it didn't.

  4. swift-ci commented on Jan 11, 2016

    @swift-ci
    ContributorAuthor

    Comment by Sam Mikes (JIRA)

    I think there are two separate failures here.

    The project "cmark" has cmake_minimum_required(VERSION 2.8.9) so will try to build even with an older cmake. This should probably be changed, as it is the first project that is built, and subsequent projects require 2.8.12.2 (I will open a separate PR to deal with this).

    Separately, the bootstrapped ninja was is not available to CMake (even 2.8.12.2) because the CMakeCache.txt caches the failure to find the ninja program. I suspect that when you updated CMake and the cache was re-generated, cmake was then able to find the ninja program, working around the problem and making it appear that CMake 2.8.12.2 is able to handle the bootstrapping.

    On my test system (OEL 6.5 with CMake 2.8.12.2 installed via rpm), with no `ninja` installed at system level, and without the patch, I cannot do a clean build from an empty "build" directory.

  5. Dante-Broggi commented on Sep 20, 2018

    @Dante-Broggi
    Contributor

    Is this resolved, or no longer valid? If either, this should be closed.

  6. swift-ci commented on Sep 21, 2018

    @swift-ci
    ContributorAuthor

    Comment by Sam Mikes (JIRA)

    I haven't been working with Swift in the last few years. OK by me to close, looks like the original reporter dowobeha (JIRA User) also has a fix/workaround.

  7. swift-ci commented on Sep 21, 2018

    @swift-ci
    ContributorAuthor

    Comment by Lane Schwartz (JIRA)

    I haven't tried reproducing this lately, but I assume it is still a problem.

  8. added
    utilsArea: the build system and other accessory scripts under the "utils" directory
    on Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    LinuxPlatform: LinuxbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.build-scriptArea → utils: The build scriptcompilerThe Swift compiler itselfutilsArea: the build system and other accessory scripts under the "utils" directory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions