Skip to content
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

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

Open
swift-ci opened this issue Dec 4, 2015 · 7 comments
Open

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

swift-ci opened this issue Dec 4, 2015 · 7 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build-script Area → utils: The build script compiler The Swift compiler itself Linux Platform: Linux utils Area: the build system and other accessory scripts under the "utils" directory

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Dec 4, 2015

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
@swift-ci
Copy link
Contributor Author

swift-ci commented Jan 8, 2016

Comment by Sam Mikes (JIRA)

Similar issue with bootstrapped ninja on OEL6.5

@swift-ci
Copy link
Contributor Author

Comment by Sam Mikes (JIRA)

Candidate fix: #937

@swift-ci
Copy link
Contributor Author

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.

@swift-ci
Copy link
Contributor Author

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.

@Dante-Broggi
Copy link
Contributor

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

@swift-ci
Copy link
Contributor Author

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.

@swift-ci
Copy link
Contributor Author

Comment by Lane Schwartz (JIRA)

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

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the utils Area: the build system and other accessory scripts under the "utils" directory label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. build-script Area → utils: The build script compiler The Swift compiler itself Linux Platform: Linux utils Area: the build system and other accessory scripts under the "utils" directory
Projects
None yet
Development

No branches or pull requests

3 participants