-
Notifications
You must be signed in to change notification settings - Fork 439
Use local git package for code gen #1546
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
Use local git package for code gen #1546
Conversation
@swift-ci plese test |
The problem is that CI checks out swift-syntax with |
Oh shot... 🙈 Se discussed something in a PR before. |
I thought that we could reference the git repository and use And I have a horrible idea. Inside One thing that I haven’t figured out yet is how to launch Do you want to give it a try? import Foundation
let stdout = Pipe()
let stderr = Pipe()
var data = Data()
let process = try! Process()
process.executableURL = URL(fileURLWithPath: "/usr/bin/git")
process.arguments = ["-C", "/Users/alex/syntax", "rev-parse", "HEAD"]
process.standardOutput = stdout
stdout.fileHandleForReading.readabilityHandler = { handle in
data.append(handle.availableData)
}
stderr.fileHandleForReading.readabilityHandler = { _ in /* ignored */ }
try process.run()
process.waitUntilExit()
let commit = String(decoding: data, as: UTF8.self) |
066c49e
to
094c53d
Compare
After some thinking I tought that just referring to the local path would give me the same? When referring to the local folder there will be a possibility to generate some code that will break code generation. What do you think? |
094c53d
to
f5228ef
Compare
There is a subtle difference here. While you’re developing locally, your HEAD will not have any changes in your working copy, so even if you mess up your |
I see. I'll try to come up with something 😁 |
f5228ef
to
0f6e732
Compare
@swift-ci please test |
@ahoppen i tried to use |
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.
Oh, that’s beautiful. I wonder what I did wrong to not get it to work. Maybe I was using branch
instead of revision
🤔
I don’t think this will affect CI in any way right now since we aren’t building CodeGeneration in CI at all. You’d need to add that flag to https://github.com/apple/swift/blob/main/utils/swift_build_support/swift_build_support/products/swiftsyntax.py
69a3c75
to
8c6372e
Compare
8c6372e
to
b864b6a
Compare
@swift-ci please test macOS |
Got an error 🥳
|
eedcb4d
to
bd41c3b
Compare
@swift-ci please test |
bd41c3b
to
fb76cf7
Compare
@swift-ci please test |
@swift-ci please test windows |
@swift-ci please test Linux |
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.
Wohooo. This is great 🎉 Could you add a sentence of two of how CodeGeneration references to CodeGeneration/README.md
?
fb76cf7
to
c90e443
Compare
c90e443
to
8f6eb73
Compare
@swift-ci please test |
@swift-ci please test windows |
I'm not sure if it need to be enabled in the CI or if I need to do something in the
build-script.py
Tested locally by adding some white space in the template and got