Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross compilation and build for sandboxes enviroments. #1911

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

levydsa
Copy link
Contributor

@levydsa levydsa commented Jan 10, 2025

Build scripts shouldn't write to anything but OUT_DIR. So, instead of copying sqlite3.c to sqlite3mc in source, copy it to OUT_DIR and build from there.

https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script

Build scripts may save any output files or intermediate artifacts in the directory specified in the OUT_DIR environment variable. Scripts should not modify any files outside of that directory.

On some environments, Nix derivations, the permissions of source files are limited, and get copied over using the standard fs::copy. To prevent this, cp --no-preserve=mode,ownership is needed. Inside a Nix derivation, some coreutils are overridden and this is fine to use even on a MacOS device. To make this more reliable, if the cp command fails, do a normal copy with fs functions.

Some CMake configuration was added to allow cross-compilation of sqlite3mc for more targets.

@levydsa
Copy link
Contributor Author

levydsa commented Jan 10, 2025

The copy_with_cp name is a bit misleading, but should be fine. Maybe changing it to just copy is better?

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.

1 participant