-
-
Notifications
You must be signed in to change notification settings - Fork 407
WIP: Rust wrapper #3181
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
WIP: Rust wrapper #3181
Conversation
611176c
to
d2ef4df
Compare
Bloaty Results 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3181-compared-to-main.txtCompared to d387090 (legacy)
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-3181-compared-to-legacy.txt |
Benchmark Results ⚡
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-3181-compared-to-main.txt |
platform/rust/src/wrapper.cc
Outdated
return std::make_unique<TileServerOptions>(); | ||
} | ||
std::unique_ptr<TileServerOptions> TileServerOptions_mapbox() { | ||
return std::make_unique<TileServerOptions>(TileServerOptions::MapLibreConfiguration()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are pending deprecation and removal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now these are good for testing, but I agree that we should remove these
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
* create map/headless after setting some parameters * once instantiated, can only render and set styles * need to fix camera operations for tiles and for static
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@@ -111,6 +111,14 @@ jobs: | |||
cmake -B build -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMLN_WITH_CLANG_TIDY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMLN_WITH_COVERAGE=ON ${{ env.renderer_flag_cmake }} | |||
cmake --build build --target mbgl-core mbgl-test-runner mbgl-render-test-runner mbgl-expression-test mbgl-render mbgl-benchmark-runner | |||
|
|||
# test rust platform | |||
- if: matrix.renderer == 'drawable-rust' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move this to rust-ci.
@@ -0,0 +1,10 @@ | |||
// FIXME: Remove this before merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
since we moved things to its own wrapper, I think this PR is moot, right? |
tbh, i would much rather move this here to avoid the unneeded extra complexity of the two repos - esp because now you see many other projects are using it, and it clearly shows value? |
Taking a step back, it's not just two repos. There is the option to keep the wrapper in maplibre-native-rs, and just add a CI check here in Native that clones the wrapper repo to test it with upcoming native versions. It's a bit of an "ecosystem ci" check, which is an approach that will soon be used for Qt SDK (which prev lived in maplibre-native) and I think strikes a good balance. It's inspired by the vite-ecosystem-ci project, which keep the vite core repo clean by making integration tests, and it's protecting as well against regressions as a monorepo would. Without an ecosystem check like that, everything that depends on native has to be part of native core repo to be sure... maplibre-compose, maplibre-react-native, maplibre-native-qt, flutter-maplibre-gl etc., the rs bindings aren't really different in that regard, so i think it's best we try to establish a solution that'll work for other dependants too. |
I see that the issues that we currently have are not very MLN specific. Given that otherwise I would have to subscribe to all MLN issues or Bart would need to tag me (both horrible) I think keeping us separate and adding something like ecosystem CI would be nice. The changes that I see as TODO would unnecessarily spam people, making maintaining something as high traffic as MLN more difficult. |
oops, i totally misread - i thought this was the PR that added the |
TODO/Goals
&CStr
andCString
where it is not performance critical.Result<String>
for proper error reporting.cargo run
works okImplementation ideas
Current thinking is to get
cmake
to produce a static library. All steps must be initiated by theplatform/rust-cxx/build.rs
:#[cxx::bridge] mod ffi { ... }
inplatform/rust-cxx/src/main.rs
cmake
crate executes cmake with special flags to pick up that header file, plus any other CC and H files in the rust-cxx dirs, plus the rest of the core and produces static libget_version
or some other basic thing