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 build with Bazel #549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix build with Bazel #549

wants to merge 1 commit into from

Conversation

tronical
Copy link

@tronical tronical commented Jan 5, 2025

When building Rust applications with Bazel instead of cargo, typically a sandbox is in place, where each process invocation (rustc, build.rs program, etc.) runs in its own "root", where the view on the filesystem is the same, but the absolute paths are different. As a consequence, CARGO_MANIFEST_DIR differs between the invocation of build.rs and rustc.

That means that absolute paths in the generated webgl_exts.rs don't work. Fortunately, the source files are relative to the CARGO_MANIFEST_DIR, which, while changing between invocations, remains valid.

When building Rust applications with Bazel instead of cargo, typically a
sandbox is in place, where each process invocation (rustc, build.rs
program, etc.) runs in its own "root", where the view on the filesystem
is the same, but the absolute paths are different. As a consequence,
CARGO_MANIFEST_DIR differs between the invocation of build.rs and rustc.

That means that absolute paths in the generated webgl_exts.rs don't
work. Fortunately, the source files are relative to the
CARGO_MANIFEST_DIR, which, while changing between invocations, remains
valid.
tronical added a commit to slint-ui/slint that referenced this pull request Jan 5, 2025
Use relative paths to CARGO_MANIFEST_DIR in build.rs. Patch is
also submitted upstream at brendanzab/gl-rs#549
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