Navigation Menu

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-6132] Dispatch fails to build when Ninja is not installed #671

Closed
alblue opened this issue Oct 12, 2017 · 5 comments
Closed

[SR-6132] Dispatch fails to build when Ninja is not installed #671

alblue opened this issue Oct 12, 2017 · 5 comments
Assignees

Comments

@alblue
Copy link

alblue commented Oct 12, 2017

Previous ID SR-6132
Radar None
Original Reporter @alblue
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s libdispatch
Labels Bug
Assignee @compnerd
Priority Medium

md5: 5316249dfb91c3e406967036ecf9f866

Issue Description:

From a local Swift instance running on Ubuntu 16:04 but without Ninja installed:

[772/847] Performing configure step for 'libdispatch'
FAILED: tools/SourceKit/libdispatch-prefix/src/libdispatch-stamp/libdispatch-configure
cd /swift-source/build/Ninja-ReleaseAssert/libdispatch-linux-x86_64 && /usr/bin/cmake -DCMAKE_C_COMPILER=/swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/clang -DCMAKE_CXX_COMPILER=/swift-source/build/Ninja-ReleaseAssert/llvm-linux-x86_64/bin/clang++ -DCMAKE_SWIFT_COMPILER=/swift-source/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc -DCMAKE_INSTALL_PREFIX=/swift-source/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix -DENABLE_SWIFT=YES -GNinja /swift-source/swift-corelibs-libdispatch && /usr/bin/cmake -E touch /swift-source/build/Ninja-ReleaseAssert/swift-linux-x86_64/tools/SourceKit/libdispatch-prefix/src/libdispatch-stamp/libdispatch-configure
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.

Although we've built Ninja by this point, there is no Ninja on the PATH that can be executed.

@alblue
Copy link
Author

alblue commented Oct 12, 2017

Docker file for reproduction:

FROM ubuntu:16.04

RUN mkdir /swift-source
RUN apt-get update && apt-get install -y git cmake clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev autoconf libtool systemtap-sdt-dev libbsd-dev libunwind-dev zlib1g-dev
RUN git clone https://github.com/apple/swift.git swift-source/swift
RUN /swift-source/swift/utils/update-checkout --clone
CMD /bin/bash

After running, execute /swift-source/swift/utils/update-checkout --clone to get up-to-date, and then /swift-source/swift/utils/build-script -R

@alblue
Copy link
Author

alblue commented Oct 12, 2017

As a workaround, it is possible to symlink /usr/bin/ninja -> /swift-source/build/Ninja-ReleaseAssert/ninja-build/ninja, which will then subsequently find the build tool. But it should be passed through the ninja-bin argument for dependent builds.

@alblue
Copy link
Author

alblue commented Oct 12, 2017

The swift_build_support/cmake.py file has the following:

if args.build_ninja and args.cmake_generator == 'Ninja':
define('CMAKE_MAKE_PROGRAM', toolchain.ninja)
elif args.cmake_generator == 'Ninja' and toolchain.ninja is not None:
define('CMAKE_MAKE_PROGRAM', toolchain.ninja)

It looks like this isn't being passed down to whatever process gets kicked off for the libdispatch configure.

@compnerd
Copy link
Collaborator

I think that PR#12400 should help with that.

@alblue
Copy link
Author

alblue commented Oct 12, 2017

Looks like apple/swift#12400 solves the problem, will close when it's merged. Thanks for the quick turnaround!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants