DroidKaigi / conference-app-2020

The Official Conference App for DroidKaigi 2020 Tokyo
https://droidkaigi.jp/2020/en/
Apache License 2.0
775 stars 327 forks source link

[iOS] Failed to build SwiftGen #667

Closed nukka123 closed 4 years ago

nukka123 commented 4 years ago

Overview (Required)

Steps To Reproduce

  1. Go to ios_base directory.
  2. Run make init
  3. Failed to build SwiftGen 6.1.0 with SPM

Expected behavior the build to be success.

Env:

Error Log

mint run swiftgen swiftgen
🌱  Using SwiftGen/SwiftGen 6.1.0 from Mintfile.
🌱  Cloning SwiftGen 6.1.0
🌱  Resolving package
🌱  Building package
[1/10] Compiling writer.c
[2/10] Compiling scanner.c
[3/10] Compiling reader.c
[4/10] Compiling parser.c
[5/10] Compiling emitter.c
[6/10] Compiling api.c
[7/11] Compiling Kanna CSS.swift
/private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Modules/libxml2-kanna.h:1:9: note: while building module 'libxml2' imported from /private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Modules/libxml2-kanna.h:1:
#import <libxml2/libxml/HTMLtree.h>
        ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "libxml/HTMLparser.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/libxml2/libxml/HTMLparser.h:15:10: error: 'libxml/xmlversion.h' file not found
#include <libxml/xmlversion.h>
         ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "libxml2-kanna.h"
        ^
/private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Modules/libxml2-kanna.h:1:9: error: could not build module 'libxml2'
#import <libxml2/libxml/HTMLtree.h>
        ^
/private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/Kanna/Sources/Kanna/CSS.swift:27:8: error: could not build Objective-C module 'libxmlKanna'
import libxmlKanna
       ^
'SwiftClibxml2' /private/var/folders/r9/d3j1xpps38q2h51974d_hvgw0000gn/T/mint/github.com_SwiftGen_SwiftGen/.build/checkouts/SwiftClibxml2: warning: system packages are deprecated; use system library targets instead
🌱  Encountered error during "swift build -c release -Xswiftc -target -Xswiftc x86_64-apple-macosx10.15". Use --verbose to see full output
🌱  Failed to build SwiftGen 6.1.0 with SPM
make: *** [swiftgen] Error 1
roana0229 commented 4 years ago

Thank you for report. swiftgen require libxml2. see SwiftGen README

nukka123 commented 4 years ago

SwiftGen's README said

Installation To install SwiftGen via Mint, simply use: $ brew install libxml2 $ mint install SwiftGen/SwiftGen

After installed libxml2 by manually, the SwiftGen build will succeed.

nukka123 commented 4 years ago

@roana0229 thank you!

takahirom commented 4 years ago

I think it is good to add it to ios-base/README.md!

ry-itto commented 4 years ago

πŸ™‡