Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): always rebuild IWorld ABI #1929

Merged
merged 5 commits into from
Dec 1, 2023
Merged

fix(cli): always rebuild IWorld ABI #1929

merged 5 commits into from
Dec 1, 2023

Conversation

dk1a
Copy link
Contributor

@dk1a dk1a commented Nov 13, 2023

hack to rebuild IWorld abi until foundry-rs/foundry#6241 is fixed

Copy link

changeset-bot bot commented Nov 13, 2023

🦋 Changeset detected

Latest commit: 9147209

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@latticexyz/cli Patch
@latticexyz/abi-ts Patch
@latticexyz/block-logs-stream Patch
@latticexyz/common Patch
@latticexyz/config Patch
create-mud Patch
@latticexyz/dev-tools Patch
@latticexyz/ecs-browser Patch
@latticexyz/faucet Patch
@latticexyz/gas-report Patch
@latticexyz/network Patch
@latticexyz/noise Patch
@latticexyz/phaserx Patch
@latticexyz/protocol-parser Patch
@latticexyz/react Patch
@latticexyz/recs Patch
@latticexyz/schema-type Patch
@latticexyz/services Patch
@latticexyz/solecs Patch
solhint-config-mud Patch
solhint-plugin-mud Patch
@latticexyz/std-client Patch
@latticexyz/std-contracts Patch
@latticexyz/store-cache Patch
@latticexyz/store-indexer Patch
@latticexyz/store-sync Patch
@latticexyz/store Patch
@latticexyz/utils Patch
@latticexyz/world-modules Patch
@latticexyz/world Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -63,6 +64,10 @@ export async function runDeploy(opts: DeployOptions): Promise<WorldDeploy> {
if (!opts.skipBuild) {
const outPath = path.join(srcDir, config.codegenDirectory);
await Promise.all([tablegen(config, outPath, remappings), worldgen(config, getExistingContracts(srcDir), outPath)]);

// TODO remove when https://github.com/foundry-rs/foundry/issues/6241 is resolved
await rm(path.join(outDir, "IWorld.sol"), { recursive: true, force: true });
Copy link
Member

Choose a reason for hiding this comment

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

I think @alvrs and I tested this and this basically kills the cache/causes it to do a fresh build. Did you happen to try and see how long this takes?

As an alternative, we played around with unsetting the forge cache's hash or timestamp for this file and it seemed to regenerate just this file afterward (~1s vs full build of ~5s).

Copy link
Contributor Author

@dk1a dk1a Nov 13, 2023

Choose a reason for hiding this comment

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

Did you happen to try and see how long this takes?

a while, but my laptop is just slow, not a good benchmark

As an alternative, we played around with unsetting the forge cache's hash or timestamp for this file and it seemed to regenerate just this file afterward (~1s vs full build of ~5s).

yeah I wanted to look into this but I dunno if I even have forge cache or where it is
forge cache ls returns nothing for me
~/.foundry/cache is also pretty much empty

Copy link
Member

Choose a reason for hiding this comment

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

for me the cache was in the project directory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated to clear the hash instead of deleting the file

@holic holic changed the title fix(cli): hack around foundry issue 6241 fix(cli): always rebuild IWorld ABI Nov 23, 2023
@holic holic merged commit 2699630 into main Dec 1, 2023
10 checks passed
@holic holic deleted the dk1a/world-abi branch December 1, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants