-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
POC: use Rust for css color parsing #2647
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4ebc2d6
Squashed Rust impl
nyurik e5b038b
cmake
nyurik cad4ff4
cxx
nyurik dc0defe
wip
nyurik 46ac304
add armv7-linux-androideabi
nyurik 0aacaaf
add rust to qt docker build
nyurik 2847d27
fix
nyurik 4752a7d
fix
nyurik cc8eb72
build all qt
nyurik e07f5c8
build all qt
nyurik 0afbe40
wip
nyurik c157da8
wip
nyurik 61f7d3f
wip
nyurik 5e404f4
wip
nyurik f712840
Merge branch 'main' into rust-css-color
louwers f2b7b7b
Add Bazel support
louwers d3836b6
Add back license
louwers 90ba3ef
Cleanup unused code
louwers 6f618ec
Revert some files
louwers 729dafb
CI fixes
louwers c7aceda
Remove README.md
louwers 5fc141e
revert qt.cmake
louwers 671a41f
revert README.md
louwers 8ed4303
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,51 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -d /app/.github ] || [ ! -d /home/user/.cache ]; then | ||
if [ ! -d /app/.github ] || [ ! -d ~/.cache ]; then | ||
echo " " | ||
echo "ERROR: Docker container was not started properly." | ||
echo " From the root of this repo, run the following command." | ||
echo " You may add any command to perform in the container at the end of this command." | ||
echo " " | ||
echo ' docker run --rm -it -v "$PWD:/app/" -v "$PWD/docker/.cache:/home/user/.cache" maplibre-native-image' | ||
echo " docker run --rm -it -v \"$PWD:/app/\" -v \"$PWD/docker/.cache:/home/$USERNAME/.cache\" maplibre-native-image" | ||
exit 1 | ||
fi | ||
|
||
export PATH="$PATH:~/.local/bin/" | ||
|
||
|
||
# Work in progress: install and configure Swift and pre-commit | ||
# Detect if current CPU is x64 or ARM64 and download the appropriate binary | ||
#RUN echo "Download and install SWIFT" \ | ||
# && if [ "$(uname -m)" = "aarch64" ]; then \ | ||
# curl -fsSL https://download.swift.org/swift-5.10.1-release/ubuntu2204-aarch64/swift-5.10.1-RELEASE/swift-5.10.1-RELEASE-ubuntu22.04-aarch64.tar.gz \ | ||
# -o /tmp/swift.tar.gz ;\ | ||
# else \ | ||
# curl -fsSL https://download.swift.org/swift-5.10.1-release/ubuntu2204/swift-5.10.1-RELEASE/swift-5.10.1-RELEASE-ubuntu22.04.tar.gz \ | ||
# -o /tmp/swift.tar.gz ;\ | ||
# fi \ | ||
# && tar -xzf /tmp/swift.tar.gz -C / --strip-components=1 \ | ||
# && rm /tmp/swift.tar.gz \ | ||
# && : | ||
#if [ ! -f "/app/.git/hooks/pre-commit" ]; then | ||
# echo "Configuring pre-commit git hooks by creating a .git/hooks/pre-commit file..." | ||
# ~/.local/bin/pre-commit install | ||
#fi | ||
|
||
|
||
|
||
if [ ! -f "$CARGO_HOME/env" ]; then | ||
echo "Downloading and installing Rust..." | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal | ||
fi | ||
. "$CARGO_HOME/env" | ||
|
||
|
||
|
||
if ! command -v cxxbridge > /dev/null; then | ||
echo "Installing cxxbridge..." | ||
cargo install cxxbridge-cmd | ||
fi | ||
|
||
|
||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Rust | ||
|
||
We have added experimental support for intergrating Rust code into the source tree. | ||
|
||
## Rust Bridge | ||
|
||
The Rust bridge lives in `rustutils`. To regenerate the C++ bridge run the following script from the root of the repository. | ||
|
||
``` | ||
rustutils/cpp/generate.sh | ||
``` | ||
|
||
Check in the generated files under `rustutils/cpp`. | ||
|
||
We might intergrate this generation process into the build, but the tools to do so are experimental and immature as of January 2025. | ||
|
||
## Building | ||
|
||
You need to have the correct Rust toolchain(s) installed. | ||
|
||
### CMake | ||
|
||
Set `MLN_USE_RUST` to `ON`. | ||
|
||
### Bazel | ||
|
||
Pass `--//:use_rust` to Bazel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.