Skip to content

Commit

Permalink
[antlir2] Support root-relative dst_path in feature
Browse files Browse the repository at this point in the history
Summary: It's possible for `dst_path` to already be root-relative (particularly when compiling one feature from another feature), so handle that in the branching.

Test Plan: CI + used in above diffs in stack

Reviewed By: sergeyfd

Differential Revision: D47532604

fbshipit-source-id: fddf77ee2c03c36ad2c4ff6003c4f370ed9b57f7
  • Loading branch information
justintrudell authored and facebook-github-bot committed Jul 19, 2023
1 parent 5b19abf commit 5b9d601
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions antlir/antlir2/antlir2_compile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ impl CompilerContext {
{
if !path.as_ref().is_absolute() {
self.root.join(path)
} else if path.as_ref().starts_with(&self.root) {
path.as_ref().to_path_buf()
} else {
self.root
.join(path.as_ref().strip_prefix("/").expect("infallible"))
Expand Down

0 comments on commit 5b9d601

Please sign in to comment.