Possible bug / regression with regards to .pc files

Hello SPM community,

I've been playing around with a Swift wrapper for libvips. After some pandemic induced break I've recently opened the project again and found that it no longer compiles. I get an error "could not find .pc file". Here is the setup:

  • macOS 10.15.7
  • swift
swift --version
Apple Swift version 5.3.1 (swiftlang-1200.0.41 clang-1200.0.32.8)
Target: x86_64-apple-darwin19.6.0
  • brew install vips
  • vips: stable 8.10.2 (bottled)
$ cat /usr/local/lib/pkgconfig/vips.pc
prefix=/usr/local/Cellar/vips/8.10.2_1
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: vips
Description: Image processing library
Version: 8.10.2
Requires.private:  glib-2.0 gmodule-2.0 gobject-2.0 gio-2.0 expat libgsf-1 fftw3 MagickCore orc-0.4 lcms2 OpenEXR libheif poppler-glib cairo librsvg-2.0 cairo zlib openslide matio cfitsio libwebp libwebpmux libwebpdemux pangoft2 libtiff-4 spng libpng imagequant libjpeg libexif
Requires: gobject-2.0
Libs: -L${libdir} -lvips 
Libs.private: 
Cflags: -I${includedir}
// Package.swift
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "swift-vips",
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "swift-vips",
            targets: ["swift-vips"])
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .target(
            name: "swift-vips",
            dependencies: [ "Cvips" ]),
       .systemLibrary(name: "Cvips",
                       pkgConfig: "vips"),
        .testTarget(
            name: "swift-vipsTests",
            dependencies: ["swift-vips"]),
    ]
)
# Sources/Cvips/module.modulemap:

module Cvips [system] {
	header "shim.h"
    link "vips"
    export *
}
# Sources/Cvips/shim.h:

#include <vips/vips.h>

When running swift build I get the aforementioned error.

$ swift build --target swift-vips
'Cvips' vips.pc: warning: couldn't find pc file
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
        ^
/Users/tobias/Developing/test/swift-vips/Sources/Cvips/shim.h:1:10: note: in file included from /Users/tobias/Developing/test/swift-vips/Sources/Cvips/shim.h:1:
#include <vips/vips.h>
         ^
/usr/local/include/vips/vips.h:87:10: error: 'glib.h' file not found
#include <glib.h>
         ^
/Users/tobias/Developing/test/swift-vips/Sources/swift-vips/swift_vips.swift:1:8: error: could not build Objective-C module 'Cvips'
import Cvips
       ^

tobias@tobias-mbp ~/D/t/swift-vips> swift build --target swift-vips --verbose
/usr/bin/xcrun --sdk macosx --show-sdk-platform-path
/usr/bin/xcrun --sdk macosx --find xctest
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -print-target-info
xcrun --sdk macosx --show-sdk-platform-path
xcrun vtool -show-build /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
xcrun --sdk iphoneos --show-sdk-platform-path
xcrun vtool -show-build /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
xcrun --sdk appletvos --show-sdk-platform-path
xcrun vtool -show-build /Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
xcrun --sdk watchos --show-sdk-platform-path
xcrun vtool -show-build /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
pkg-config --variable pc_path pkg-config
'Cvips' vips.pc: warning: couldn't find pc file
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -module-name swift_vips -incremental -emit-dependencies -emit-module -emit-module-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.swiftmodule -output-file-map /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/output-file-map.json -parse-as-library -c /Users/tobias/Developing/test/swift-vips/Sources/swift-vips/swift_vips.swift -I /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug -target x86_64-apple-macosx10.10 -swift-version 5 -enable-batch-mode -index-store-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/index/store -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -Onone -enable-testing -g -j8 -DSWIFT_PACKAGE -DDEBUG -Xcc -fmodule-map-file=/Users/tobias/Developing/test/swift-vips/Sources/Cvips/module.modulemap -module-cache-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/ModuleCache -parseable-output -emit-objc-header -emit-objc-header-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift-vips-Swift.h -color-diagnostics
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/tobias/Developing/test/swift-vips/Sources/swift-vips/swift_vips.swift -emit-module-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift_vips~partial.swiftmodule -emit-module-doc-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift_vips~partial.swiftdoc -emit-module-source-info-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift_vips~partial.swiftsourceinfo -emit-dependencies-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift_vips.d -emit-reference-dependencies-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift_vips.swiftdeps -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -I /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/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 -color-diagnostics -enable-testing -g -module-cache-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file=/Users/tobias/Developing/test/swift-vips/Sources/Cvips/module.modulemap -target-sdk-version 11.0 -parse-as-library -module-name swift_vips -o /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/swift_vips.build/swift_vips.swift.o -index-store-path /Users/tobias/Developing/test/swift-vips/.build/x86_64-apple-macosx/debug/index/store -index-system-modules
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "shim.h"
        ^
/Users/tobias/Developing/test/swift-vips/Sources/Cvips/shim.h:1:10: note: in file included from /Users/tobias/Developing/test/swift-vips/Sources/Cvips/shim.h:1:
#include <vips/vips.h>
         ^
/usr/local/include/vips/vips.h:87:10: error: 'glib.h' file not found
#include <glib.h>
         ^
/Users/tobias/Developing/test/swift-vips/Sources/swift-vips/swift_vips.swift:1:8: error: could not build Objective-C module 'Cvips'
import Cvips
       ^

Clearly, something is not working. Since it is a bit difficult to understand what exactly is going wrong, I setup a different test:

  • git clone git@github.com:apple/swift-tools-support-core.git
  • git checkout release/5.3

I then added a new executable target with the following code:

import Foundation
import TSCBasic
import TSCUtility

do {
    let config = try PkgConfig(name: "vips",
                               additionalSearchPaths: [],
                               diagnostics: .init(),
                               fileSystem: localFileSystem,
                               brewPrefix: nil)


    print(config)
} catch (let err) {
    print(err)
}

When I run this in debug, it hits an assertion in: TSCBasic/Path.swift:L672:

func appending(component name: String) -> UNIXPath {
        assert(!name.contains("/"), "\(name) is invalid path component")
Assertion failed: /usr/local/opt/libffi/lib/pkgconfig/libffi.pc.pc is invalid path component: file TSCBasic/Path.swift, line 672

in the assertion message the path is clearly messed up (double .pc.pc extension). If I remove the assertion, I get the **couldn't find pc file** error.

Finally, when I do git checkout main in my test repo of swift-tools-support-core my little test program works as expected and I get the following output.

PkgConfig(name: "vips", 
pcFile: <AbsolutePath:"/usr/local/lib/pkgconfig/vips.pc">, 
cFlags: ["-I/usr/local/Cellar/vips/8.10.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/expat/2.2.10/include", "-I/usr/local/Cellar/libgsf/1.14.47/include/libgsf-1", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/fftw/3.3.8_2/include", "-I/usr/local/Cellar/imagemagick/7.0.10-35/include/ImageMagick-7", "-I/usr/local/Cellar/imagemagick/7.0.10-35/include/ImageMagick-7", "-Xpreprocessor", "-fopenmp", "-DMAGICKCORE_HDRI_ENABLE=1", "-DMAGICKCORE_QUANTUM_DEPTH=16", "-I/usr/local/Cellar/orc/0.4.32/include/orc-0.4", "-I/usr/local/Cellar/little-cms2/2.11/include", "-I/usr/local/Cellar/openexr/2.5.3/include/OpenEXR", "-I/usr/local/Cellar/ilmbase/2.5.3/include", "-I/usr/local/Cellar/ilmbase/2.5.3/include/OpenEXR", "-I/usr/local/Cellar/libheif/1.9.1/include", "-I/usr/local/Cellar/poppler/20.11.0/include/poppler/glib", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/cairo/1.16.0_3/include/cairo", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/pixman/0.40.0/include/pixman-1", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/poppler/20.11.0/include/poppler", "-I/usr/local/Cellar/cairo/1.16.0_3/include/cairo", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/pixman/0.40.0/include/pixman-1", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/librsvg/2.50.1/include/librsvg-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/gdk-pixbuf/2.40.0_1/include/gdk-pixbuf-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/cairo/1.16.0_3/include/cairo", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/pixman/0.40.0/include/pixman-1", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/cairo/1.16.0_3/include/cairo", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/pixman/0.40.0/include/pixman-1", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/openslide/3.4.1_5/include/openslide", "-I/usr/local/Cellar/libmatio/1.5.18/include", "-I/usr/local/opt/hdf5/include", "-I/usr/include", "-I/usr/local/Cellar/cfitsio/3.490/include", "-I/usr/local/Cellar/webp/1.1.0/include", "-I/usr/local/Cellar/webp/1.1.0/include", "-I/usr/local/Cellar/webp/1.1.0/include", "-I/usr/local/Cellar/webp/1.1.0/include", "-I/usr/local/Cellar/webp/1.1.0/include", "-I/usr/local/Cellar/pango/1.46.2/include/pango-1.0", "-I/usr/local/Cellar/pango/1.46.2/include/pango-1.0", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/harfbuzz/2.7.2/include/harfbuzz", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/graphite2/1.3.14/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/fribidi/1.0.10/include/fribidi", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/cairo/1.16.0_3/include/cairo", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/pixman/0.40.0/include/pixman-1", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/fribidi/1.0.10/include/fribidi", "-I/usr/local/Cellar/harfbuzz/2.7.2/include/harfbuzz", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/graphite2/1.3.14/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/cairo/1.16.0_3/include/cairo", "-I/usr/local/Cellar/glib/2.66.2_1/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/libffi/3.3/include", "-I/usr/local/Cellar/glib/2.66.2_1/include/glib-2.0", "-I/usr/local/Cellar/glib/2.66.2_1/lib/glib-2.0/include", "-I/usr/local/opt/gettext/include", "-I/usr/local/Cellar/pcre/8.44/include", "-I/usr/local/Cellar/pixman/0.40.0/include/pixman-1", "-I/usr/local/Cellar/fontconfig/2.13.1/include", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/opt/freetype/include/freetype2", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/libtiff/4.1.0/include", "-I/usr/local/Cellar/libspng/0.6.1/include", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/libpng/1.6.37/include/libpng16", "-I/usr/local/Cellar/zlib/1.2.11/include", "-I/usr/local/Cellar/libimagequant/2.13.0/include", "-I/usr/local/Cellar/jpeg/9d/include", "-I/usr/local/Cellar/libexif/0.6.22/include"], libs: ["-L/usr/local/Cellar/vips/8.10.2_1/lib", "-lvips", "-L/usr/local/Cellar/glib/2.66.2_1/lib", "-lgobject-2.0", "-L/usr/local/Cellar/glib/2.66.2_1/lib", "-lglib-2.0", "-L/usr/local/opt/gettext/lib", "-lintl"], diagnostics: [])

Summary

So there seems to be a bug in the pc file lookup / parsing in the release/5.3 branch. In main everything seems to work as expected.

Is this bug already tracked somewhere? Is there an upcoming Swift 5.3 bugfix release that will contain this fix?

The SwiftPM team are on thanksgiving break and so I doubt they'll respond promptly. My suggestion, as always, is that instead of asking whether a bug already tracks this you begin by simply filing a bug of your own. The absolute worst-case is that it's marked as a duplicate.

Thanks, Cory, I filed a bug: [SR-13920] [SPM] 5.3 - PkgConfig.init: Assertion failed: file TSCBasic/Path.swift, line 672 · Issue #4464 · apple/swift-package-manager · GitHub

You will most likely have to wait for 5.4 to get this fix in a release version, see this for more information on that version.

No worries, thanks for taking a look!