shibapm / packageconfig Goto Github PK
View Code? Open in Web Editor NEWA Swift Package that allows you to define configuration settings inside a Package.swift
License: MIT License
A Swift Package that allows you to define configuration settings inside a Package.swift
License: MIT License
The issue is due to the fact that xcrun
is called which does not exist on linux.
What is the reason for using xcrun
vs just doing something like command -v swiftc
to get the path to the swiftc
binary?
At this moment, PackageConfig uses the following command to compile the Package.swift file:
/Applications/Xcode-11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc --driver-mode=swift -L /Applications/Xcode-11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/4_2 -I /Applications/Xcode-11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/4_2 -lPackageDescription -L .build/debug -I .build/debug -lPackageConfig -suppress-warnings Package.swift
Which throws errors:
Package.swift:6:15: error: 'init(name:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)' is unavailable
let package = Package(
^~~~~~~
PackageDescription.Package:29:12: note: 'init(name:platforms:pkgConfig:providers:products:dependencies:targets:swiftLanguageVersions:cLanguageStandard:cxxLanguageStandard:)' was introduced in PackageDescription 5
public init(name: String, platforms: [PackageDescription.SupportedPlatform]? = nil, pkgConfig: String? = nil, providers: [PackageDescription.SystemPackageProvider]? = nil, products: [PackageDescription.Product] = [], dependencies: [PackageDescription.Package.Dependency] = [], targets: [PackageDescription.Target] = [], swiftLanguageVersions: [PackageDescription.SwiftVersion]? = nil, cLanguageStandard: PackageDescription.CLanguageStandard? = nil, cxxLanguageStandard: PackageDescription.CXXLanguageStandard? = nil)
^
Package.swift:45:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
.target(
^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
^
Package.swift:49:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
.target(
^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
^
Package.swift:53:10: error: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' is unavailable
.target(
^~~~~~
PackageDescription.Target:34:24: note: 'target(name:dependencies:path:exclude:sources:publicHeadersPath:)' was introduced in PackageDescription 4
public static func target(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil, publicHeadersPath: String? = nil) -> PackageDescription.Target
^
Package.swift:57:10: error: 'testTarget(name:dependencies:path:exclude:sources:)' is unavailable
.testTarget(name: "MiniSwiftTests",dependencies: ["Mini", "TestMiddleware", "NIOConcurrencyHelpers", "RxSwift", "Nimble", "RxTest", "RxBlocking"]) // dev
^~~~~~~~~~
PackageDescription.Target:38:24: note: 'testTarget(name:dependencies:path:exclude:sources:)' was introduced in PackageDescription 4
public static func testTarget(name: String, dependencies: [PackageDescription.Target.Dependency] = [], path: String? = nil, exclude: [String] = [], sources: [String]? = nil) -> PackageDescription.Target
My swift-tools-version is 5.0, but i can't find the directory for the PackageDescription lib anywhere in the system. The command have surely changed with Xcode 11.
Hi,
Swift Package Manager has issues when two dependencies contain the same target name (https://forums.swift.org/t/multiple-target-issue-with-spm/16696).
The targets should be named properly to avoid conflicts with other libraries.
While running Komondor, I get this warning message in the logs :
... PackageConfig/Sources/PackageConfig/DynamicLibraries.swift:46:37: warning: 'encodedOffset' is deprecated: encodedOffset has been deprecated as most common usage is incorrect. Use utf16Offset(in:) to achieve the same behavior.
return String($0.prefix(comment.encodedOffset))
Komondor v 1.0.4
PackageConfig v 0.13.0
Apple Swift version 5.3.1 (swiftlang-1200.0.39 clang-1200.0.32.6)
Target: x86_64-apple-darwin19.6.0
Hi,
Thank you for this great library! I've start using it recently and I came across a small problem.
The library looks by default in the .build
folder for the libPackageConfig.
So, when I run the following on my package, for example:
swift build && cd .build/debug/ && ./my-executable
The result is that it cannot find the .build
folder. The same happens when moving the binary in the /usr/local/bin
path, which sort of make it un-usable together with Mint
Is there any plan to overcome this issue? Is it even considered as an issue?
Thank you very much
Somehow the runtime/compilation aspect will need to expose the set of library targets to the eval phase
#if canImport(PackageConfig)
import PackageConfig
import Danger
// Generic
let config = PackageConfig([
"linter": ["rules": ["allowSomething"]]
])
// Extension provided by Danger
config.danger = [
.disabled(true)
]
#endif
The settings will need to be coerced though the JSON and back somehow, but maybe codable can do that?
Greetings.
I'd be using this library through Komondor without any issue until the last Swift 5.5 release, where PackageConfig no longer is able to compile nor generate the JSON config files needed for the other tools to work. This is the whole build:
CMD: /usr/bin/xcrun --find swiftc
Using SPM version: /Applications/Xcode-13.0.0-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/libPackagePlugin.dylib
CMD: /Applications/Xcode-13.0.0-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc --driver-mode=swift -L /Applications/Xcode-13.0.0-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/libPackagePlugin.dylib -I /Applications/Xcode-13.0.0-Release.Candidate.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/libPackagePlugin.dylib -lPackageDescription -package-description-version 5.5 -L .build/debug -I .build/debug -lPackageConfig -suppress-warnings Package.swift
Package.swift:4:8: error: no such module 'PackageDescription'
import PackageDescription
^
Finished launching swiftc
Error(reason: "Could not find a file at /var/folders/x6/dpg51cd946x8w__7znsbz5x00000gq/T/example.config.json - something went wrong with compilation step probably")
I use to Komondor via Mint.
But Komondor fail and error messages are below.
$ mint run Komondor
๐ฑ Cloning Komondor 1.0.6
๐ฑ Resolving package
๐ฑ Building package
๐ฑ Installed Komondor 1.0.6
๐ฑ Running komondor 1.0.6...
dyld: Library not loaded: @rpath/libPackageConfig.dylib
Referenced from: /usr/local/lib/mint/packages/github.com_shibapm_Komondor/build/1.0.6/komondor
Reason: image not found
[1] 52719 abort mint run Komondor
How to resolve this dylib path? Please teach me any information.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.