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

Build Error: (aka 'ContiguousArray<Int8>') has no member 'withUnsafeMutableBytes' #2

Closed
lvdaqian opened this issue Feb 22, 2017 · 1 comment

Comments

@lvdaqian
Copy link
Contributor

Hi yonaskolb,

You do a great job. But I met some build error when I build swagGen

My env is

Mac OS X EI Capitan 10.11.6
Xcode 8.0 (8A218a)
$ swift --version
Apple Swift version 3.0 (swiftlang-800.0.46.2 clang-800.0.38)
Target: x86_64-apple-macosx10.9

The error log is:

$ swift build
Cloning https://github.com/kylef/PathKit.git
HEAD is now at 4597ab8 Release 0.7.0
Resolved version: 0.7.0
Cloning https://github.com/kylef/Spectre
HEAD is now at e46b75c chore: Release 0.7.2
Resolved version: 0.7.2
Cloning https://github.com/kylef/Commander.git
HEAD is now at 9304bbf chore: Release 0.6.0
Resolved version: 0.6.0
Cloning https://github.com/yonaskolb/Stencil.git
HEAD is now at ffd8804 added tests
Resolved version: 0.7.3
Cloning https://github.com/jpsim/Yams.git
HEAD is now at 71e81e9 release 0.2.0
Resolved version: 0.2.0
Cloning https://github.com/lucianomarisi/JSONUtilities.git
HEAD is now at a7aa1d6 Merge pull request #10 from lucianomarisi/chore/prepare-for-3.2.0-release
Resolved version: 3.2.0
Compile CYaml src/writer.c
Compile CYaml src/scanner.c
Compile CYaml src/reader.c
Compile CYaml src/parser.c
Compile CYaml src/loader.c
Compile CYaml src/emitter.c
Compile CYaml src/dumper.c
Compile CYaml src/api.c
Compile Swift Module 'JSONUtilities' (8 sources)
Compile Swift Module 'Spectre' (8 sources)
Linking CYaml
Compile Swift Module 'Yams' (9 sources)
Compile Swift Module 'PathKit' (1 sources)
Compile Swift Module 'Commander' (9 sources)
Compile Swift Module 'Stencil' (19 sources)
/Users/secwit/Code/SwagGen/Packages/Yams-0.2.0/Sources/Yams/Emitter.swift:324:13: error: value of type 'ContiguousArray<CChar>' (aka 'ContiguousArray<Int8>') has no member 'withUnsafeMutableBytes'
        _ = value.withUnsafeMutableBytes { value in
            ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~
/Users/secwit/Code/SwagGen/Packages/Yams-0.2.0/Sources/Yams/Emitter.swift:346:13: error: value of type 'ContiguousArray<CChar>' (aka 'ContiguousArray<Int8>') has no member 'withUnsafeMutableBytes'
        _ = tag.withUnsafeMutableBytes { tag in
            ^~~ ~~~~~~~~~~~~~~~~~~~~~~
/Users/secwit/Code/SwagGen/Packages/Yams-0.2.0/Sources/Yams/Emitter.swift:367:13: error: value of type 'ContiguousArray<CChar>' (aka 'ContiguousArray<Int8>') has no member 'withUnsafeMutableBytes'
        _ = tag.withUnsafeMutableBytes { tag in
            ^~~ ~~~~~~~~~~~~~~~~~~~~~~
/Users/secwit/Code/SwagGen/Packages/Yams-0.2.0/Sources/Yams/Parser.swift:130:9: error: value of type 'ContiguousArray<CChar>' (aka 'ContiguousArray<Int8>') has no member 'withUnsafeBytes'
        utf8CString.withUnsafeBytes { bytes in
        ^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/Users/secwit/Code/SwagGen/Packages/Stencil-0.7.3/Sources/Loader.swift:55:14: warning: no calls to throwing functions occur within 'try' expression
      return try environment.templateClass.init(templateString: content, environment: environment, name: name)
             ^
/Users/secwit/Code/SwagGen/Packages/Stencil-0.7.3/Sources/Loader.swift:68:18: warning: no calls to throwing functions occur within 'try' expression
          return try environment.templateClass.init(templateString: content, environment: environment, name: templateName)
                 ^
<unknown>:0: error: build had 1 command failures
error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/secwit/Code/SwagGen/.build/debug.yaml
@lvdaqian
Copy link
Contributor Author

It is ok when I upgrade the xCode. withUnsafeMutableBytes is the new api for ContiguousArray just after xCode 8.0

yonaskolb pushed a commit that referenced this issue Oct 21, 2019
# This is the 1st commit message:

Make all model conform to Codable by default

# The commit message #2 will be skipped:

# Update Fixture
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

No branches or pull requests

1 participant