Skip to content

[CMake] Fix status message when not building stdlib/runtime #12205

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

Merged
merged 2 commits into from
Oct 2, 2017
Merged

[CMake] Fix status message when not building stdlib/runtime #12205

merged 2 commits into from
Oct 2, 2017

Conversation

mnvr
Copy link
Contributor

@mnvr mnvr commented Oct 1, 2017

Fixes: SR-5817

Swift CMake prints "Building Swift standard library and SDK
overlays" and "Building Swift runtime", even when those are not
being built

Test Cases:

These depend on the path on the particular machine, so including these
inline instead of adding them somewhere to the source tree.

  • Reproduction of Issue ("Should not Print"):
    export SWFT=~/Desktop/Swift
    mkdir /tmp/swift-build
    cd /tmp/swift-build

    cmake \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE=Release \
        -DSWIFT_PATH_TO_LLVM_SOURCE=$SWFT/llvm \
        -DSWIFT_PATH_TO_LLVM_BUILD=$SWFT/build/llvm \
        -DSWIFT_PATH_TO_CMARK_SOURCE=$SWFT/cmark \
        -DSWIFT_PATH_TO_CMARK_BUILD=$SWFT/build/cmark \
        -DSWIFT_BUILD_REMOTE_MIRROR=FALSE \
        -DSWIFT_BUILD_DYNAMIC_STDLIB=FALSE \
        -DSWIFT_BUILD_STATIC_STDLIB=FALSE \
        -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE \
        -DSWIFT_BUILD_STATIC_SDK_OVERLAY=FALSE \
        $SWFT/swift
  • Verification of Fix ("Should Print"):
    cmake \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE=Release \
        -DSWIFT_PATH_TO_LLVM_SOURCE=$SWFT/llvm \
        -DSWIFT_PATH_TO_LLVM_BUILD=$SWFT/build/llvm \
        -DSWIFT_PATH_TO_CMARK_SOURCE=$SWFT/cmark \
        -DSWIFT_PATH_TO_CMARK_BUILD=$SWFT/build/cmark \
        -DSWIFT_BUILD_REMOTE_MIRROR=FALSE \
        $SWFT/swift

Reported-by: Brian Ivan Gesiak (@modocache)

@gottesmm
Copy link
Contributor

gottesmm commented Oct 1, 2017

@mnvr Rather than just not printing anything, can you instead print out a message saying that we are not building them?

Fixes: SR-5817

    Swift CMake prints "Building Swift standard library and SDK
    overlays" and "Building Swift runtime", even when those are *not*
    being built

    https://bugs.swift.org/browse/SR-5817

Test Cases:

- Reproduction of Issue ("Should not Print"):

    export SWFT=~/Desktop/Swift
    mkdir /tmp/swift-build
    cd /tmp/swift-build

    cmake \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE=Release \
        -DSWIFT_PATH_TO_LLVM_SOURCE=$SWFT/llvm \
        -DSWIFT_PATH_TO_LLVM_BUILD=$SWFT/build/llvm \
        -DSWIFT_PATH_TO_CMARK_SOURCE=$SWFT/cmark \
        -DSWIFT_PATH_TO_CMARK_BUILD=$SWFT/build/cmark \
        -DSWIFT_BUILD_REMOTE_MIRROR=FALSE \
        -DSWIFT_BUILD_DYNAMIC_STDLIB=FALSE \
        -DSWIFT_BUILD_STATIC_STDLIB=FALSE \
        -DSWIFT_BUILD_DYNAMIC_SDK_OVERLAY=FALSE \
        -DSWIFT_BUILD_STATIC_SDK_OVERLAY=FALSE \
        $SWFT/swift

- Verification of Fix ("Should Print"):

    cmake \
        -G 'Unix Makefiles' \
        -DCMAKE_BUILD_TYPE=Release \
        -DSWIFT_PATH_TO_LLVM_SOURCE=$SWFT/llvm \
        -DSWIFT_PATH_TO_LLVM_BUILD=$SWFT/build/llvm \
        -DSWIFT_PATH_TO_CMARK_SOURCE=$SWFT/cmark \
        -DSWIFT_PATH_TO_CMARK_BUILD=$SWFT/build/cmark \
        -DSWIFT_BUILD_REMOTE_MIRROR=FALSE \
        $SWFT/swift

Reported-by: Brian Ivan Gesiak
@mnvr
Copy link
Contributor Author

mnvr commented Oct 2, 2017

@mnvr Rather than just not printing anything, can you instead print out a message saying that we are not building them?

Updated.

CMakeLists.txt Outdated
message(STATUS "Building Swift runtime with:")
message(STATUS " Leak Detection Checker Entrypoints: ${SWIFT_RUNTIME_ENABLE_LEAK_CHECKER}")
message(STATUS "")
message(STATUS "Building Swift standard library and SDK overlays for SDKs: ${SWIFT_SDKS}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by comment: while we're here, can we fix this redundant redundancy? Either "overlays for SDKs" or "SDK overlays"; no need for "SDK overlays for SDKs".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

CMakeLists.txt Outdated

else()

message(STATUS "Not building Swift standard library and runtime")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not building Swift standard library, SDK overlays, or runtime, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd thought about saying that when I was first writing it out, but lazed out at the last minute, thinking it would be a "duh". Apparently not.

Also, I was wondering if you folks preferred an Oxford comma or not. Luckily, your comment itself made it easy for me to figure that one out :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't a purposeful Oxford comma; I'm not sure that there's an answer to that :) Core team will weigh in here if they feel strongly.

@gottesmm
Copy link
Contributor

gottesmm commented Oct 2, 2017

LGTM. I think we could wordsmith some more, but I think we at least get clarity here.

@gottesmm
Copy link
Contributor

gottesmm commented Oct 2, 2017

@swift-ci smoke test and merge

1 similar comment
@gottesmm
Copy link
Contributor

gottesmm commented Oct 2, 2017

@swift-ci smoke test and merge

@swift-ci swift-ci merged commit 9f92034 into swiftlang:master Oct 2, 2017
@mnvr mnvr deleted the SR-5817 branch October 3, 2017 00:02
@mnvr
Copy link
Contributor Author

mnvr commented Oct 3, 2017

I think we could wordsmith some more...

I'm curious - which parts do you think can be improved. If I know of them, I could perhaps make those changes in some subsequent PR which touches CMakeLists.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants