Status Swift 5/Xcode Fuzzing support?

Should the -sanitize=fuzzer work with Xcode 10.2 Beta 2?

$ swift build -c release -Xswiftc -sanitize=fuzzer -Xswiftc -parse-as-library
<unknown>:0: error: unsupported option '-sanitize=fuzzer' for target 'x86_64-apple-macosx10.10'
$ xcodebuild -version
Xcode 10.2
Build version 10P91b
$ swiftc --version
Apple Swift version 5.0 (swiftlang-1001.0.60.3 clang-1001.0.37.8)
Target: x86_64-apple-darwin18.2.0
ABI version: 0.7

No, -sanitize=fuzzer is not supported and is only available in toolchains from swift.org

Is there a reason for that?

As a library maintainer, it would be nice to be able to rely on it being part of the Xcode distros since that's what most developers on Apple platforms will have.

1 Like

We opened rdar://47920434 also to try and get it included.

1 Like

which specific toolchain? Tried several dev snapshots & swifting toolchain in Xcode, but all are showing unknown argument as Thomas said.

@tkremenek any chance we can get some clarity on why there are differences in the two Swift distributions (Xcode vs. swift.org) and what the reasoning is for those differences?

The subtly of two things called a given Swift version number is going to continue to confuse things; and I must admit I'm sorta struggling to see any benefits from developers consuming Swift, so the difference seem like they must be some advantages internally to Apple only?

btw @thomasvl were you been able to get this working even using dev distributions on swift.org?

I have tried several versions but I always get this same issue:

<unknown>:0: error: unsupported option '-sanitize=fuzzer' for target 'x86_64-apple-macosx10.10'

It seems like some people have gotten this working using dev snapshots, that would be alright for my current usecase... but can't seem to figure out what dev snapshots works, have tried a lot both latest and older -_-... wonder if this is still working for some people?

@Nadohs, sorry, since it isn't in the stock Xcode distros, I sorta punted as I knew it wouldn't get run for my project often and would thus likely rot.

With the whole Swift Server push, I'd really like to see someone from Apple explain why they see value in having different distros. Making sure Xcode installs have all the same support as the linux ones seem like a required step in helping make the server support easy to also work on.

Sorry for the delay in responding.

What ships in Xcode (or any IDE) is something that a vendor (in this case Apple) officially supports as tool features developers using those vended tools can rely upon. That means the features in those tools have gone through a satisfactory level of productization, qualification, etc., so that developers can rely on those features.

What is in the open source toolchains represent a superset of potential features any tools vendor may want to support. Making those available in the master snapshots makes sense. It may be worth going over those list of WIP features that are in the release builds on Swift.org and looking to prohibit using them. There are tradeoffs there, as many of those may be useful features on their own right now to some set of people even if more broadly the feature isn't more generally ready or supported.