scinfu / SwiftSoup

SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS)
https://scinfu.github.io/SwiftSoup/
MIT License
4.53k stars 345 forks source link

SwiftSoup not building on Swift-Linux 4.2 #101

Closed hactar closed 6 years ago

hactar commented 6 years ago

When trying to build a project that includes SwiftSoup on Swift-Linux 4.2, the compilation fails:

1.  While verifying SIL function "@$S9SwiftSoup4NodeC16OuterHtmlVisitor33_88DB12878250A47CDE78A89F4976DAEELLC4tailyyAC_SitKF".
 for 'tail(_:_:)' at /root/project/.build-ubuntu/checkouts/SwiftSoup.git--3976131514847736029/Sources/Node.swift:752:14
<unknown>:0: error: unable to execute command: Aborted
<unknown>:0: error: compile command failed due to signal 6 (use -v to see invocation)

This appears to be happening on SwiftSoups own TravisCI too:

https://travis-ci.org/scinfu/SwiftSoup/jobs/438795328

0xTim commented 6 years ago

Looks like this PR broke it - the tests were failing when the PR was merged.

Can we not merge PRs that fail CI? It kinda defeats the point of having CI if you ignore the results and breaks it for people like above

hactar commented 6 years ago

I don't think that PR actually broke it, if you take a look at the PR its just a readme update. What I think happened is that the CI invisibly updated to swift 4.2 between builds, and now it's failing. I've taken a deeper look and I've noticed that and from what I see is that swift build on swift linux 4.2 works, but swift build -c release fails, so this may be a swift linux issue... I'm not a SIL expert I'm afraid.

0xTim commented 6 years ago

Didn't link the PR! It was this one - https://github.com/scinfu/SwiftSoup/pull/97/

That set the swift tools version to 4.2. The Dockerfile is pulling in swift:latest so when 4.2 was released it used that.

Having said that, there has been an issue raised with Vapor as well for old Vapor 2 code failing to compile on Linux in release mode. People are looking at it

hactar commented 6 years ago

Ah, cool, yeah.

I think I've found a workaround (removing the "saves a void hit." optimization) - doing a few more tests. I'm not sure why it solves the problem as the code looks good, but it might be a workaround until the issue can be properly resolved.