tursodatabase / tursodatabase/libsql

Build Issues M1 Mac

Open
#2,027 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

Libsql is failing to build on my mac m1, I can repro the failure with

cargo init test-libsql
cd test-libsql/
cargo add libsql --features encryption,wasm,cloudflare
cargo check

That results in

warning: libsql-ffi@0.9.2: CC_var_name=CC_aarch64_apple_darwin
error: failed to run custom build command for `libsql-ffi v0.9.2`

Caused by:
  process didn't exit successfully: `/private/tmp/test-libsql/target/debug/build/libsql-ffi-55941d5aa8dd66e5/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-lib=framework=Security
  cargo:rerun-if-changed=bundled/src/sqlite3.c
  cargo:rerun-if-changed=/private/tmp/test-libsql/target/debug/build/libsql-ffi-d9fafd3f824df047/out/sqlite3mc/libsqlite3mc_static.a
  cargo:lib_dir=/private/tmp/test-libsql/target/debug/build/libsql-ffi-d9fafd3f824df047/out
  cargo:warning=CC_var_name=CC_aarch64_apple_darwin
  Running `cmake` with options: -DCMAKE_BUILD_TYPE=Release -DSQLITE3MC_STATIC=ON -DCODEC_TYPE=AES256 -DSQLITE3MC_BUILD_SHELL=OFF -DSQLITE_SHELL_IS_UTF8=OFF -DSQLITE_USER_AUTHENTICATION=OFF -DSQLITE_SECURE_DELETE=OFF -DSQLITE_ENABLE_COLUMN_METADATA=ON -DSQLITE_USE_URI=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON

  --- stderr
  cp: illegal option -- -
  usage: cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file target_file
         cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file ... target_directory
  cp: illegal option -- -
  usage: cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file target_file
         cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file ... target_directory
  [/Users/tom/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libsql-ffi-0.9.2/build.rs:435:9] format!("{BUNDLED_DIR}/SQLite3MultipleCiphers") = "bundled/SQLite3MultipleCiphers"
  cp: illegal option -- -
  usage: cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file target_file
         cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file ... target_directory
  cp: illegal option -- -
  usage: cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file target_file
         cp [-R [-H | -L | -P]] [-fi | -n] [-aclpSsvXx] source_file ... target_directory

  thread 'main' panicked at /Users/tom/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libsql-ffi-0.9.2/build.rs:531:33:
  called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

The errors here feel like they should be simple to solve, has anyone seen this before?

Also, this same error occurs for me when I use the latest version from git.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the provided cargo init, cargo add, and cargo check commands on an M1 Mac. Inspect libsql-ffi build.rs around the reported lines 435 and 531 and the CMake invocation; done means cargo check succeeds with the encryption, wasm, and cloudflare features.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, rust
Domain
build-system, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.