Skip to content

fix(cmake): add IOKit framework to APPLE link line#43

Merged
jja725 merged 1 commit into
lance-format:mainfrom
LuciferYang:fix/cmake-iokit-framework
May 23, 2026
Merged

fix(cmake): add IOKit framework to APPLE link line#43
jja725 merged 1 commit into
lance-format:mainfrom
LuciferYang:fix/cmake-iokit-framework

Conversation

@LuciferYang
Copy link
Copy Markdown
Contributor

Summary

The macOS arm64 consumer-smoke-test job has been failing on main since #24 with a long list of unresolved _IO* symbols (_IOObjectRelease, _IOServiceMatching, _IOHIDEventSystemClientCreate, _IORegistryEntryCreateCFProperty, …) — sample run: https://github.com/lance-format/lance-c/actions/runs/26272649710.

Root cause is plumbing, not the consumer example: sysinfo (pulled in transitively via the lance crates) calls IOKit on macOS for disk enumeration, CPU frequency, and thermal sensors, and objc2_io_kit declares the binding. Cargo's rustc-link-lib=framework=IOKit is honored when this repo builds, but a downstream consumer linking against the installed liblance_c.a via find_package(LanceC) (or pkg-config) only sees the frameworks we declare in our config files — and IOKit was missing.

Add -framework IOKit next to the existing CoreFoundation / Security / SystemConfiguration entries in all three mirroring places:

  • CMakeLists.txt — build-tree LanceC_platform_deps interface library
  • cmake/LanceCConfig.cmake.in — installed find_package(LanceC) consumers
  • CMakeLists.txt — pkg-config Libs.private

Verification

Same cmake --installexamples/cmake-consumer build path the CI runs, on arm64 macOS (15.0 SDK, AppleClang 17):

$ cmake --install build --prefix _install
$ cmake -S examples/cmake-consumer -B consumer-build -DCMAKE_PREFIX_PATH="$PWD/_install"
$ cmake --build consumer-build
…
[100%] Built target consumer
$ consumer-build/consumer
usage: consumer <dataset_uri>
$ echo $?
2

Before the patch the same sequence dies at link with Undefined symbols for architecture arm64. After it, the link succeeds and the binary exits 2 (usage error) as the CI step expects.

After this lands

Unblocks the consumer-smoke macOS leg for every open PR — #42 (schema-evolution drop_columns) hits this exact failure on its CI run.

`sysinfo` (pulled in transitively via the lance crates) calls IOKit on
macOS for disk enumeration, CPU frequency, and thermal sensors; `objc2_io_kit`
declares the framework binding. Cargo's `rustc-link-lib=framework=IOKit`
is honored when this repo builds, but consumers linking against the
installed `liblance_c.a` via `find_package(LanceC)` (or pkg-config) only
see the frameworks we declare in our config files — and IOKit was missing.

Add `-framework IOKit` next to the existing `CoreFoundation` / `Security`
/ `SystemConfiguration` entries in all three places: build-tree
`LanceC_platform_deps`, installed `LanceCConfig.cmake.in`, and the
pkg-config `Libs.private`.
@LuciferYang
Copy link
Copy Markdown
Contributor Author

cc @jja725 @Xuanwo

Copy link
Copy Markdown
Collaborator

@jja725 jja725 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix

@jja725 jja725 merged commit bd01a95 into lance-format:main May 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants