From 03ebb8e1d243507b4056b748af7c093f131eaf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bene=C5=A1?= Date: Wed, 25 Oct 2023 17:43:35 +0200 Subject: [PATCH] chore: remove "non-core artifact" nargo generated files (#3026) Fixes #2977 --- .../end-to-end/src/e2e_cross_chain_messaging.test.ts | 2 +- yarn-project/noir-compiler/src/compile/nargo.ts | 4 +++- yarn-project/noir-contracts/scripts/types_all.sh | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts b/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts index b0eca576525..2aa7f94cbeb 100644 --- a/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts +++ b/yarn-project/end-to-end/src/e2e_cross_chain_messaging.test.ts @@ -234,5 +234,5 @@ describe('e2e_cross_chain_messaging', () => { ).rejects.toThrowError( "Failed to solve brillig function, reason: explicit trap hit in brillig 'l1_to_l2_message_data.message.content == content'", ); - }); + }, 50_000); }); diff --git a/yarn-project/noir-compiler/src/compile/nargo.ts b/yarn-project/noir-compiler/src/compile/nargo.ts index fcab4866669..85443ebf631 100644 --- a/yarn-project/noir-compiler/src/compile/nargo.ts +++ b/yarn-project/noir-compiler/src/compile/nargo.ts @@ -1,7 +1,7 @@ import { LogFn, createDebugLogger } from '@aztec/foundation/log'; import { execSync } from 'child_process'; -import { readFileSync, readdirSync, statSync } from 'fs'; +import { readFileSync, readdirSync, statSync, unlinkSync } from 'fs'; import { emptyDirSync } from 'fs-extra'; import path from 'path'; @@ -66,6 +66,8 @@ export class NargoContractCompiler { } else { contractArtifacts.set(filename, JSON.parse(readFileSync(file).toString()) as NoirCompiledContract); } + // Delete the file as it is not needed anymore and it can cause issues with prettier + unlinkSync(file); } } diff --git a/yarn-project/noir-contracts/scripts/types_all.sh b/yarn-project/noir-contracts/scripts/types_all.sh index 72524da1c39..e94eb026a13 100755 --- a/yarn-project/noir-contracts/scripts/types_all.sh +++ b/yarn-project/noir-contracts/scripts/types_all.sh @@ -1,3 +1,6 @@ #!/bin/bash # Run the types script for all files -./scripts/types.sh $(./scripts/get_all_contracts.sh) \ No newline at end of file +./scripts/types.sh $(./scripts/get_all_contracts.sh) + +# Remove the debug files as they are no longer needed and can cause prettier and build issues +rm -r ./target/debug* \ No newline at end of file