Skip to content

Commit d588a21

Browse files
committed
update linux copy and bin paths
1 parent 06f78d0 commit d588a21

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

aws_lambda_builders/workflows/rust_cargo/actions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,7 @@ def __init__(self, source_dir, handler, artifacts_dir, platform, mode, osutils=O
220220
def binary_path(self):
221221
(_, binary) = parse_handler(self.handler)
222222
profile = "debug" if self.mode == BuildMode.DEBUG else "release"
223-
target = os.path.join(self.source_dir, "target")
224-
if self.platform.lower() != "linux":
225-
target = os.path.join(target, "x86_64-unknown-linux-musl")
223+
target = os.path.join(self.source_dir, "target", "x86_64-unknown-linux-musl")
226224
return os.path.join(target, profile, binary)
227225

228226
def execute(self):

tests/unit/workflows/rust_cargo/test_actions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,16 @@ class TestCopyAndRenameAction(TestCase):
153153
def test_debug_copy_path(self):
154154
cargo = BinaryPath(None, None, None, binary_path="path/to/cargo")
155155
action = CopyAndRenameAction("source_dir", "foo", "output_dir", "linux", BuildMode.DEBUG)
156-
self.assertEqual(action.binary_path(), os.path.join("source_dir", "target", "debug", "foo"))
156+
self.assertEqual(
157+
action.binary_path(), os.path.join("source_dir", "target", "x86_64-unknown-linux-musl", "debug", "foo")
158+
)
157159

158160
def test_release_copy_path(self):
159161
cargo = BinaryPath(None, None, None, binary_path="path/to/cargo")
160162
action = CopyAndRenameAction("source_dir", "foo", "output_dir", "linux", BuildMode.RELEASE)
161-
self.assertEqual(action.binary_path(), os.path.join("source_dir", "target", "release", "foo"))
163+
self.assertEqual(
164+
action.binary_path(), os.path.join("source_dir", "target", "x86_64-unknown-linux-musl", "release", "foo")
165+
)
162166

163167
def test_nonlinux_copy_path(self):
164168
cargo = BinaryPath(None, None, None, binary_path="path/to/cargo")

0 commit comments

Comments
 (0)