2

macOS Height Sierra 10.13.4
Xcode version 9.3

$ swift --version
Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
Target: x86_64-apple-darwin17.5.0

$ brew info vapor
vapor/tap/vapor: stable 3.1.4.l
https://vapor.codes
/usr/local/Cellar/vapor/3.1.4.l (4 files, 17.0MB) *
  Built from source on 2018-04-01 at 23:55:47
From: https://github.com/vapor/homebrew-tap/blob/master/vapor.rb
==> Dependencies
Required: ctls ✔, libressl ✔

$ eval "$(curl -sL check.vapor.sh)"
✅  Xcode 9 is compatible with Vapor 2.
✅  Xcode 9 is compatible with Vapor 3.
✅  Swift 4.1 is compatible with Vapor 2.
✅  Swift 4.1 is compatible with Vapor 3.

$ vapor version
Vapor Toolbox: 3.1.4

I create new project with:

vapor new Hello --template=api

and when I try to build it:

vapor build --verbose

I get the error:

No .build folder, fetch may take a while...
Fetching Dependencies ...
warning: 'fetch' command is deprecated; use 'resolve' instead
/PATH-TO-PROJECT: error: manifest parse error(s):
<module-includes>:5:9: note: in file included from <module-includes>:5:
#import "copyfile.h"
        ^      
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/copyfile.h:36:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Develo. per/SDKs/MacOSX10.13.sdk
/usr/include/copyfile.h:36:
#include <stdint.h>
         ^
/usr/local/include/stdint.h:59:11: note: in file included from /usr/local/include/stdint.h:59:
# include <stdint.h>
          ^
/usr/local/include/stdbool.h:4:10: note: in file included from /usr/local/include/stdbool.h:4:
#include <stdbool.h>
         ^

<unknown>:0: error: could not build Objective-C module 'Darwin'
Building Project [Failed]
Error: execute(1)

Does anyone have any idea what is going wrong there? Thanks in advance!

xac
  • 310
  • 3
  • 9

3 Answers3

1

I found the solution:

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/base.h
  /usr/local/include/bcj.h
  /usr/local/include/block.h
  /usr/local/include/cdefs.h
  /usr/local/include/check.h
  ...

and solved the problem by deleting all "Unbrewed header files" from /usr/local/include/

xac
  • 310
  • 3
  • 9
0

That is bizarre! Just to confirm you’re in the right folder? If you run swift build does it do the same thing?

0xTim
  • 5,146
  • 11
  • 23
0

I had a similar issue unrelated to brew.

Error: backgroundExecute(code: 1, error: "/path/to/project: error: manifest parse error(s):\nInvalid version string: x.0.0\n", output: "")

My Package file looked like this;

...
.package(url: "https://github.com/../something.git", .upToNextMajor(from: "x.0.0")),
...

Looking into .upToNextMajor(from:) I didn't see any parsing for 'x' so I just went to the github page and found which major version I wanted and replaced it for the placeholder in my package file:

...
.package(url: "https://github.com/../something.git", .upToNextMajor(from: "1.0.0")),
...

This resolved the issue for me, Hope this helps the next person that comes by! upvote if it helps you!

RLoniello
  • 2,309
  • 2
  • 19
  • 26