Skip to content

Linux: Fix -static-executable and remove swiftImageInspectionShared#34180

Merged
swift-ci merged 1 commit into
swiftlang:mainfrom
spevans:pr_static_executable_fix_1lib
Oct 8, 2020
Merged

Linux: Fix -static-executable and remove swiftImageInspectionShared#34180
swift-ci merged 1 commit into
swiftlang:mainfrom
spevans:pr_static_executable_fix_1lib

Conversation

@spevans

@spevans spevans commented Oct 5, 2020

Copy link
Copy Markdown
Contributor
  • Remove references to swiftImageInspectionShared on Linux and dont have
    split libraries between static/non-static linked executables.

  • -static-executable now links correctly Linux.

    Note: swift::lookupSymbol() will not work on statically linked
    executables but this can be worked around by using the
    https://github.com/swift-server/swift-backtrace package.

- Remove references to swiftImageInspectionShared on Linux and dont have
  split libraries between static/non-static linked executables.

- -static-executable now links correctly Linux.

  Note: swift::lookupSymbol() will not work on statically linked
        executables but this can be worked around by using the
        https://github.com/swift-server/swift-backtrace package.
@spevans

spevans commented Oct 5, 2020

Copy link
Copy Markdown
Contributor Author

Please test with following pull request:
swiftlang/swift-integration-tests#69

@swift-ci please test

@compnerd compnerd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks largely like my original change with the addition of a test case!

@spevans

spevans commented Oct 6, 2020

Copy link
Copy Markdown
Contributor Author

Please test with following pull request:
swiftlang/swift-integration-tests#74

@swift-ci please test

@swift-ci

swift-ci commented Oct 7, 2020

Copy link
Copy Markdown
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 960d0e3

@swift-ci

swift-ci commented Oct 7, 2020

Copy link
Copy Markdown
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 960d0e3

@spevans

spevans commented Oct 7, 2020

Copy link
Copy Markdown
Contributor Author

Please test with following pull request:
swiftlang/swift-integration-tests#74

@swift-ci please test

@spevans

spevans commented Oct 8, 2020

Copy link
Copy Markdown
Contributor Author

@swift-ci test and merge

1 similar comment
@spevans

spevans commented Oct 8, 2020

Copy link
Copy Markdown
Contributor Author

@swift-ci test and merge

@swift-ci swift-ci merged commit 8b5a55d into swiftlang:main Oct 8, 2020
@beccadax

beccadax commented Oct 11, 2020

Copy link
Copy Markdown
Contributor

@spevans @compnerd Hiya. It looks like this change may have broken static linking on at least CentOS 7:

******************** TEST 'Swift(linux-x86_64) :: Driver/static-executable-linux.swift' FAILED ********************
Script:
--
: 'RUN: at line 5';   rm -rf "/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp" && mkdir -p "/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp"
: 'RUN: at line 6';   /home/build-user/build/buildbot_linux/swift-linux-x86_64/bin/swiftc -target x86_64-unknown-linux-gnu -toolchain-stdlib-rpath  -module-cache-path '/home/build-user/build/buildbot_linux/swift-linux-x86_64/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -static-executable -o /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp/static-executable /home/build-user/swift/test/Driver/static-executable-linux.swift
: 'RUN: at line 7';   /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp/static-executable | /usr/bin/python3.6 '/home/build-user/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/home/build-user/build/buildbot_linux/swift-linux-x86_64' --sanitize SOURCE_DIR='/home/build-user/swift' --use-filecheck '/home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck'  /home/build-user/swift/test/Driver/static-executable-linux.swift
: 'RUN: at line 8';   file /home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.tmp/static-executable | /usr/bin/python3.6 '/home/build-user/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/home/build-user/build/buildbot_linux/swift-linux-x86_64' --sanitize SOURCE_DIR='/home/build-user/swift' --use-filecheck '/home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck'  /home/build-user/swift/test/Driver/static-executable-linux.swift --check-prefix=FILE
--
Exit Code: 2

Command Output (stderr):
--
/home/build-user/build/buildbot_linux/swift-linux-x86_64/test-linux-x86_64/Driver/Output/static-executable-linux.swift.script: line 4: file: command not found
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/build-user/build/buildbot_linux/llvm-linux-x86_64/bin/FileCheck /home/build-user/swift/test/Driver/static-executable-linux.swift --check-prefix=FILE

--

********************

What should we do here?

kateinoigakukun added a commit to swiftwasm/swift that referenced this pull request Oct 11, 2020
kateinoigakukun added a commit to swiftwasm/swift that referenced this pull request Oct 12, 2020
@spevans

spevans commented Oct 12, 2020

Copy link
Copy Markdown
Contributor Author

@brentdax Could it simply be the case that the file command is not installed?

The lit script is fairly simple but does include the command check:

// FILE: , statically linked,

Which is probably breaking it. However it looks like test/Driver/static-executable-linux.swift is actually a duplicate of test/Driver/static-executable.swift with the exception that the latter uses ELF-NOT instead. I will open a PR to remove this broken test.

Btw, is there anyway to CI tests on Centos?

@spevans

spevans commented Oct 12, 2020

Copy link
Copy Markdown
Contributor Author

I have opened #34275 to fix this.

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