@@ -5,6 +5,7 @@ use fs_err::tokio as tokio_fs;
5
5
use miette:: { Context , IntoDiagnostic } ;
6
6
use pixi_build_backend:: {
7
7
protocol:: { Protocol , ProtocolInstantiator } ,
8
+ source:: Source ,
8
9
tools:: RattlerBuild ,
9
10
utils:: TemporaryRenderedRecipe ,
10
11
} ;
@@ -135,8 +136,6 @@ impl Protocol for RattlerBuildBackend {
135
136
136
137
let mut solved_packages = vec ! [ ] ;
137
138
138
- eprintln ! ( "before outputs " ) ;
139
-
140
139
for output in outputs {
141
140
let temp_recipe = TemporaryRenderedRecipe :: from_output ( & output) ?;
142
141
let tool_config = & tool_config;
@@ -194,7 +193,7 @@ impl Protocol for RattlerBuildBackend {
194
193
195
194
Ok ( CondaMetadataResult {
196
195
packages : solved_packages,
197
- input_globs : None ,
196
+ input_globs : Some ( input_globs ( & self . recipe_source , None ) ) ,
198
197
} )
199
198
}
200
199
@@ -318,7 +317,7 @@ impl Protocol for RattlerBuildBackend {
318
317
319
318
built. push ( CondaBuiltPackage {
320
319
output_file : build_path,
321
- input_globs : Vec :: from ( [ self . recipe_source . name . clone ( ) ] ) ,
320
+ input_globs : input_globs ( & self . recipe_source , output . finalized_sources . as_ref ( ) ) ,
322
321
name : output. name ( ) . as_normalized ( ) . to_string ( ) ,
323
322
version : output. version ( ) . to_string ( ) ,
324
323
build : build_string. to_string ( ) ,
@@ -329,6 +328,42 @@ impl Protocol for RattlerBuildBackend {
329
328
}
330
329
}
331
330
331
+ fn input_globs (
332
+ source : & Source ,
333
+ package_sources : Option < & Vec < rattler_build:: recipe:: parser:: Source > > ,
334
+ ) -> Vec < String > {
335
+ let mut input_globs = vec ! [ ] ;
336
+ let parent = if source. path . is_file ( ) {
337
+ // use the parent path as glob
338
+ if let Some ( parent) = source. path . parent ( ) {
339
+ parent. to_path_buf ( )
340
+ } else {
341
+ source. path . clone ( )
342
+ }
343
+ } else {
344
+ // use the source path as glob
345
+ source. path . clone ( )
346
+ } ;
347
+
348
+ // add the source path as glob
349
+ input_globs. push ( format ! ( "{}/**" , parent. display( ) ) ) ;
350
+
351
+ if let Some ( package_sources) = package_sources {
352
+ for source in package_sources {
353
+ if let rattler_build:: recipe:: parser:: Source :: Path ( path_source) = source {
354
+ // add the package source path as glob
355
+ if path_source. path . is_dir ( ) {
356
+ input_globs. push ( format ! ( "{}/**" , path_source. path. display( ) ) ) ;
357
+ } else {
358
+ input_globs. push ( path_source. path . display ( ) . to_string ( ) ) ;
359
+ }
360
+ }
361
+ }
362
+ }
363
+
364
+ input_globs
365
+ }
366
+
332
367
#[ async_trait:: async_trait]
333
368
impl ProtocolInstantiator for RattlerBuildBackendInstantiator {
334
369
async fn initialize (
0 commit comments