From 0fad088b9a3b076b24d1a47b10da34941b65a19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Jakub=20Nani=C5=A1ta?= Date: Thu, 25 Jan 2024 10:07:04 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Fix=20toolbox-foundry=20build=20?= =?UTF-8?q?(#245)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/rare-rats-greet.md | 5 +++++ packages/toolbox-foundry/Makefile | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .changeset/rare-rats-greet.md diff --git a/.changeset/rare-rats-greet.md b/.changeset/rare-rats-greet.md new file mode 100644 index 000000000..ce4561519 --- /dev/null +++ b/.changeset/rare-rats-greet.md @@ -0,0 +1,5 @@ +--- +"@layerzerolabs/toolbox-foundry": patch +--- + +Fix inconsistent build behavior on GNU and BSD systems diff --git a/packages/toolbox-foundry/Makefile b/packages/toolbox-foundry/Makefile index 6c6d48585..36995f48b 100644 --- a/packages/toolbox-foundry/Makefile +++ b/packages/toolbox-foundry/Makefile @@ -36,7 +36,15 @@ git_submodules: mkdir -p lib/ds-test # We copy the contracts - cp -R src/ds-test/src/ lib/ds-test/ + # + # The . at the end is important since GNU and BSD + # have a different implementation of the cp command + # + # Without the ., the command has different behavior on BSD (local, macOSX) and GNU (remote, CI/CD): + # + # - on BSD, it will copy the contents of src folder into ds-test + # - on GNU, it will copy the src folder into ds-test + cp -R src/ds-test/src/. lib/ds-test/. # And we include the licenses & package.json cp src/ds-test/package.json src/ds-test/LICENSE lib/ds-test/ @@ -49,7 +57,7 @@ git_submodules: mkdir -p lib/forge-std # We copy the contracts - cp -R src/forge-std/src/ lib/forge-std/ + cp -R src/forge-std/src/. lib/forge-std/. # And we include the licenses & package.json cp src/forge-std/package.json src/forge-std/LICENSE* lib/forge-std/