Skip to content

Commit ab1ccef

Browse files
authored
fix: relative source paths pixi-build-rattler-build (#155)
1 parent c6adad4 commit ab1ccef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/pixi-build-rattler-build/src/protocol.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,9 @@ impl Protocol for RattlerBuildBackend {
345345
}
346346
}
347347

348+
#[allow(dead_code)]
348349
/// Returns the relative path from `base` to `input`, joined by "/".
349-
pub fn relative_path_joined(
350-
base: &std::path::Path,
351-
input: &std::path::Path,
352-
) -> miette::Result<String> {
350+
fn relative_path_joined(base: &std::path::Path, input: &std::path::Path) -> miette::Result<String> {
353351
let rel = pathdiff::diff_paths(input, base).ok_or_else(|| {
354352
miette::miette!(
355353
"could not compute relative path from '{:?}' to '{:?}'",
@@ -372,6 +370,11 @@ fn build_input_globs(
372370
// Always add the current directory of the package to the globs
373371
let mut input_globs = vec!["*/**".to_string()];
374372

373+
// TODO: Remove this condition when working on https://github.com/prefix-dev/pixi/issues/3785
374+
if !source.is_absolute() {
375+
return Ok(input_globs);
376+
}
377+
375378
// Get parent directory path
376379
let parent = if source.is_file() {
377380
// use the parent path as glob
@@ -380,7 +383,6 @@ fn build_input_globs(
380383
// use the source path as glob
381384
source.to_path_buf()
382385
};
383-
384386
// If there are sources add them to the globs as well
385387
if let Some(package_sources) = package_sources {
386388
for source in package_sources {

0 commit comments

Comments
 (0)