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-2754] Major compile time regression on SwiftPM #45358

Closed
ddunbar opened this issue Sep 24, 2016 · 11 comments
Closed

[SR-2754] Major compile time regression on SwiftPM #45358

ddunbar opened this issue Sep 24, 2016 · 11 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@ddunbar
Copy link
Member

ddunbar commented Sep 24, 2016

Previous ID SR-2754
Radar rdar://problem/28467349
Original Reporter @ddunbar
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @adrian-prantl
Priority Medium

md5: f8e18075f609e77dda58fee9b4065621

Issue Description:

Swift TOT is currently taking minutes to build one of the basic modules in SwiftPM. This is a major regression versus a couple days ago, but I'm not sure exactly when this started.

@rudkx
Copy link
Member

rudkx commented Sep 24, 2016

What's your build-script invocation?

@ddunbar
Copy link
Member Author

ddunbar commented Sep 24, 2016

~/public/swift-project/swift/utils/build-script -R --llbuild --swiftpm

@rudkx
Copy link
Member

rudkx commented Sep 25, 2016

It looks like virtually all the time (94%) is spent on the LLVM side of things.

@ddunbar
Copy link
Member Author

ddunbar commented Sep 25, 2016

Oh dear.

@swift-ci
Copy link
Collaborator

Comment by W S (JIRA)

Hi,
Are there any more details about when in the build process the memory issue is happening?
I think I'm running into it on my EC2 instance, swiftpm build failing:
Linking /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/libPackageDescription.so
:0: error: unable to execute command: Killed
:0: error: compile command failed due to signal (use -v to see invocation)
:0: error: build had 1 command failures
error: exit(1): /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/swift-build-tool -f /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug.yaml test

Running that swift-build-tool command directly, however, ate up all the memory and killed the instance:
/home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/swift-build-tool -f /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug.yaml test

swiftpm: using gold linker

  • /home/ec2-user/swift/swiftpm/Utilities/bootstrap --swiftc=/home/ec2-user/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc --sbt=/home/ec2-user/swift/build/Ninja-ReleaseAssert/llbuild-linux-x86_64/bin/swift-build-tool --build=/home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64 --foundation=/home/ec2-user/swift/build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation --libdispatch-source-dir=/home/ec2-user/swift/swift-corelibs-libdispatch --libdispatch-build-dir=/home/ec2-user/swift/build/Ninja-ReleaseAssert/libdispatch-linux-x86_64 --xctest=/home/ec2-user/swift/build/Ninja-ReleaseAssert/xctest-linux-x86_64
    — bootstrap: note: building stage1: /home/ec2-user/swift/build/Ninja-ReleaseAssert/llbuild-linux-x86_64/bin/swift-build-tool -f /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/.bootstrap/build.swift-build
    Compile Swift Module 'libc' (2 sources)
    Compile Swift Module 'PackageDescription' (6 sources)
    Link libc
    Compile Swift Module 'POSIX' (14 sources)
    Link POSIX
    Compile Swift Module 'Basic' (21 sources)
    Link PackageDescription
    Link Basic
    Compile Swift Module 'Utility' (15 sources)
    Link Utility
    Compile Swift Module 'PackageModel' (5 sources)
    Compile Swift Module 'SourceControl' (3 sources)
    Link PackageModel
    Compile Swift Module 'PackageLoading' (4 sources)
    Link SourceControl
    Link PackageLoading
    Compile Swift Module 'PackageGraph' (4 sources)
    Compile Swift Module 'Get' (9 sources)
    Link Get
    Link PackageGraph
    Compile Swift Module 'Build' (11 sources)
    Compile Swift Module 'Xcodeproj' (5 sources)
    Link Xcodeproj
    Link Build
    Compile Swift Module 'Commands' (13 sources)
    Link Commands
    Compile Swift Module 'swift_test' (1 sources)
    Compile Swift Module 'swift_build' (1 sources)
    Compile Swift Module 'swift_package' (1 sources)
    Link /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/.bootstrap/bin/swift-test
    Link /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/.bootstrap/bin/swift-build
    Link /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/.bootstrap/bin/swift-package
    — bootstrap: note: building self-hosted 'swift-build': env SWIFT_EXEC=/home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/swiftc SWIFT_BUILD_PATH=/home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64 /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/swift-build-stage1 -Xlinker -rpath -Xlinker $ORIGIN/../lib/swift/linux -Xlinker -L -Xlinker /home/ec2-user/swift/build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation -Xlinker -rpath -Xlinker /home/ec2-user/swift/build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation -Xswiftc -I/home/ec2-user/swift/build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation -Xswiftc -I/home/ec2-user/swift/build/Ninja-ReleaseAssert/foundation-linux-x86_64/Foundation/usr/lib/swift -Xlinker -L -Xlinker /home/ec2-user/swift/build/Ninja-ReleaseAssert/xctest-linux-x86_64 -Xlinker -rpath -Xlinker /home/ec2-user/swift/build/Ninja-ReleaseAssert/xctest-linux-x86_64 -Xswiftc -I/home/ec2-user/swift/build/Ninja-ReleaseAssert/xctest-linux-x86_64 -Xswiftc -I/home/ec2-user/swift/build/Ninja-ReleaseAssert/libdispatch-linux-x86_64/src -Xswiftc -I/home/ec2-user/swift/build/Ninja-ReleaseAssert/libdispatch-linux-x86_64/src/swift -Xswiftc -I/home/ec2-user/swift/swift-corelibs-libdispatch -Xcc -fblocks --build-tests
    Compile Swift Module 'PackageDescription' (6 sources)
    Compile Swift Module 'libc' (2 sources)
    Compile Swift Module 'swiftpm_xctest_helper' (1 sources)
    Linking /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/swiftpm-xctest-helper
    Compile Swift Module 'POSIX' (14 sources)
    Compile Swift Module 'Basic' (21 sources)
    Compile Swift Module 'POSIXTests' (2 sources)
    Compile Swift Module 'Utility' (15 sources)
    Compile Swift Module 'PackageDescriptionTests' (4 sources)
    Linking /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/libPackageDescription.so
    :0: error: unable to execute command: Killed
    :0: error: compile command failed due to signal (use -v to see invocation)
    :0: error: build had 1 command failures
    error: exit(1): /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug/swift-build-tool -f /home/ec2-user/swift/build/Ninja-ReleaseAssert/swiftpm-linux-x86_64/debug.yaml test
    — bootstrap: error: build failed with exit status 1
    ./utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

@swift-ci
Copy link
Collaborator

Comment by W S (JIRA)

If the issues are caused by the same, it seems to be in apple/swift/master between 37c9fb4 (no failure) and 154a228 (failure in swiftpm)

@swift-ci
Copy link
Collaborator

Comment by W S (JIRA)

(Need to confirm) swiftpm built fine at 35ed40e but not 7d7eb08, so eying 7d7eb08

@bob-wilson
Copy link

I removed the type checker label.

@ddunbar
Copy link
Member Author

ddunbar commented Sep 26, 2016

I verified this problem is resolved by reverting fa28b5e.

@adrian-prantl can you take a look?

@adrian-prantl
Copy link
Member

I'll investigate.

@adrian-prantl
Copy link
Member

#5023

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

5 participants