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

[Source compatibility suite] Doggie failing to build - error: reference to top-level declaration 'NSDecimalRound' broken by a context change; 'NSDecimalRound' was expected to be in 'Foundation', but now a candidate is found only in 'DoggieGeometry' #79801

Open
justice-adams-apple opened this issue Mar 5, 2025 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. source compatibility suite Flag: An issue that surfaced in the source compatibility suite

Comments

@justice-adams-apple
Copy link
Contributor

Description

Doggie is failing to build the release configuration with the following error:

Doggie/.build/x86_64-apple-macosx/release/Modules/DoggieCore.swiftmodule:1:1: error: reference to top-level declaration 'NSDecimalRound' broken by a context change; 'NSDecimalRound' was expected to be in 'Foundation', but now a candidate is found only in 'DoggieGeometry'
1 | Foundation.NSDecimalRound
  | |- error: reference to top-level declaration 'NSDecimalRound' broken by a context change; 'NSDecimalRound' was expected to be in 'Foundation', but now a candidate is found only in 'DoggieGeometry'
  | |- note: the declaration was expected to be found in module 'Foundation' at '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface'
  | |- note: or expected to be found in the underlying module 'Foundation' defined at '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Modules/module.modulemap'
  | |- note: the declaration was actually found in module 'DoggieGeometry' at ''
  | `- note: declarations in the underlying clang module 'Foundation' may be hidden by clang preprocessor macros
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0.	Program arguments: <ARGS>
1.	Apple Swift version 6.2-dev (LLVM 2b92dd1ae9a3bc3, Swift f636aa00e00b889)
2.	Compiling with effective version 5.10
3.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { PrepareOptimizationPasses, EarlyModulePasses, HighLevel,Function+EarlyLoopOpt, HighLevel,Module+StackPromote, MidLevel,Function, ClosureSpecialize, LowLevel,Function, LateLoopOpt, SIL Debug Info Generator } on SIL for DoggieGeometry)
4.	While running pass #21673 SILModuleTransform "PerformanceSILLinker".
5.	While deserializing SIL function "$sSo9NSDecimala10DoggieCoreE7rounded5scale12roundingModeABSi_So010NSRoundingG0VtF"
6.	While deserializing SIL function "NSDecimalRound"
7.	*** DESERIALIZATION FAILURE ***
*** If any module named here was modified in the SDK, please delete the ***
*** new swiftmodule files from the SDK and keep only swiftinterfaces.   ***
module 'DoggieCore', builder version '6.2(5.10)/Apple Swift version 6.2-dev (LLVM 2b92dd1ae9a3bc3, Swift f636aa00e00b889)', built from source against SDK 24C94, non-resilient, loaded from '/Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/Doggie/.build/x86_64-apple-macosx/release/Modules/DoggieCore.swiftmodule'

Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  swift-frontend           0x000000010beb0108 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40
1  swift-frontend           0x000000010beae1a9 llvm::sys::RunSignalHandlers() + 233
2  swift-frontend           0x000000010beb0776 SignalHandler(int, __siginfo*, void*) + 278
3  libsystem_platform.dylib 0x00007ff80a501e9d _sigtramp + 29
4  libsystem_platform.dylib 0x000060000344a280 _sigtramp + 18446708923579008000
5  libsystem_c.dylib        0x00007ff80a3edb19 abort + 126
6  swift-frontend           0x00000001060ea1c4 swift::ModuleFileSharedCore::fatal(llvm::Error) const + 1140
7  swift-frontend           0x000000010606a252 swift::ModuleFile::fatal(llvm::Error) const + 66
8  swift-frontend           0x00000001060704b2 swift::ModuleFile::getDecl(llvm::PointerEmbeddedInt<unsigned int, 31>) + 114
9  swift-frontend           0x00000001060bc7b1 swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool, bool) + 2593
10 swift-frontend           0x00000001060bb93a swift::SILDeserializer::getFuncForReference(llvm::StringRef, swift::SILType, swift::TypeExpansionContext) + 458
11 swift-frontend           0x00000001060ca043 swift::SILDeserializer::readSILInstruction(swift::SILFunction*, swift::SILBuilder&, unsigned int, llvm::SmallVectorImpl<unsigned long long>&) + 42963
12 swift-frontend           0x00000001060bd8ff swift::SILDeserializer::readSILFunctionChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, swift::SILFunction*, llvm::StringRef, bool, bool, bool) + 7023
13 swift-frontend           0x00000001060d0d21 swift::SILDeserializer::lookupSILFunction(swift::SILFunction*, bool) + 385
14 swift-frontend           0x0000000106179d1c swift::SerializedSILLoader::lookupSILFunction(swift::SILFunction*, bool) + 124
15 swift-frontend           0x00000001061bbf7e swift::SILLinkerVisitor::deserializeAndPushToWorklist(swift::SILFunction*) + 286
16 swift-frontend           0x00000001061bc7eb swift::SILLinkerVisitor::process() + 475
17 swift-frontend           0x00000001061bc5dc swift::SILLinkerVisitor::processFunction(swift::SILFunction*) + 92
18 swift-frontend           0x000000010624626b swift::SILModule::linkFunction(swift::SILFunction*, swift::SILModule::LinkingMode) + 123
19 swift-frontend           0x0000000105eb2ccf (anonymous namespace)::SILLinker::run() + 159
20 swift-frontend           0x0000000105d3e724 swift::SILPassManager::runModulePass(unsigned int) + 964
21 swift-frontend           0x0000000105d416db swift::SILPassManager::execute() + 619
22 swift-frontend           0x0000000105d3abd8 swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 72
23 swift-frontend           0x0000000105d3ab63 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 51
24 swift-frontend           0x0000000105d9146d swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 29
25 swift-frontend           0x0000000105d59985 swift::ExecuteSILPipelineRequest::OutputType swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()>(swift::ExecuteSILPipelineRequest const&, swift::ExecuteSILPipelineRequest::OutputType swift::evaluateOrFatal<swift::ExecuteSILPipelineRequest>(swift::Evaluator&, swift::ExecuteSILPipelineRequest)::'lambda'()) + 181
26 swift-frontend           0x0000000105d3ae10 swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 64
27 swift-frontend           0x0000000105d6f573 swift::runSILOptimizationPasses(swift::SILModule&) + 163
28 swift-frontend           0x000000010544f7f4 swift::CompilerInstance::performSILProcessing(swift::SILModule*) + 260
29 swift-frontend           0x00000001051b17fd performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 765
30 swift-frontend           0x00000001051b1177 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1735
31 swift-frontend           0x00000001051bed4f withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 143
32 swift-frontend           0x00000001051b2f85 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 933
33 swift-frontend           0x00000001051b25c3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2627
34 swift-frontend           0x0000000104f4dbfc swift::mainEntry(int, char const**) + 3340
35 dyld                     0x00007ff80a13f2cd start + 1805

Note this only appears to happen when building the Release configuration

Reproduction

swift build --disable-sandbox --package-path /Users/ec2-user/jenkins/workspace/swift-main-source-compat-suite/swift-source-compat-suite/project_cache/Doggie --verbose --configuration release -Xswiftc -swift-version -Xswiftc 5

Expected behavior

Expected the project to build correctly

Environment

Apple Swift version 6.2-dev (LLVM 2b92dd1ae9a3bc3, Swift f636aa0)
Target: x86_64-apple-macosx13.0

Additional information

https://ci.swift.org/job/swift-main-source-compat-suite/1052

@justice-adams-apple justice-adams-apple added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Mar 5, 2025
@compnerd compnerd added source compatibility suite Flag: An issue that surfaced in the source compatibility suite and removed triage needed This issue needs more specific labels labels Mar 6, 2025
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. source compatibility suite Flag: An issue that surfaced in the source compatibility suite
Projects
None yet
Development

No branches or pull requests

2 participants