Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions axoproject/src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct Package {
readme: Option<Utf8PathBuf>,
authors: Option<Vec<String>>,
binaries: Option<Vec<String>>,
out_dir: Option<String>,
Copy link
Author

@CatBraaain CatBraaain Jan 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named this field out_dir to match GenericBuildStep.out_dir, but if allowed, I personally think bin_dir would be more readable.

license: Option<String>,
changelog: Option<Utf8PathBuf>,
license_files: Option<Vec<Utf8PathBuf>>,
Expand Down Expand Up @@ -401,6 +402,7 @@ fn process_package(
license_files: package.license_files.unwrap_or_default(),
changelog_file: package.changelog,
binaries: package.binaries.unwrap_or_default(),
out_dir: package.out_dir,
cstaticlibs: package.cstaticlibs.unwrap_or_default(),
cdylibs: package.cdylibs.unwrap_or_default(),
build_command: Some(build_command),
Expand Down Expand Up @@ -448,6 +450,7 @@ fn merge_package_with_raw_generic(
readme,
authors,
binaries,
out_dir,
license,
changelog,
license_files,
Expand Down Expand Up @@ -486,6 +489,9 @@ fn merge_package_with_raw_generic(
if let Some(val) = binaries {
package.binaries = val;
}
if let Some(val) = out_dir {
package.out_dir = Some(val);
}
if let Some(val) = license {
package.license = Some(val);
}
Expand Down
1 change: 1 addition & 0 deletions axoproject/src/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ fn read_workspace(manifest_path: &Utf8Path) -> Result<WorkspaceStructure> {
// FIXME: is there any JS equivalent to this?
changelog_file: None,
binaries,
out_dir: None,
// FIXME: is there any JS equivalent to this?
cdylibs: vec![],
// FIXME: is there any JS equivalent to this?
Expand Down
2 changes: 2 additions & 0 deletions axoproject/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ pub struct PackageInfo {
/// For JS I *think* this is computed in its full complexity but Tests Needed
/// and also there's so many ways to define things who can ever be sure.
pub binaries: Vec<String>,
/// Path to the build directory for this package
pub out_dir: Option<String>,
/// Names of C-style staticlibs (.a) this library defines.
///
/// For Cargo this is currently properly computed in all its complexity.
Expand Down
1 change: 1 addition & 0 deletions axoproject/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ fn package_info(
.collect(),
changelog_file: None,
binaries,
out_dir: None,
cdylibs,
cstaticlibs,
cargo_metadata_table,
Expand Down
7 changes: 6 additions & 1 deletion cargo-dist/src/build/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ impl<'a> DistGraphBuilder<'a> {
}
for (pkg_idx, expected_binaries) in builds_by_pkg_idx {
let package = self.workspaces.package(pkg_idx);
let out_dir = if let Some(dir) = package.out_dir.as_ref() {
package.package_root.join(dir)
} else {
package.package_root.clone()
};
builds.push(BuildStep::Generic(GenericBuildStep {
target_triple: target.clone(),
expected_binaries,
working_dir: package.package_root.clone(),
out_dir: package.package_root.clone(),
out_dir,
build_command: package
.build_command
.clone()
Expand Down
1 change: 1 addition & 0 deletions cargo-dist/src/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pub fn mock_package(name: &str, ver: &str) -> PackageInfo {
license_files: vec![],
changelog_file: None,
binaries: vec![],
out_dir: None,
cstaticlibs: vec![],
cdylibs: vec![],
cargo_metadata_table: None,
Expand Down
Loading