diff --git a/packer/README.md b/packer/README.md index e9e6215..74dd48c 100644 --- a/packer/README.md +++ b/packer/README.md @@ -56,3 +56,4 @@ description = "a brown fox jumps over a lazy dog." ## Environment Variables - `OMRF_PACKER_CARGO`: Path to the `cargo` executable used to collect project metadata. When unset, the packer invokes `cargo` as resolved from `PATH`. +- `OMRF_PACKER_RUSTC`: Path to the `rustc` executable used to resolve the host toolchain triple. When unset, the packer invokes `rustc` as resolved from `PATH`. diff --git a/packer/src/sarasacw_omrf_packer/artifact.py b/packer/src/sarasacw_omrf_packer/artifact.py index 6b76187..1c89a6a 100644 --- a/packer/src/sarasacw_omrf_packer/artifact.py +++ b/packer/src/sarasacw_omrf_packer/artifact.py @@ -165,7 +165,6 @@ def _generate_lib_artifact_name(name: str, _: Triple) -> str: def resolve_lib_copy(ctx: ArtifactContext) -> Iterator[FileCopyInfo]: """Yield :class:`FileCopyInfo` for the built dynamic library (and, on Windows, the import library).""" extractor = ctx.extractor - target_directory = extractor.get_target_directory() / "release" target_name = extractor.get_target_name() # get triple info @@ -173,6 +172,12 @@ def resolve_lib_copy(ctx: ArtifactContext) -> Iterator[FileCopyInfo]: if ctx.options.target is not None: target_triple = ctx.options.target + # compute target directory + target_directory = extractor.get_target_directory() + if ctx.options.target is not None: + target_directory /= str(ctx.options.target) + target_directory /= "release" + # copy artifact for redist dll_artifact_filename = _generate_dll_artifact_name(target_name, target_triple) yield FileCopyInfo(