Quantcast
Channel: Development - Swift Forums
Browsing latest articles
Browse All 307 View Live

Image may be NSFW.
Clik here to view.

Error from opening Debugging Symbols Toolchain package?

Hi! I'm currently unable to install the swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-10-a-osx-symbols toolchain. This error appears: “swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-10-a-osx-symbols.pkg” can’t be...

View Article



Missing compiler diagnostics with ~Copyable property wrapper in function...

I'm trying to implement a closure that can only be called one time. Doing that I met weird compiler behaviour, which I describe in the comments below. @propertyWrapper struct OnceCalledClosureWrapper:...

View Article

Image may be NSFW.
Clik here to view.

Trouble Adding OpenAPIGenerator Plugin to Run Build Tool Plug-ins in Xcode...

I'm using SPM in my project and am trying to integrate Apple/swift-openapi-generator. My project is divided into several modules, for which I'm using SPM. To manage dependencies, I have a...

View Article

Swift package manager dependencies

Hi, I have a PackageA that uses swift code and has a dependency on a PackageB that also uses swift code only. In the main hosting app, I would like to just import PackageA and use the classes of...

View Article

Image may be NSFW.
Clik here to view.

Can't add SwiftPM testTarget to Xcode test plan

In my project, I've broken out some components into local SPM packages. In Xcode, I've added these packages and the project compiles as expected. The SPM's have unit tests in a .testTarget and when I...

View Article


SwiftPM manual cache management?

i have a CI/CD system that consumes a lot of network bandwidth downloading git repositories from GitHub. this happens because the build system clears the SwiftPM cache (.swiftpm/cache/repositories)...

View Article

Is there a way to know when value types are passed by reference at runtime?

Hi, This is a bit of an obscure question but I have some code GitHub - johnno1962/SwiftTrace: Trace Swift and Objective-C method invocations that allows you to intercept function calls for logging and...

View Article

Why does breaking up SwiftPM targets list cause typechecking to fall off a...

i have a package manifest with a lot (>100) targets that was basically impossible to navigate. so i wanted to break it up into collapsible sections like this: var a:[Target] { [ // targets ... ] }...

View Article


Surfacing Isolation through tools

I was reading this blog post about a cute little algorithm to run in your head to trace where a symbol’s isolation is defined, and it got me thinking: why are we making developers responsible for...

View Article


Image may be NSFW.
Clik here to view.

[RFC] Conditional Runtime Records Revamped

Hi all, I'd like to socialize a patch I have that re-implements -conditional-runtime-records in a way I believe brings the feature closer to being safe for general adoption. My goals with this...

View Article

Strategies for passing an enum value as a macro parameter and reading during...

Hi! Does anyone have experience passing an arbitrary enum value as an argument to a macro and then making use of that enum value in the macro implementation? I have a hack that seems to work (for...

View Article

Exhaustive Switch Completion from SourceKit-LSP

Xcode has a nice completion for an exhaustive switch statement. I was wondering it this is implemented and available in sourcekit-lsp / sourcekit? enum Message { case a case b case c } func...

View Article

ExtensionMacro on a nested type does not generate extension at top level?

Hi! I'm seeing some unexpected behavior with using ExtensionMacro. According to SE-0402[1] we can expect that an ExtensionMacro applied to a nested type will generate an extension at top-level. I am...

View Article


Missing warning or error when messing up initializer inheritance?

So I managed to instantiate an object of a subclass that had a property (in this case storing a closure) not initialized. At least I believe so, thus I would appreciate somebody taking a look at this...

View Article

Ubuntu 23.04: /usr/bin/ld.gold: error: cannot find -lcurses

I am trying to compile swift using: ./utils/build-script --release-debuginfo Any help is greatly appreciated. Thanks in advance! 2 posts - 1 participant Read full topic

View Article


Can os_unfair_lock be used with C++ interop enabled?

When os_unfair_lock_lock() is called with C++ interop enabled, it crashes with "os_unfair_lock is corrupt". When C++ interop is disabled, it works fine. I realized OSAllocatedUnfairLock exists, but...

View Article

Debug Swift Build fails

No matter what I try, this comand always fails with: FAILED: SwiftCompilerSources/Basic.o...

View Article


Invalid XCFramweork when generated with BUILD_LIBRARY_FOR_DISTRIBUTION=YES

Hi all, I'm attempting to generate an XCFramework that must maintain ABI stability. The framework is created from an SPM using the following script: #!/bin/bash set -x set -e # Pass scheme name as the...

View Article

Swift dependencies in private Github repos

How do I add dependencies to a Swift Package, if those dependencies are in private repos? This works in the Package file, but exposes my personal access token if I commit it:...

View Article

Swift Macro Member Named Symbols Interfering with Compiler Protocol...

Hi! I'm seeing some unexpected behavior when adding named symbols to a member macro declaration. The name seems to be interfering with some Swift Protocol Conformance (Equatable) in an unexpected way....

View Article

Image may be NSFW.
Clik here to view.

BuildToolPlugin 'Multiple commands produce ...' error when embedding wachOS...

I'm an author of a tool called xcstrings-tool that offers a BuildToolPlugin to generate Swift source code for accessing localized strings that are declared in an Xcode Strings Catalog. While BuildTool...

View Article


Linker warnings on Windows with Swift Argument Parser

I'm trying to understand a number of linker warnings that I'm getting on Windows, but not on macOS, when I build a command line utility using the Swift Package Manager. The utility depends on the...

View Article


Image may be NSFW.
Clik here to view.

Swift/C++ interoperability: SWIFT_PRIVATE_ATTR compilation error on Ubuntu

Hi There I'm trying to tame Swift and C++ interoperability with CMake. On macOS, everything works fine, but I have an issue on Ubuntu: [3/4] /usr/bin/clang++-15...

View Article

Improving Swift support and interoperability experience for Android

Hey everyone, Over the past several weeks @compnerd and I have been working on improving Swift support for Android. We now can build Android standard library on Windows (Linux still works as well!),...

View Article

Enabling .enableExperimentalFeature("BodyMacros") doesn't work

Hey there, I am trying to enable BodyMacros experimental feature but BodyMacros still cannot be found. I am on the swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-20-a and the corresponding branch for...

View Article

Browsing latest articles
Browse All 307 View Live




Latest Images