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

Cannot use -enable-objc-interop on Linux with Foundation #76247

Open
gabryon99 opened this issue Sep 4, 2024 · 0 comments
Open

Cannot use -enable-objc-interop on Linux with Foundation #76247

gabryon99 opened this issue Sep 4, 2024 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@gabryon99
Copy link

Description

Hello!

We have a Swift class annotated with @obj and we would like to expose its methods to Objective-C. The package is built with SPM using the latest Ubuntu 24.04 toolchain: swift-5.10.1-RELEASE-ubuntu20.04.

However, similarly to what happened in #64457, when the flag -enable-objc-interop is set, Foundation cannot be used. The building process is interrupted by the error explained down below.

Reproduction

  1. Download a Swift toolchain for Ubuntu (https://www.swift.org/install/linux/ubuntu/#versions)
  2. Create a new Swift package mkdir objc-test && cd objc-test && swift package init.
  3. In Package.swift, set the -enable-objc-interop compiler flag:
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "objc-test",
    products: [
        .library(
            name: "objc-test",
            targets: ["objc-test"]),
    ],
    targets: [
        .target(
            name: "objc-test",
            swiftSettings: [.unsafeFlags(["-Xfrontend", "-enable-objc-interop"])]),
        .testTarget(
            name: "objc-testTests",
            dependencies: ["objc-test"]),
    ]
)
  1. In the Swift file Sources/objc-test/objc_test.swift, write the following example code:
import Foundation

@objc
class Wrapper : NSObject {

    @objc
    static func foo(msg: NSString) -> NSString? {
        return nil
    }
}
  1. Run swift build on the terminal, and you will get the following error:
Building for debugging...
error: emit-module command failed with exit code 1 (use -v to see invocation)
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:90:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSArray(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:91:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSData(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:92:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSDate(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:93:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSDictionary(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:94:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSObject(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:95:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSOrderedSet(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:96:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSNumber(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:97:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSSet(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:98:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSString(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:99:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSTimeZone(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:100:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSValue(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:101:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSCFConstantString(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:102:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSIndexSet(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:103:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSAttributedString(NSISARGTYPE arg);
          ^
<unknown>:0: error: could not build Objective-C module 'CoreFoundation'
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:90:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSArray(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:91:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSData(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:92:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSDate(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:93:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSDictionary(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:94:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSObject(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:95:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSOrderedSet(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:96:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSNumber(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:97:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSSet(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:98:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSString(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:99:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSTimeZone(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:100:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSValue(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:101:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSCFConstantString(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:102:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSIndexSet(NSISARGTYPE arg);
          ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "CoreFoundation.h"
        ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/CoreFoundation.h:103:
#include <CoreFoundation/ForSwiftFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:10: note: in file included from /home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForSwiftFoundationOnly.h:27:
#include <CoreFoundation/ForFoundationOnly.h>
         ^
/home/gabriele-pappalardo/Downloads/swift-5.10.1-RELEASE-ubuntu24.04/usr/lib/swift/CoreFoundation/ForFoundationOnly.h:103:11: error: unknown type name 'BOOL'
CF_EXPORT BOOL _NSIsNSAttributedString(NSISARGTYPE arg);
          ^
<unknown>:0: error: could not build Objective-C module 'CoreFoundation'
error: fatalError

Expected behavior

Foundation should be usable on Linux when Objective-C interoperability is enabled (i.e., the flag -enable-objc-interop is set).

Environment

  • Output of swift --version:
Swift version 5.10.1 (swift-5.10.1-RELEASE)
Target: x86_64-unknown-linux-gnu
  • Operating System: Ubuntu 24.04 LTS - Linux 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Additional information

No response

@gabryon99 gabryon99 added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 4, 2024
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. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant