-
Notifications
You must be signed in to change notification settings - Fork 145
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
New build system #109
New build system #109
Conversation
That sounds interesting. I agree with all the issues you listed for binary swift packages. The only way I have to force update for a specific package is to delete it and then add it again. It's really not convenient. It would be good to invite comments by other users of these packages. |
I forget to add, that to build all xcframeworks you can run |
👋 |
Thank you very much. That PR will be extremely useful and valuable. I'll review it tonight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry if this is none of my business, but I'm concerned about a few things.
try cd(".build") { | ||
let zip = "\(scheme).xcframework.zip" | ||
try sh("zip -r \(zip) \(scheme).xcframework") | ||
let chksum = try sha(path: zip) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should use swift package compute-checksum
instead of shasum
because its checksum implementation may be changed in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I will monitor that change. I don't know why this swift package compute-checksum
requires manifest to do it's job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
the line let chksum = try sha(path: zip)
does not work with swift 5 (the error message says: Illegal instruction
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@holzschu
Local or GitHub actions? How I can repro that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have only tested local actions. I assume it affects all package building using Fmake. To reproduce: clone this repository, type swift run --package-path xcfs build
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local is fine, see logs:
https://gist.github.com/yury/5cfb388d69bfaf271c3c8ee39824cfbc
yury@mbpm1 ~ % swift --version
swift-driver version: 1.26.9 Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)
Target: x86_64-apple-macosx12.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for testing. I'm puzzled: what could be causing the Illegal instruction
error? I'll keep searching.
zip --symlinks -r ios_system.xcframework.zip ios_system.xcframework
Swift/ErrorType.swift:200: Fatal error: Error raised at top level: FMake.BuildError.unexpectedStatusCode
./createXcFrameworks.sh: line 2: 51765 Illegal instruction: 4 swift run --package-path xcfs build
|
||
_ = Package( | ||
name: "deps", | ||
platforms: [.macOS("11")], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to drop support for macOS Catalina or earlier as a build environment?
let args = ProcessInfo.processInfo.arguments | ||
|
||
var schemes: [String] | ||
if args.count > 1 && args[1] != "all" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to use swift-argument-parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You recommend to replace 3 lines of code with another 3 lines of code + 1mb of code dependency....
I don't think it is worth it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right for now, but I think it's worth replacing for readability and extensibility of code. swift-argument-parser is de facto standard to create a CLI tool in Swift now.
Cool! Can you create tag v2.7.0 for test? GitHub Actions will build all frameworks |
It is done. |
Pre:
I think Xcode builtin spm support is very sad.
DerivedData
you have to close Xcode and redownload all deps (with xcframeworks they are really heavy)DerivedData
)I propose to use Package.swift directly and reference deps XCFrameworks from .build/artifacts
I put Package swift in
xcfs
(read as xcframeworks) folder. And change reps in targets toxcfs/.build/artifacts/xcfs/....
so we have relative paths to XCFrameworks now.Another improvements:
Other thoughts and plans: