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

Can't build with Swift 5.1 with SwiftPM #151

Closed
mdiep opened this issue Jun 9, 2019 · 7 comments · Fixed by #154
Closed

Can't build with Swift 5.1 with SwiftPM #151

mdiep opened this issue Jun 9, 2019 · 7 comments · Fixed by #154
Labels
SwiftPM Issues related to integrating via SwiftPM

Comments

@mdiep
Copy link
Collaborator

mdiep commented Jun 9, 2019

Report

What did you do?

  1. Clone Down
  2. xcode-select Xcode 11 beta 1
  3. swift build

What did you expect to happen?

It should build.

What happened instead?

» swift build
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/scanners.c:3:
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/chunk.h:7:
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:5:10: error: 'cmark_export.h' file not found with <angled> include; use "quotes" instead
#include <cmark_export.h>
         ^~~~~~~~~~~~~~~~
         "cmark_export.h"
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:6:10: error: 'cmark_version.h' file not found with <angled> include; use "quotes" instead
#include <cmark_version.h>
         ^~~~~~~~~~~~~~~~~
         "cmark_version.h"
.
[0/19] Compiling libcmark xml.c

This also affects building Down as a SwiftPM package using the new support in Xcode 11.

@iwasrobbed
Copy link
Collaborator

iwasrobbed commented Jun 10, 2019

Happy to accept a PR for this (as it relates to #150 by @aasimk2000), but personally not using SwiftPM

Acceptance criteria: please no changing cmark source in any way (unless it's accepted into the upstream master repo). It needs to either work w/ build settings or SwiftPM won't be supported until that's possible

@iwasrobbed iwasrobbed added the SwiftPM Issues related to integrating via SwiftPM label Jun 10, 2019
@aasimk2000
Copy link
Contributor

Can you output what happens when you run swift build -v. I haven't been able to reproduce your error on Xcode 11 beta but did run into the same error when building on Linux.

@mdiep
Copy link
Collaborator Author

mdiep commented Jun 10, 2019

Happy to accept a PR for this, but personally not using SwiftPM

I totally understand. I opened it in case anyone watching was interested in fixing it, but I'll definitely try to come back around when I get a chance if no one beats me to it. (And I'm also not sure how to fix this one.)

Can you output what happens when you run swift build -v.

xcrun --sdk macosx --show-sdk-path
xcrun --sdk macosx --show-sdk-platform-path
xcrun --sdk macosx --find xctest
sandbox-exec -p '(version 1)
(deny default)
(import "system.sb")
(allow file-read*)
(allow process*)
(allow sysctl*)
(allow file-write*
    (regex #"^/private/var/tmp/org\.llvm\.clang.*")
    (regex #"^/var/folders/t1/0hp_mdnj14qbqb41mc221qkw0000gn/T/org\.llvm\.clang.*")
    (regex #"^/private/var/folders/t1/0hp_mdnj14qbqb41mc221qkw0000gn/T/org\.llvm\.clang.*")
    (regex #"^/private/var/folders/t1/0hp_mdnj14qbqb41mc221qkw0000gn/C/org\.llvm\.clang.*")
    (subpath "/Users/mdiep/Repositories/iwasrobbed/Down/.build")
)
' /Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc --driver-mode=swift -L /Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/4_2 -lPackageDescription -swift-version 5 -I /Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm/4_2 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk /Users/mdiep/Repositories/iwasrobbed/Down/Package.swift -fileno 7
xcrun --find clang
/Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fobjc-arc -target x86_64-apple-macosx10.11 -isysroot /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -index-store-path /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/index/store -fmodules -fmodule-name=libcmark -I /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/include -fmodules-cache-path=/Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/ModuleCache -MD -MT dependencies -MF /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/utf8.c.d -c /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/utf8.c -o /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/utf8.c.o
/Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fobjc-arc -target x86_64-apple-macosx10.11 -isysroot /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -index-store-path /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/index/store -fmodules -fmodule-name=libcmark -I /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/include -fmodules-cache-path=/Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/ModuleCache -MD -MT dependencies -MF /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/scanners.c.d -c /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/scanners.c -o /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/scanners.c.o
/Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fobjc-arc -target x86_64-apple-macosx10.11 -isysroot /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -index-store-path /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/index/store -fmodules -fmodule-name=libcmark -I /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/include -fmodules-cache-path=/Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/ModuleCache -MD -MT dependencies -MF /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/xml.c.d -c /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/xml.c -o /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/xml.c.o
/Applications/Xcode11.0.0b1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -fobjc-arc -target x86_64-apple-macosx10.11 -isysroot /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -F /Applications/Xcode11.0.0b1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -g -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -index-store-path /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/index/store -fmodules -fmodule-name=libcmark -I /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/include -fmodules-cache-path=/Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/ModuleCache -MD -MT dependencies -MF /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/render.c.d -c /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/render.c -o /Users/mdiep/Repositories/iwasrobbed/Down/.build/x86_64-apple-macosx/debug/libcmark.build/render.c.o
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/render.c:2:
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/buffer.h:10:
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:5:10: error: 'cmark_export.h' file not found with <angled> include; use "quotes" instead
#include <cmark_export.h>
         ^~~~~~~~~~~~~~~~
         "cmark_export.h"
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:6:10: error: 'cmark_version.h' file not found with <angled> include; use "quotes" instead
#include <cmark_version.h>
         ^~~~~~~~~~~~~~~~~
         "cmark_version.h"
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/xml.c:7:
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:5:10: error: 'cmark_export.h' file not found with <angled> include; use "quotes" instead
#include <cmark_export.h>
         ^~~~~~~~~~~~~~~~
         "cmark_export.h"
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/scanners.c:3:
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/chunk.h:7:
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:5:10: error: 'cmark_export.h' file not found with <angled> include; use "quotes" instead
#include <cmark_export.h>
         ^~~~~~~~~~~~~~~~
         "cmark_export.h"
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:6:10: error: 'cmark_version.h' file not found with <angled> include; use "quotes" instead
#include <cmark_version.h>
         ^~~~~~~~~~~~~~~~~
         "cmark_version.h"
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:6:10: error: 'cmark_version.h' file not found with <angled> include; use "quotes" instead
#include <cmark_version.h>
         ^~~~~~~~~~~~~~~~~
         "cmark_version.h"
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/utf8.c:6:
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/utf8.h:5:
In file included from /Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/buffer.h:10:
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:5:10: error: 'cmark_export.h' file not found with <angled> include; use "quotes" instead
#include <cmark_export.h>
         ^~~~~~~~~~~~~~~~
         "cmark_export.h"
/Users/mdiep/Repositories/iwasrobbed/Down/Source/cmark/cmark.h:6:10: error: 'cmark_version.h' file not found with <angled> include; use "quotes" instead
#include <cmark_version.h>
         ^~~~~~~~~~~~~~~~~
         "cmark_version.h"
2 errors generated.
2 errors generated.
2 errors generated.

@aasimk2000
Copy link
Contributor

@iwasrobbed one potential fix I found is to move cmark_export.h and cmark_version.h to the include folder. Would this change be merged into upstream. I still have to check to see if it maintains compatibility with cocoapods and carthage.

@iwasrobbed
Copy link
Collaborator

@aasimk2000 Personally, it feels pretty brittle to have to arbitrarily change directories (and highly doubtful that cmark would want to do that for a random / hard-to-remember-during-updates reason); there's no way to specify these explicitly in the Package.swift file like most other package managers?

I'd lean towards removing SwiftPM support if we can't find a way to do this cleanly

@aasimk2000
Copy link
Contributor

Yup, you are right. I found another way that just require changing Package.swift. I'll create a pull request sometime this week.

@iwasrobbed
Copy link
Collaborator

Sounds good, thanks again @aasimk2000 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SwiftPM Issues related to integrating via SwiftPM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants