fuzzilli icon indicating copy to clipboard operation
fuzzilli copied to clipboard

Build Failure on Linux (Swift 5.10.1): [[ Missing Darwin APIs sequence counting and type errors

Open shopifyjohncoulter-code opened this issue 3 months ago • 2 comments

Environment OS: Kali Linux (x86_64) Swift Toolchain: 5.10.1 Build Command: swift build -c release Fuzzilli Revision: (current main, as of November 2025)

Fuzzilli fails to compile on Linux using Swift 5.10.1 due to Darwin specific APIs operator overloading conflicts and sequence counting syntax that differs from macOS Swift Foundation implementations

Steps to Reproduce::::

git clone https://github.com/googleprojectzero/fuzzilli.git
cd fuzzilli
# get swift if not available in the system
swift build -c release

Representative errors:::: /Fuzzilli/Environment/JavaScriptEnvironment.swift:3224:125: error: type 'Locale' has no member 'NumberingSystem' /Fuzzilli/Environment/JavaScriptEnvironment.swift:3240:117: error: type 'Locale' has no member 'Currency' /Fuzzilli/Lifting/WasmLifter.swift:716:52: error: cannot call value of non-function type 'Int' temp += Leb128.unsignedEncode(self.exports.count { $0.getImport() != nil }) ... /Fuzzilli/Lifting/WasmLifter.swift:833:18: error: operator function '+=' requires that 'Data' conform to 'AttributedStringProtocol'

note::: /FuzzIL/WasmOperations.swift:1353:13: error: the compiler is unable to type check this expression in reasonable time

Causes::

  1. Darwin only locale extensions Locale.NumberingSystem and Locale.Currency are ( unavailable ) on linux Foundation.
  2. Sequence counting syntax differences Linux Swift requires .count(where:) or .filter(...).count instead of .count { predicate }
  3. Type mismatch with data and operator += += operator on data conflicts with AttributedStringProtocol overloads
  4. Complex chained expressions causing type check timeouts.

shopifyjohncoulter-code avatar Nov 13 '25 09:11 shopifyjohncoulter-code

Fuzzilli fails to compile on Linux using Swift 5.10.1

See also issue #499, we depend on Swift features that are only available on Swift 6.

Furthermore, since https://github.com/googleprojectzero/fuzzilli/commit/72eaa81577065acaed65227880ebcb16a686099f we depend on Swift 6.1.x as on 6.0.3 the Swift compiler crashes when compiling that change in release mode.

I would assume that all the 4 mentioned issues will disappear when switching to a newer toolchain. Most if not all our developers use Linux for their Fuzzilli development (Debian-based). We also use Linux both in our internal CI as well as on GitHub, see e.g. https://github.com/googleprojectzero/fuzzilli/actions/runs/19233695165/job/54980135062, so there shouldn't be any Darwin specific APIs used by Fuzzilli.

Liedtke avatar Nov 13 '25 10:11 Liedtke

Thanks for response, I'd shift to fixed version, Swift 6.2.1 for ubuntu 22.04

shopifyjohncoulter-code avatar Nov 13 '25 12:11 shopifyjohncoulter-code