|
15 | 15 | use crate::cache::FileObjectSource; |
16 | 16 | use crate::compiler::args::*; |
17 | 17 | use crate::compiler::{ |
18 | | - Cacheable, ColorMode, Compilation, CompileCommand, Compiler, CompilerArguments, CompilerHasher, |
19 | | - CompilerKind, CompilerProxy, HashResult, |
| 18 | + c::ArtifactDescriptor, Cacheable, ColorMode, Compilation, CompileCommand, Compiler, |
| 19 | + CompilerArguments, CompilerHasher, CompilerKind, CompilerProxy, HashResult, |
20 | 20 | }; |
21 | 21 | #[cfg(feature = "dist-client")] |
22 | 22 | use crate::compiler::{DistPackagers, OutputsRewriter}; |
@@ -186,7 +186,7 @@ pub struct RustCompilation { |
186 | 186 | /// The compiler inputs. |
187 | 187 | inputs: Vec<PathBuf>, |
188 | 188 | /// The compiler outputs. |
189 | | - outputs: HashMap<String, PathBuf>, |
| 189 | + outputs: HashMap<String, ArtifactDescriptor>, |
190 | 190 | /// The directories searched for rlibs |
191 | 191 | crate_link_paths: Vec<PathBuf>, |
192 | 192 | /// The crate name being compiled. |
@@ -1513,19 +1513,37 @@ where |
1513 | 1513 | .into_iter() |
1514 | 1514 | .map(|o| { |
1515 | 1515 | let p = output_dir.join(&o); |
1516 | | - (o, p) |
| 1516 | + ( |
| 1517 | + o, |
| 1518 | + ArtifactDescriptor { |
| 1519 | + path: p, |
| 1520 | + optional: false, |
| 1521 | + }, |
| 1522 | + ) |
1517 | 1523 | }) |
1518 | 1524 | .collect::<HashMap<_, _>>(); |
1519 | 1525 | let dep_info = if let Some(dep_info) = dep_info { |
1520 | 1526 | let p = output_dir.join(&dep_info); |
1521 | | - outputs.insert(dep_info.to_string_lossy().into_owned(), p.clone()); |
| 1527 | + outputs.insert( |
| 1528 | + dep_info.to_string_lossy().into_owned(), |
| 1529 | + ArtifactDescriptor { |
| 1530 | + path: p.clone(), |
| 1531 | + optional: false, |
| 1532 | + }, |
| 1533 | + ); |
1522 | 1534 | Some(p) |
1523 | 1535 | } else { |
1524 | 1536 | None |
1525 | 1537 | }; |
1526 | 1538 | if let Some(gcno) = gcno { |
1527 | 1539 | let p = output_dir.join(&gcno); |
1528 | | - outputs.insert(gcno.to_string_lossy().into_owned(), p); |
| 1540 | + outputs.insert( |
| 1541 | + gcno.to_string_lossy().into_owned(), |
| 1542 | + ArtifactDescriptor { |
| 1543 | + path: p, |
| 1544 | + optional: true, |
| 1545 | + }, |
| 1546 | + ); |
1529 | 1547 | } |
1530 | 1548 | let mut arguments = arguments; |
1531 | 1549 | // Request color output unless json was requested. The client will strip colors if needed. |
@@ -1761,8 +1779,8 @@ impl Compilation for RustCompilation { |
1761 | 1779 | fn outputs<'a>(&'a self) -> Box<dyn Iterator<Item = FileObjectSource> + 'a> { |
1762 | 1780 | Box::new(self.outputs.iter().map(|(k, v)| FileObjectSource { |
1763 | 1781 | key: k.to_string(), |
1764 | | - path: v.clone(), |
1765 | | - optional: false, |
| 1782 | + path: v.path.clone(), |
| 1783 | + optional: v.optional, |
1766 | 1784 | })) |
1767 | 1785 | } |
1768 | 1786 | } |
|
0 commit comments