Skip to content

Add SWIFT_BUILD_SWIFT_SYNTAX check on PrintingDiagnosticConsumer #75940

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

Conversation

iMostfa
Copy link
Contributor

@iMostfa iMostfa commented Aug 17, 2024

Hello Team,

i think that this check is needed to be able to compile the compiler without SWIFT_BUILD_SWIFT_SYNTAX enabled
otherwise you will get

Undefined symbols for architecture arm64:
  "swift::DiagnosticBridge::~DiagnosticBridge()", referenced from:
      swift::PrintingDiagnosticConsumer::~PrintingDiagnosticConsumer() in libswiftFrontend.a[20](PrintingDiagnosticConsumer.cpp.o)
ld: symbol(s) not found for architecture arm64

Resolves #75939

@iMostfa iMostfa force-pushed the 75939-add-SWIFT_BUILD_SWIFT_SYNTAX-on-PrintingDiagnosticConsumer branch 2 times, most recently from 373602b to 808648c Compare August 17, 2024 11:13
@iMostfa iMostfa force-pushed the 75939-add-SWIFT_BUILD_SWIFT_SYNTAX-on-PrintingDiagnosticConsumer branch from 808648c to 6151bf6 Compare August 17, 2024 11:13
Copy link
Contributor

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

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

LGTM

@cachemeifyoucan
Copy link
Contributor

@swift-ci please smoke test

@iMostfa
Copy link
Contributor Author

iMostfa commented Aug 19, 2024

i see that linux&windows are green, but mac isn't
checking the log, i see that the following ones did fail, but i'm not sure if it's related to my changes ?
@cachemeifyoucan

FAIL: lldb-api :: lang/swift/enums/decoding_error/TestSwiftDecodingErrorEnum.py (122 of 445)
******************** TEST 'lldb-api :: lang/swift/enums/decoding_error/TestSwiftDecodingErrorEnum.py' FAILED ********************
Script:
--
/Applications/Xcode-beta.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/bin/python3.9 /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --inferior-env DYLD_LIBRARY_PATH="/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/macosx:/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/./lib/lldb/clang/lib/darwin" --inferior-env LD_LIBRARY_PATH="/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/x86_64" --inferior-env SIMCTL_CHILD_DYLD_LIBRARY_PATH="/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift/macosx" --env OBJCOPY=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./bin/llvm-objcopy --out-of-tree-debugserver --env LLVM_LIBS_DIR=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./lib --env LLDB_LIBS_DIR=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/./lib --env LLVM_INCLUDE_DIR=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/include --env LLVM_TOOLS_DIR=/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./bin --libcxx-include-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/libcxx-macosx-x86_64/include/c++/v1 --libcxx-library-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/libcxx-macosx-x86_64/lib --arch x86_64 --build-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/lldb-test-build.noindex --lldb-module-cache-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/lldb-test-build.noindex/module-cache-clang/lldb-api --swift-libs-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/swift-macosx-x86_64/lib/swift --executable /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/./bin/lldb --compiler /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./bin/clang --swift-compiler /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/swift-macosx-x86_64/bin/swiftc --dsymutil /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./bin/dsymutil --llvm-tools-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/./bin --lldb-obj-root /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64 --lldb-libs-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/./lib --framework /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/bin/LLDB.framework --skip-category=swiftmaccatalyst --build-dir /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/lldb-macosx-x86_64/lldb-test-build.noindex --skip-category=watchpoint --skip-category=dwo --setting symbols.use-swift-clangimporter=true --setting symbols.swift-precise-compiler-invocation=true /Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/llvm-project/lldb/test/API/lang/swift/enums/decoding_error -p TestSwiftDecodingErrorEnum.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 17.0.0 (https://github.com/swiftlang/llvm-project.git revision 6c1a2ac10cabb71c834e6d300cf6874490219646)
Apple Swift version 6.0-dev (LLVM 6c1a2ac10cabb71, Swift 015a61a4896341d)
Skipping the following test categories: ['frame-diagnose', 'swiftmaccatalyst', 'watchpoint', 'dwo', 'libstdcxx', 'dwo', 'llgs', 'fork']

--
Command Output (stderr):
--
FAIL: LLDB (/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/bin/clang-x86_64) :: test_swift_decoding_error_dsym (TestSwiftDecodingErrorEnum.TestCase)
PASS: LLDB (/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/bin/clang-x86_64) :: test_swift_decoding_error_dwarf (TestSwiftDecodingErrorEnum.TestCase)
UNSUPPORTED: LLDB (/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/bin/clang-x86_64) :: test_swift_decoding_error_dwo (TestSwiftDecodingErrorEnum.TestCase) (test case does not fall in any category of interest for this run) 
======================================================================
FAIL: test_swift_decoding_error_dsym (TestSwiftDecodingErrorEnum.TestCase)
   Regression test for Swift.DecodingError, a specific instance of a multipayload enum.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 1692, in test_method
    return attrvalue(self)
  File "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 169, in wrapper
    return func(*args, **kwargs)
  File "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/llvm-project/lldb/test/API/lang/swift/enums/decoding_error/TestSwiftDecodingErrorEnum.py", line 23, in test_swift_decoding_error
    self.expect("expression error", substrs=substrs)
  File "/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2456, in expect
    self.fail(log_msg)
AssertionError: Ran command:
"expression error"

Got output:
(DecodingError) $R0 = typeMismatch {
  typeMismatch = {
    0 = Any
    1 = {
      codingPath = <uninitialized> {
        _buffer = {
          _storage = (rawValue = 0x0000000000000000)
        }
      }
      debugDescription = <uninitialized>
      underlyingError = nil
    }
  }
}

Expecting sub string: "(DecodingError) " (was found)
Expecting sub string: " = keyNotFound {" (was not found)
Config=x86_64-/Users/ec2-user/jenkins/workspace/swift-PR-macos-smoke-test/branch-main/build/buildbot_incremental/llvm-macosx-x86_64/bin/clang

@cachemeifyoucan
Copy link
Contributor

I doubt it is related (I think the bots are building with swift-syntax). There is a slight possibility that LLDB is not building with SWIFT_BUILD_SWIFT_SYNTAX defined and causing some incompatibility. I will re-run the test and see how it goes. The alternative will just be defining a no-op ~DiagnosticBridge when SWIFT_BUILD_SWIFT_SYNTAX is not defined.

@cachemeifyoucan
Copy link
Contributor

@swift-ci please smoke test macOS platform

@iMostfa
Copy link
Contributor Author

iMostfa commented Aug 20, 2024

@cachemeifyoucan we are green now

@cachemeifyoucan
Copy link
Contributor

@cachemeifyoucan we are green now

Do you want me to merge for you?

@iMostfa
Copy link
Contributor Author

iMostfa commented Aug 20, 2024

@cachemeifyoucan
Yes Please, i don't have access to merge nor running tests 😆

This branch has no conflicts with the base branch
Only those with write access to this repository can merge pull requests.

@cachemeifyoucan cachemeifyoucan merged commit 5ba41e3 into swiftlang:main Aug 20, 2024
3 checks passed
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.

Linker Error when building the compiler without SWIFT_BUILD_SWIFT_SYNTAX
2 participants