indexstore-db icon indicating copy to clipboard operation
indexstore-db copied to clipboard

Import errors when running `swift build`

Open shepting opened this issue 2 years ago • 4 comments
trafficstars

I'm following the directions in the README, but when I get to swift build I see a number of import errors:

╰─ swift build                         
Building for debugging...
/Users/stevenhepting/workspace/indexstore-db/lib/Support/PatternMatching.cpp:13:10: fatal error: 'IndexStoreDB/Support/PatternMatching.h' file not found
#include "IndexStoreDB/Support/PatternMatching.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
/Users/stevenhepting/workspace/indexstore-db/lib/LLVMSupport/Support/circular_raw_ostream.cpp:13:10: fatal error: 'llvm/Support/circular_raw_ostream.h' file not found
#include "llvm/Support/circular_raw_ostream.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/LLVMSupport/Support/raw_ostream.cpp:13:10: fatal error: 'llvm/Support/raw_ostream.h' file not found
#include "llvm/Support/raw_ostream.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/Concurrency-Mac.cpp:13:10: fatal error: 'IndexStoreDB/Support/Concurrency.h' file not found
#include "IndexStoreDB/Support/Concurrency.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/Logging.cpp:14:10: fatal error: 'IndexStoreDB/Support/Logging.h' file not found
#include "IndexStoreDB/Support/Logging.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/FilePathWatcher.cpp:13:10: fatal error: 'IndexStoreDB/Support/FilePathWatcher.h' file not found
#include "IndexStoreDB/Support/FilePathWatcher.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/Support/Path.cpp:13:10: fatal error: 'IndexStoreDB/Support/Path.h' file not found
#include "IndexStoreDB/Support/Path.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/stevenhepting/workspace/indexstore-db/lib/LLVMSupport/Support/YAMLTraits.cpp:9:10: fatal error: 'llvm/Support/YAMLTraits.h' file not found
#include "llvm/Support/YAMLTraits.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[1/87] Compiling YAMLTraits.cpp

Is there perhaps another way to build this project using cmake?

shepting avatar May 19 '23 23:05 shepting

I'm having the same issues, on windows 10, both with Swift 5.8 and Swift 5.9 Development (got it from the official downloads)

daniele-niero avatar Sep 14 '23 08:09 daniele-niero

@shepting
I was able to get rid of this errors. There are some symbolic links in this repository. According to this answer on StackOverflow https://stackoverflow.com/questions/5917249/git-symbolic-links-in-windows/59761201#59761201 It is necessary to turn a git configuration on.

However now I have another missing file

indexstore-db\lib\Support\Logging.cpp:19:10: fatal error: 'dispatch/dispatch.h' file not found
#include <dispatch/dispatch.h>
         ^~~~~~~~~~~~~~~~~~~~~

And this I don't know where it is supposed to come from :/

daniele-niero avatar Sep 15 '23 08:09 daniele-niero

If you look at our instructions for building on Linux you'll see we're passing some extra -I options to find toolchain headers; does something similar work on Windows?

benlangmuir avatar Sep 15 '23 16:09 benlangmuir

@benlangmuir yes, that would work on Windows as well. -Xcc -I${env:SDKROOT}\usr\include or -Xcc %SDKROOT%\usr\include (depending on the shell) should work I believe.

compnerd avatar Sep 16 '23 22:09 compnerd