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

Archiving is stucked on Xcode 11 beta 3 #116

Closed Igor-Palaguta closed 5 years ago

Igor-Palaguta commented 5 years ago

In new Xcode 11 beta 3 carthage is stucked during building SwiftSoup. Same effect when archiving directly from Xcode

Some issue during optimizations. After disable optimizations for release everything works

SWIFT_OPTIMIZATION_LEVEL = -Onone
xiaochuan4938 commented 5 years ago

It is also stucked in Xcode 11 beta 4

rectangular commented 5 years ago

And beta 5!

funkenstrahlen commented 5 years ago

Have you all reported this bug to Apple? This definitely needs to get fixed on their side.

funkenstrahlen commented 5 years ago

Still not fixed in Xcode beta 6.

imWildCat commented 5 years ago

I reported it again just now.

Jeehut commented 5 years ago

Hey everyone, while it's not a real fix, as noted by @Igor-Palaguta a workaround is to set the SWIFT_OPTIMIZATION_LEVEL to -Onone for release builds. I've done exactly that in my fork, feel free to use it's master branch instead of this original repo when installing via Carthage or Accio. Unfortunately, it seems the will not merge it, as can be seen by my long term open PR https://github.com/scinfu/SwiftSoup/pull/117.

In Accio, use this entry instead:

.package(url: "https://github.com/Dschee/SwiftSoup.git", .branch("master")),

In Carthage, use that:

github "Dschee/SwiftSoup" "master"
daniel-beard commented 5 years ago

It's quite slow, but the latest swift toolchain snapshot has a fix for this issue: https://github.com/apple/swift/commit/378c6adbd625f1c1f568fa28116be3335506082f#diff-8b0154fba360507e6f59f3a0c8e98d1a

I can confirm that SwiftSoup archives when using this snapshot: https://github.com/apple/swift/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2019-08-27-a

funkenstrahlen commented 5 years ago

Awesome! Do you know when this might be part of Xcode officially?

daniel-beard commented 5 years ago

@funkenstrahlen I have no idea, but I'm hoping it will be part of Xcode 11 release.

kylebrowning commented 5 years ago

It's still not in the master snapshot for 5.1

imWildCat commented 5 years ago

It looks like this issue is not fixed in Xcode 11 GM released today?

nicolas-miari commented 5 years ago

I can manually change the optimization levels on my local machine (everytime carthage checks out the sources, and before building), but I also have continuous integration set up on a server, not sure how I could apply the workaround there.

I wonder what is so special in the SwiftSoup source code that triggers the issue... Isn't there a way to work around this at the source code level until Apple fixes the issue on their end? I have several other dependencies, but none of them suffer of anything similar...

funkenstrahlen commented 5 years ago

It does compile with the latest swift trunk snapshot: https://swift.org/download/#snapshots

However Apple does not allow submitting builds to the App Store that are not compiled with the Xcode default toolchain.

So I just disabled optimization as described here and can live with this for now.

scinfu commented 5 years ago

I merged @Dschee PR with SWIFT_OPTIMIZATION_LEVEL to -Onone. Can someone confirm is fixed? I do not use Carthage. Thank you

kkla320 commented 5 years ago

Using Xcode 11 GM and SwiftSoup with the PR from @Dschee doesn't work for me. The build is still stuck.

Edit: I am developing an app for IOS and saw that only for tvOS the optimization level was changed. I forked the repo and created a new PR for all targets.

catluc commented 5 years ago

Same for me @kkla320, your merge @scinfu still doesnt work in last XCode 11 GM with Carthage, same error since Xcode 11 beta 3!!

funkenstrahlen commented 5 years ago

@catluc Please do not be too aggressive. This is an Swift Compiler bug and you should be angry with Apple not shipping the fix in Xcode GM.

kylebrowning commented 5 years ago

It’ll be fixed When swift 5.1 drops is my guess

catluc commented 5 years ago

@funkenstrahlen I am still not seeing were is the agressive part, @scinfu was asking for feedback in previous comment, and i gave him that feedback, I am very aware that Apple needs to fix their bugs.

lawgimenez commented 5 years ago

So, this is the culprit. I can't release my build because of this bug.

kylebrowning commented 5 years ago

I know not everyone will be able to do this, but we just removed SwiftSoup and moved on with our lives.

ghost commented 5 years ago

Same for me @kkla320, your merge @scinfu still doesnt work in last XCode 11 GM with Carthage, same error since Xcode 11 beta 3!!

The same thing is happening to me in Xcode 11 GM 2. This must be fixed soon, either by Apple (if it's their end) or the developers of Swift Soup (if it's their end).

nicolas-miari commented 5 years ago

I know not everyone will be able to do this, but we just removed SwiftSoup and moved on with our lives.

I'm about to do the same. My app only uses SwiftSoup to retrieve a single URL from the src attribute of an <a href> tag within a bloated HTML document with huge commented-out sections and even those IE hacks from the 00's in place. The guy who first developed my app seems to think dependencies are some sort of magic wand, free of consequences and hassles, use as many as you want, even for the most trivial reasons.

I asked my server-side team to provide a dedicated API that just gives me the URL straight; should be ready any time now.

SwiftSoup is a great framework for people who really need it. But personally, I believe using HTML (and web views) in a native app is an abomination, a necessary evil at best.

lawgimenez commented 5 years ago

Removed this framework and was able to publish on TestFlight. I migrated to another framework that works.

tomxu2k commented 5 years ago

Removed this framework and was able to publish on TestFlight. I migrated to another framework that works. Would you please teach me the name of framework you migrated?

scinfu commented 5 years ago

Thank you to @kkla320 for PR. Now seem fixed also in my test.

Feel free to reopen this issue if bug persits.

WillBishop commented 5 years ago

I still not able to get it to build. It still hangs during the archive.

scinfu commented 5 years ago

Hi i added new version 2.2.1. Previously made fixes were not included in a version. Let me find out if the problem persists

imWildCat commented 4 years ago

According to my observation, this issue has been addressed in Xcode 11.2 (11B52).

cc @scinfu @gottesmm