Code Monkey home page Code Monkey logo

Comments (5)

compnerd avatar compnerd commented on May 9, 2024

How are you invoking swift build? You should be passing the header search path or ensuring that the systemLibrary dependency is set up with the right paths.

from swift-llbuild.

Bo98 avatar Bo98 commented on May 9, 2024

How are you invoking swift build?

Via SwiftPM bootstrap rather than llbuild directly.

the systemLibrary dependency

Where is this dependency located? SQLite3 seems to only be passed as a linker flag here:

linkerSettings: [.linkedLibrary("sqlite3")]
and there's already an OpenBSD-specific hack for a similar issue:

swift-llbuild/Package.swift

Lines 279 to 287 in 783aec2

#if os(OpenBSD)
if let target = package.targets.first(where: { $0.name == "llbuildCore"}) {
target.cSettings = [.unsafeFlags(["-I/usr/local/include"])]
target.linkerSettings = [
.linkedLibrary("sqlite3"),
.unsafeFlags(["-L/usr/local/lib"])
]
}
#endif

It should be able to pick up the pkg-config like the CMake part of the build is able to.

from swift-llbuild.

Bo98 avatar Bo98 commented on May 9, 2024

Issue seems to just be #733 again but s/OpenBSD/any other non-usr install/

from swift-llbuild.

Bo98 avatar Bo98 commented on May 9, 2024

Reproduction steps:

$ docker run --rm -it swift:5.9.2
# apt update
# apt install g++ make cmake curl
# cd /root
# curl -LO https://www.sqlite.org/2024/sqlite-autoconf-3450100.tar.gz
# tar xf sqlite-autoconf-3450100.tar.gz
# cd sqlite-autoconf-3450100
# ./configure --prefix=/opt/prefix
# make install
# cd ..
# export PKG_CONFIG_PATH=/opt/prefix/lib/pkgconfig
# pkg-config --cflags sqlite3
-I/opt/prefix/include
# git clone https://github.com/apple/swift-package-manager
# cd swift-package-manager
# git checkout swift-5.9.2-RELEASE
# swift build
/root/swift-package-manager/.build/checkouts/swift-llbuild/lib/Core/SQLiteBuildDB.cpp:28:10: fatal error: 'sqlite3.h' file not found
#include <sqlite3.h>
         ^~~~~~~~~~~
1 error generated.

from swift-llbuild.

finagolfin avatar finagolfin commented on May 9, 2024

I ran another test in that linked 5.9.2 pull and I think he is right that llbuild should specify the systemLibrary dependency explicitly in Package.swift, or it fails for any non-standard directory where it may be installed, such as when cross-compiling.

I'm guessing he could make this more explicit by trying to build the llbuild package alone with SwiftPM in his example above and that would also fail, as the Swift toolchain build avoids that by building llbuild alone with CMake, obviously since SwiftPM isn't built yet when first building llbuild alone in the toolchain build.

from swift-llbuild.

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.