-
Notifications
You must be signed in to change notification settings - Fork 821
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
Support Linux by upgrading XcodeProj and Spectre #988
Conversation
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.
This is fantastic, nice work across all 3 repos @elliottwilliams! 👏
Could you please add a changelog entry as well, under Added
@@ -42,7 +42,7 @@ class GlobTests: XCTestCase { | |||
} | |||
|
|||
private func newTmpDir() -> String { | |||
var tmpDirTmpl = "/tmp/glob-test.XXXXX".cString(using: .utf8)! | |||
var tmpDirTmpl = "/tmp/glob-test.XXXXXX".cString(using: .utf8)! |
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.
Out of curiosity, what caused this change?
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.
This was a weird one! In glibc, mkstemp
requires that exactly six characters are X
's:
The last six characters of template must be "XXXXXX" and these are replaced with a string that makes the filename unique. Since it will be modified, template must not be a string constant, but should be declared as a character array.
The BSD call only asks for "some number of `Xs' appended to it".
Tests/LinuxMain.swift
Outdated
tests += ProjectSpecTests.__allTests() | ||
tests += XcodeGenKitTests.__allTests() | ||
|
||
XCTMain(tests) |
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.
We could potentially replace the contents of this file with
// LinuxMain.swift
fatalError("Run the tests with `swift test --enable-test-discovery`.")
And then delete all the XCTestManifests, as per https://oleb.net/2020/swift-test-discovery/
They changed because of a bugfix in XcodeProj: tuist/XcodeProj#563
Thanks so much for the quick turnaround! |
Hey there – I've been working upstream changes to XcodeProj and Spectre to get XcodeGen building and running on Linux hosts. Since both projects have made releases, I'm ready to move on to XcodeGen itself!
Linux support is obviously a little esoteric, but I think it's valuable for users that want to integrate XcodeGen into automated systems which are linux-based. For example: at Yelp, we have a ton of Linux CI capacity and lots of infra that makes it easy to run git-based workflows on linux servers, and being able to use XcodeGen from them would simplify things.
This branch passes tests on Ubuntu 18.04 using Docker and the official swift 5.3 image: