Skip to content

build-script: support CMake install steps. #25184

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
Jul 11, 2019

Conversation

adrian-prantl
Copy link
Contributor

Currently, bots that perfrom an installation will build LLDB once using CMake
because that is the default and then again using Xcode because the CMake
install step is not implemented by build-script. This patch adds CMake support
by calling the generic cmake install-lldb step.

rdar://problem/51317901

Currently, bots that perfrom an installation will build LLDB once using CMake
because that is the default and then again using Xcode because the CMake
install step is not implemented by build-script. This patch adds CMake support
by calling the generic cmake install-lldb step.

<rdar://problem/51317901>
@adrian-prantl
Copy link
Contributor Author

@swift-ci test package

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@shahmishal
Copy link
Member

We should also pull this into swift-5.1-branch

@swift-ci
Copy link
Contributor

swift-ci commented Jun 1, 2019

Build failed
Swift Test Linux Platform
Git Sha - 78218b0

@swift-ci
Copy link
Contributor

swift-ci commented Jun 1, 2019

Build failed
Swift Test OS X Platform
Git Sha - 78218b0

case ${host} in
linux-*)
if [[ "$using_xcodebuild" == "TRUE" ]] ; then
case ${host} in
Copy link
Member

Choose a reason for hiding this comment

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

I think that it will be easier to read this as:

if [[ ${host} == macosx-* ]] ; then
  set_lldb_xcodebuild_options
  set_lldb_build_mode
  with_pushd ...
  continue
fi

At that point, you can even collapse the conditions into:

if [[ ${host} == macosx-* && ${using_xcodebuild} == TRUE ]] ; then

esac
esac
else
INSTALL_TARGETS="install-lldb"
Copy link
Member

Choose a reason for hiding this comment

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

I assume you tested cmake install-lldb? If it works, then let's do this. My upstreaming progress is slow, but I can check this in more detail soon.

@weliveindetail
Copy link
Member

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Jun 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 78218b0

@weliveindetail
Copy link
Member

/tmp/TemporaryDirectory.ZWG8vT/pkg/Package.swift:3:5: error: type annotation missing in pattern

@weliveindetail
Copy link
Member

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Jun 4, 2019

Build failed
Swift Test Linux Platform
Git Sha - 78218b0

@dcci
Copy link
Member

dcci commented Jul 8, 2019

Since Adrian is out, and this is causing problems on the bots, I'll pick this up (cc: @shahmishal)

@dcci
Copy link
Member

dcci commented Jul 8, 2019

Of course the log is too old and it's gone. Let's try to run this again and see why it fails.

@dcci
Copy link
Member

dcci commented Jul 8, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 9, 2019

Build failed
Swift Test OS X Platform
Git Sha - 78218b0

@swift-ci
Copy link
Contributor

swift-ci commented Jul 9, 2019

Build failed
Swift Test Linux Platform
Git Sha - 78218b0

@dcci
Copy link
Member

dcci commented Jul 9, 2019

@swift-ci test

@dcci
Copy link
Member

dcci commented Jul 9, 2019

Trying again now that Andy merged his PR.

@swift-ci
Copy link
Contributor

swift-ci commented Jul 9, 2019

Build failed
Swift Test Linux Platform
Git Sha - 78218b0

@dcci
Copy link
Member

dcci commented Jul 9, 2019

21:12:33 Running Swift tests for: check-swift-all-linux-x86_64 check-swift-all-optimize-linux-x86_64
21:12:33 /home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/swift/utils/build-script: fatal error: command terminated with a non-zero exit status 2, aborting
21:12:33 /home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

I'll try to reproduce on a linux machine.

@dcci
Copy link
Member

dcci commented Jul 9, 2019

This is the real issue

06:10:01 2019-07-09 04:10:01.765 SourceKitLSPPackageTests.xctest[2773:38ff9700] manifest parse error(s):
06:10:01 
/home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/tmp/TemporaryDirectory.QLRGsf/pkg/Package.swift:3:5: error: type annotation missing in pattern
06:10:01 let pack
06:10:01     ^

@aciidb0mb3r / @benlangmuir / @akyrtzi

is this something you're aware of?

@benlangmuir
Copy link
Contributor

This is not a build failure. It's just output from a test in sourcekit-lsp that gets mistakenly picked up by the regexes in Jenkins. You can see below that the test passed.

@benlangmuir
Copy link
Contributor

here's the actual failure, which is much later during package testing:

swift-integration-tests/lit.cfg:205: fatal: repl_swift does not exist!

@weliveindetail
Copy link
Member

This is not a build failure. It's just output from a test in sourcekit-lsp that gets mistakenly picked up by the regexes in Jenkins. You can see below that the test passed.

Hey Ben, thanks for taking a look.

here's the actual failure, which is much later during package testing:

swift-integration-tests/lit.cfg:205: fatal: repl_swift does not exist!

Interesting. I will have a look.

@weliveindetail
Copy link
Member

repl_swift gets built but not installed, because it runs install-lldb instead of install:

--- Installing lldb ---
06:07:20 + env DESTDIR=/home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/swift-nightly-install/ /usr/bin/cmake --build /home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/lldb-linux-x86_64 -- install-lldb
06:07:20 [1/2][ 50%][0.032s] Python script sym-linking LLDB Python API
06:07:20 [1/2][ 50%][0.032s] cd /home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/lldb-linux-x86_64/tools/driver && /usr/bin/cmake -DCMAKE_INSTALL_COMPONENT="lldb" -P /home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/buildbot_linux/lldb-linux-x86_64/cmake_install.cmake
06:07:20 -- Install configuration: "Release"
06:07:20 -- Installing: /home/buildnode/jenkins/workspace/swift-PR-Linux@2/branch-master/swift-nightly-install/usr/bin/lldb
06:07:20 

@weliveindetail
Copy link
Member

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 78218b0

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 78218b0

@weliveindetail
Copy link
Member

@swift-ci test package

@weliveindetail
Copy link
Member

With my change the PR tests succeed, but the results are.. strange.

--install-lldb is still passed to build-script, but the log doesn't show any attempt to install lldb (the stage that was missing to install repl_swift before). The only thing that gets installed is libdispatch (on the Linux bot). Is that expected behavior?

The SourceKitLSPPackageTests that printed the pseudo-error type annotation missing in pattern before is not in the logs either. Is that expected behavior?

Apparently, test package doesn't do anything.

@dcci @benlangmuir What do you think?

Well, at least the goal of the PR is accomplished: LLDB doesn't build twice anymore :)

@@ -3555,8 +3555,6 @@ for host in "${ALL_HOSTS[@]}"; do
continue
;;
esac
else
INSTALL_TARGETS="install-lldb"
Copy link
Member

Choose a reason for hiding this comment

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

build-script is fairly complex so I'm probably missing something here, but ... your review just removes an install target? Where do we actually perform the installation for CMake?

Copy link
Member

Choose a reason for hiding this comment

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

IIUC INSTALL_TARGETS collects a list of targets that will be installed (don't ask me where). It's is initialized with install here: https://github.com/apple/swift/blob/2fa436e53e/utils/build-script-impl#L3491 This should be fine for LLDB.

Copy link
Member

Choose a reason for hiding this comment

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

We could go for install-distribution with apple/swift-lldb#1785

@benlangmuir
Copy link
Contributor

The SourceKitLSPPackageTests that printed the pseudo-error type annotation missing in pattern before is not in the logs either. Is that expected behavior?

Maybe you were looking only at the tail of the log instead of the full log? I see it in the logs from your PR tests.

@weliveindetail
Copy link
Member

The SourceKitLSPPackageTests that printed the pseudo-error type annotation missing in pattern before is not in the logs either. Is that expected behavior?

Maybe you were looking only at the tail of the log instead of the full log? I see it in the logs from your PR tests.

Erm no, but I only checked the macOS one. The Linux PR test is actually correct.

@benlangmuir
Copy link
Contributor

testUnparsablePackage ran and passed on both macOS and Linux. Maybe the macOS xctest is hiding the output from the passing test while the linux one isn't. Anyway, looks fine.

@weliveindetail weliveindetail merged commit dafd027 into swiftlang:master Jul 11, 2019
@shahmishal
Copy link
Member

@swift-ci build toolchain will build the toolchain.

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.

7 participants