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

Allow compiling with Rust code #3137

Merged
merged 61 commits into from
Jan 16, 2025
Merged

Allow compiling with Rust code #3137

merged 61 commits into from
Jan 16, 2025

Conversation

louwers
Copy link
Collaborator

@louwers louwers commented Jan 10, 2025

Continuation of #2647

  • Adds optional support for Rust code in the source tree. Replaces csscolorparser.hpp with a Rust library by way of proof-of-concept. Use -DMLN_USE_RUST=ON with CMake or ://use_rust with Bazel. Tested with macOS, iOS and Android.
  • Generated sources headers and sources are not checked into source control. Generation integrated with Bazel and CMake.
  • Rust code is licensed under the same license as the rest of the codebase.
  • Test coverage on CI (Linux, CMake) is included.

Context of this PR: have Rust build tooling set up, so we are able to integrate a Rust library when the opportunity arises. Give people a playground to toy around with integrating Rust code or writing extensions for MapLibre Native in Rust.


Open TODOs:

  • Generate C++ sources during build with CMake and Bazel.
  • Set up pre-commit for rustfmt.
  • Already split into modules. Suggestion from @ianthetechie
  • Add a smoke test to CI, see if it Rust stuff compiles on Linux. Remove other CI config for now.
  • Figure out why iOS simulator toolchain does not seem to be available...

nyurik

This comment was marked as outdated.

@louwers louwers requested a review from ianthetechie January 14, 2025 19:30
@louwers louwers enabled auto-merge (squash) January 16, 2025 02:35
@louwers louwers disabled auto-merge January 16, 2025 13:23
Copy link
Collaborator

@ianthetechie ianthetechie left a comment

Choose a reason for hiding this comment

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

Fantastic work, guys 🚀 I can confirm all is working on my machine with the latest (and tested making some changes to the Rust code to ensure that it's actually being used; good suggestion @louwers)!

@louwers louwers enabled auto-merge (squash) January 16, 2025 14:43
@louwers louwers merged commit 527e70b into maplibre:main Jan 16, 2025
48 checks passed
@louwers louwers deleted the rust-css-color branch January 16, 2025 15:01
@nyurik
Copy link
Member

nyurik commented Jan 16, 2025

awesome work, thanks @louwers !

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.

3 participants