Skip to content

Commit 4ad519f

Browse files
authored
[libdatadog] Fix release building nested tar files (#1253)
Don't create tar in build, because CI does it License files
1 parent 902b6a5 commit 4ad519f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

builder/src/bin/release.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ pub fn main() {
123123
match res {
124124
Ok(_) => {
125125
builder.sanitize_libraries();
126-
builder.pack().unwrap()
126+
// Note: tar creation is handled by CI, not by this binary
127127
}
128128
Err(err) => panic!("{}", format!("Building failed: {err}")),
129129
}

builder/src/builder.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,25 @@ impl Builder {
167167
module.build()?;
168168
module.install()?;
169169
}
170+
self.copy_license_files()?;
171+
Ok(())
172+
}
173+
174+
/// Copy license files to the target directory
175+
pub fn copy_license_files(&self) -> Result<()> {
176+
let project_root = project_root();
177+
let license_files = ["LICENSE", "LICENSE-3rdparty.yml", "NOTICE"];
178+
179+
for file in &license_files {
180+
let source_path = project_root.join(file);
181+
let dest_path = Path::new(self.target_dir.as_ref()).join(file);
182+
183+
if source_path.exists() {
184+
fs::copy(&source_path, &dest_path)
185+
.map_err(|e| anyhow::anyhow!("Failed to copy {}: {}", file, e))?;
186+
}
187+
}
188+
170189
Ok(())
171190
}
172191

0 commit comments

Comments
 (0)