Skip to content
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

Linux testing on CI #90

Merged
merged 6 commits into from
Aug 29, 2018
Merged

Linux testing on CI #90

merged 6 commits into from
Aug 29, 2018

Conversation

janderit
Copy link

@janderit janderit commented Jul 3, 2018

Note: This PR originally fixed some bugs with NSString on Linux. That has been fixed in #94. Now this PR is for testing SPM support on Linux.

StencilSwiftKit was not usable building on Linux due to two string to NSString coercions. The Linux swift compiler does not recognize the coercion.

Replacing them with NSString(string: ...) allows building projects using StencilSwiftKit on Linux.

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this PR, this is awesome to have StencilSwiftKit made compatible with Linux 👍

I don't have a Linux machine to test it and our CI isn't configured to test on Linux yet so I'll trust you tested it locally 😉

Can you just please add an entry in the CHANGELOG to mention the change (eg "added Linux compatibility" or something) and credit yourself? Thanks!

As a bonus it would be even better if you could also edit the circleci.yml to add a Linux container to our CI config so that we ensure that we won't introduce a regression on Linux in future versions of the lib 🙂

@djbe
Copy link
Member

djbe commented Jul 4, 2018

Totally agree with @AliSoftware, if we add Linux support we should test it on CI.

@djbe djbe force-pushed the LinuxCompatibility branch 4 times, most recently from 53f2a81 to ff94edd Compare July 14, 2018 21:23
@djbe
Copy link
Member

djbe commented Jul 14, 2018

Yeah so, ruby is missing from that docker image (for linux), so no gem or bundler commands... Anyone have a docker image handy that fits our requirements, or wants to create one?

@djbe djbe force-pushed the LinuxCompatibility branch 8 times, most recently from 51163a2 to f6f1dbc Compare July 16, 2018 10:59
@djbe
Copy link
Member

djbe commented Jul 16, 2018

Right, so I've finally got linux tests working on CI. We should update the job names GitHub expects after the merge.

Note that this introduces LinuxMain.swift and XCTestManifests.swift, both files are autogenerated by swift test --generate-linuxmain. We can keep using this (and should add a Rake task for it), or use Sourcery to generate the needed code.

@djbe djbe force-pushed the LinuxCompatibility branch 3 times, most recently from ae30d24 to f40f5a8 Compare July 16, 2018 14:24
@djbe
Copy link
Member

djbe commented Aug 24, 2018

Oh hey, forgot about this, we merged #94 that fixes a similar issue 😅. I'll rebase this PR to just add the linux support part.

@djbe djbe changed the title Linux Compatibility: replaced NSString coercion with constructor call Linux testing Aug 28, 2018
@djbe djbe changed the title Linux testing Linux testing on CI Aug 28, 2018
@djbe
Copy link
Member

djbe commented Aug 28, 2018

@RahulKatariya With what Swift version did you run the tests on Linux?

There's a bug (apple/swift-corelibs-foundation#1536) that causes our Linux tests to crash when using NSString.standardizingPath (used by Path.normalize()). It's been fixed, but no idea in which Swift version (we're using 4.1.x).

@djbe
Copy link
Member

djbe commented Aug 28, 2018

Checked and the fix is neither in the swift 4.1 or 4.2 branches, only in master. @AliSoftware do you think they'd be open to cherry-picking that change into those branches, and would we go about it? Comment on that PR? Open an issue?

@AliSoftware
Copy link
Contributor

AliSoftware commented Aug 28, 2018

For reference, we've pinged some Swift core team members, and @millenomi told us they'll look into merging apple/swift-corelibs-foundation#1536 soon, but that it will not be included in the upcoming release of Swift anyway (too late already). So we'll have to rely on a workaround (at least in the test suite, if a local fix is possible without requiring a dedicated version of PathKit just for that workaround, preferably)

@rahul0x24
Copy link
Contributor

rahul0x24 commented Aug 28, 2018

@djbe The path methods were causing the compilation error on Linux, I didn't really use them.

@djbe djbe merged commit bb70145 into SwiftGen:master Aug 29, 2018
@djbe
Copy link
Member

djbe commented Aug 29, 2018

@AliSoftware I'm merging this now as it's "fixed", we can revisit this later if we want, but at least we won't block the PRs in SwiftGen anymore.

@AliSoftware
Copy link
Contributor

I'm ok with merging to avoid waiting.

A comment in the code referencing
apple/swift-corelibs-foundation#1536 would have been nice though, to understand why we do that #if os(Linux) workaround and to be able to quickly check when it's possible to remove the workaround in the future.

@djbe djbe added this to the 2.6.0 milestone Oct 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants