google / google/include-first

Using include-first in workspace members

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

When building a workspace, the working directory during build will be root directory. When building member crates `src/{}` will point to `root/src/{}` instead of `root/member/src/{}` [here](https://github.com/google/include-first/blob/main/src/lib.rs#L50).

I suggest changing this line to something like this:
```rust
let filename = Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("src").join(filename.trim_matches('"'));
```

`CARGO_MANIFEST_DIR` always points to the directory of the package currently being built.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.