Skip to content

error: cannot find type '*' in scope #9110

@kcieplak

Description

@kcieplak

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

https://github.com/automerge/automerge-swift.git
MacOS

swift build `--buildsystem=swiftbuild` fails to build package
info: Emit Swift module (arm64)
    cd /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3
    
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:14:23 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:38:23 cannot find type 'ForeignBytes' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:52:22 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:190:76 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:196:36 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:209:53 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:256:23 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:269:60 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:275:32 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:276:39 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:281:39 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:282:21 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:292:17 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:293:21 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:327:38 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:340:38 cannot find type 'RustCallStatus' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:343:24 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:508:25 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:510:38 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:521:50 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:506:20 type 'FfiConverterString' does not conform to protocol 'FfiConverter'
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:506:20 add stubs for conformance: FixIt(sourceRange: SwiftBuild.SwiftBuildMessage.DiagnosticInfo.SourceRange(path: "/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift", startLine: 506, startColumn: 54, endLine: 506, endColumn: 54), textToInsert: "\n    typealias FfiType = <#type#>\n")
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:160:20 protocol requires nested type 'FfiType'
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:1566:15 type 'FfiConverterTypeChange' does not conform to protocol 'FfiConverter'
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:1566:15 add stubs for conformance: FixIt(sourceRange: SwiftBuild.SwiftBuildMessage.DiagnosticInfo.SourceRange(path: "/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift", startLine: 1566, startColumn: 63, endLine: 1566, endColumn: 63), textToInsert: "\n    typealias FfiType = <#type#>\n\n    typealias SwiftType = <#type#>\n")
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:160:20 protocol requires nested type 'FfiType'
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:161:20 protocol requires nested type 'SwiftType'
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:1593:48 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:1600:62 cannot find type 'RustBuffer' in scope
error: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:1640:15 type 'FfiConverterTypeKeyValue' does not conform to protocol 'FfiConverter'
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:1640:15 add stubs for conformance: FixIt(sourceRange: SwiftBuild.SwiftBuildMessage.DiagnosticInfo.SourceRange(path: "/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift", startLine: 1640, startColumn: 65, endLine: 1640, endColumn: 65), textToInsert: "\n    typealias FfiType = <#type#>\n\n    typealias SwiftType = <#type#>\n")
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:160:20 protocol requires nested type 'FfiType'
info: /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift:161:20 protocol requires nested type 'SwiftType'

...

error: SwiftCompile normal arm64 /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift failed with a nonzero exit code
info: Failed frontend command:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift -target arm64-apple-macos15.0.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.6.sdk -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -I /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Products/Debug -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks -F /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Products/Debug -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-color-diagnostics -Xcc -fno-color-diagnostics -enable-testing -g -debug-info-format\=dwarf -dwarf-version\=5 -module-cache-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/ModuleCache.noindex -swift-version 5 -enforce-exclusivity\=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D SWIFT_MODULE_RESOURCE_BUNDLE_UNAVAILABLE -D Xcode -serialize-debugging-options -const-gather-protocols-file /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi_const_extract_protocols.json -enable-experimental-feature DebugDescriptionMacro -empty-abi-descriptor -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing -validate-clang-modules-once -clang-build-session-file /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3 -enable-anonymous-context-mangled-names -file-compilation-dir /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3 -Xcc -D_LIBCPP_HARDENING_MODE\=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/SDKStatCaches.noindex/macosx15.6-24G5010s-6bc03b60bc3b31e1012288d66b31badf.sdkstatcache -Xcc -I/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/swift-overrides.hmap -Xcc -I/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Products/Debug/include -Xcc -I/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/DerivedSources-normal/arm64 -Xcc -I/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/DerivedSources/arm64 -Xcc -I/private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG\=1 -module-name AutomergeUniffi -package-name automerge_swift -frontend-parseable-output -target-sdk-version 15.6 -target-sdk-name macosx15.6 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -in-process-plugin-server-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/libSwiftInProcPluginServer.dylib -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -emit-module-doc-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi.swiftdoc -emit-module-source-info-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi.swiftsourceinfo -emit-objc-header-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi-Swift.h -serialize-diagnostics-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi-primary-emit-module.dia -emit-dependencies-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi-primary-emit-module.d -parse-as-library -o /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi.swiftmodule -emit-abi-descriptor-path /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/.build-swiftbuild/arm64-apple-macosx/Intermediates.noindex/Automerge.build/Debug/AutomergeUniffi.build/Objects-normal/arm64/AutomergeUniffi.abi.json
error: SwiftEmitModule normal arm64 Emitting\ module\ for\ AutomergeUniffi failed with a nonzero exit code
error: SwiftCompile normal arm64 /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift failed with a nonzero exit code
error: SwiftCompile normal arm64 Compiling\ automerge.swift /private/var/lib/jenkins/workspace/swift_oss/swift-package-index-metrics/spi-workdir/8B40A4D7-031F-408E-A706-5893A7B149E3/automerge-swift/AutomergeUniffi/automerge.swift failed with a nonzero exit code
error: Build failed

Expected behavior

Builds

Actual behavior

Fails to build

Steps to reproduce

git clone https://github.com/automerge/automerge-swift.git
swift build --build-system=swiftbuild

Swift Package Manager version/commit hash

No response

Swift & OS version (output of swift --version ; uname -a)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions