Code Monkey home page Code Monkey logo

Comments (3)

compnerd avatar compnerd commented on August 20, 2024

This is not the right location for that. This repository contains the build rules and is related to the azure builds which are slightly different from the build instructions for development.

That said, you are missing flags or your path setup was not fully correct - you’re linking against the wrong ICU library (Microsoft now ships one). Adjust your paths in CMakeCache.txt (advanced) or rebuild foundation with the missing flags/corrected flags.

from swift-build.

DanielRosenwasser avatar DanielRosenwasser commented on August 20, 2024

Thanks! Like you said, I was able to fix it with some replacements of the following in CMakeCache.txt.

Before After
C:/Program Files (x86)/Windows Kits/10/Lib/10.0.18362.0/um/x64/icu S:/Library/icu-64/usr/lib/icu

After that, Ninja gave me some other errors like

ninja: Entering directory `S:\b\foundation'
ninja: error: 'ICU::uc-NOTFOUND', needed by 'Sources/Foundation/Foundation.dll', missing and no known rule to make it

which I was able to fix by opening S:\b\foundation\build.ninja and replacing

Before After
ICU::uc-NOTFOUND ICU::i18n-NOTFOUND S:\Library\icu-64\usr\lib\icuuc64.lib S:\Library\icu-64\usr\lib\icuin64.lib
ICU$:$:uc-NOTFOUND ICU$:$:i18n-NOTFOUND S$:\Library\icu-64\usr\lib\icuuc64.lib S$:\Library\icu-64\usr\lib\icuin64.lib

Now I've ended up with

libcurl.lib(version.c.obj) : error LNK2019: unresolved external symbol zlibVersion referenced in function curl_version
libcurl.lib(content_encoding.c.obj) : error LNK2001: unresolved external symbol zlibVersion
libcurl.lib(content_encoding.c.obj) : error LNK2019: unresolved external symbol inflate referenced in function inflate_stream
libcurl.lib(content_encoding.c.obj) : error LNK2019: unresolved external symbol inflateEnd referenced in function exit_zlib
libcurl.lib(content_encoding.c.obj) : error LNK2019: unresolved external symbol inflateInit_ referenced in function deflate_init_writer
libcurl.lib(content_encoding.c.obj) : error LNK2019: unresolved external symbol inflateInit2_ referenced in function gzip_init_writer
Sources\FoundationNetworking\FoundationNetworking.dll : fatal error LNK1120: 5 unresolved externals

which I've been able to fix by adding

S:\Library\zlib-1.2.11\usr\lib\zlib.lib

to the LINK_LIBRARIES section for FoundationNetworking:

-  LINK_LIBRARIES = CoreFoundation\CFURLSessionInterface.lib  Sources\Foundation\Foundation.lib  S:\Library\libcurl-development\usr\lib\libcurl.lib  -lAdvAPI32.lib  -lSecur32.lib  -lUser32.lib  -lmincore.lib  S:\b\libdispatch\src\swift\swiftDispatch.lib  S:\b\libdispatch\src\dispatch.lib  S:\b\libdispatch\src\BlocksRuntime\BlocksRuntime.lib
+  LINK_LIBRARIES = CoreFoundation\CFURLSessionInterface.lib  Sources\Foundation\Foundation.lib  S:\Library\libcurl-development\usr\lib\libcurl.lib  S:\Library\zlib-1.2.11\usr\lib\zlib.lib  -lAdvAPI32.lib  -lSecur32.lib  -lUser32.lib  -lmincore.lib  S:\b\libdispatch\src\swift\swiftDispatch.lib  S:\b\libdispatch\src\dispatch.lib  S:\b\libdispatch\src\BlocksRuntime\BlocksRuntime.lib

Since then I haven't been able to install XCTest:

CMake Error at CMakeLists.txt:12 (find_package):
  Could not find a package configuration file provided by "dispatch" with any
  of the following names:

    dispatchConfig.cmake
    dispatch-config.cmake

  Add the installation prefix of "dispatch" to CMAKE_PREFIX_PATH or set
  "dispatch_DIR" to a directory containing one of the above files.  If
  "dispatch" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "S:/b/xctest/CMakeFiles/CMakeOutput.log".
See also "S:/b/xctest/CMakeFiles/CMakeError.log".

Overall, I'm glad I can even get "Hello World" compiling! I do wish I was a little bit more proficient with the toolset so that I could contribute, but CMake and Ninja are unfamiliar for me, and it seems like your setup is already pretty involved beyond that in some cases).

I would even fix the docs, but it's not totally clear to me whether the errors I encountered were a mistake on my part or some issues with the process current process.

For future reference, what'd the best place to raise this since it's a potential docs bug? Swift Forums, or the Swift Jira issue tracker?

from swift-build.

compnerd avatar compnerd commented on August 20, 2024

Glad that it helped! I think that you've missed another argument or have the path wrong (-D dispatch_DIR=S:\b\libdispatch\cmake\modules was missed when building XCTest).

Yeah, the CI is definitely more involved, and you are following instructions which are aimed at maximizing productivity for a very complex setup where you can actually work across ~5-6 projects at once. They are meant for working on the toolchain (llvm, clang, swift, lld, lldb), standard library, libdispatch, Foundation, and XCTest at once. It entirely depends on what you are trying to accomplish. I do think that working through this can help you actually make development contributions to the low level parts of Swift though :)

Note that there is a stable release of the toolchain in the releases on this project, and there are nightly builds on Azure. If you are trying to get involved by working on higher level pieces (like swift-win32, building an application, etc), the releases might be a faster approach.

I would request that you give it some thoughts, if there are documentation improvements which can clarify things, we really should try to make those. The easier it is to get started, the more likely others are to get involved. The best way to address the issue is to create a PR on the swift project pointing out the issue. The Swift Forums are great for asking for help as well.

from swift-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.