Skip to content

fix: Wrap each use of filesystem library in #ifndef __wasm__#181

Merged
Rumata888 merged 1 commit into
masterfrom
phated/disable-filesystem-wasm
Mar 2, 2023
Merged

fix: Wrap each use of filesystem library in #ifndef __wasm__#181
Rumata888 merged 1 commit into
masterfrom
phated/disable-filesystem-wasm

Conversation

@phated

@phated phated commented Feb 23, 2023

Copy link
Copy Markdown

Description

Workaround that fixes #180

As noted in the issue, the <filesystem> library can't be used in code that compiles to Wasm, even if we are targeting WASI. I just quickly wrapped all the usages in #ifndef __wasm__ to verify this workaround solves the problem in Nix. I think the "more correct" way to solve this would be to use mkdir (on unix) and _mkdir (on Windows), but that seemed to receive pushback on the internal PR.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR specifications in /markdown/specs have been updated.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • I've updated any terraform that needs updating (e.g. environment variables) for deployment.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.

@phated phated changed the title fix: Wrap each use of filesystem library in ifndef __wasm__ fix: Wrap each use of filesystem library in #ifndef __wasm__ Feb 23, 2023

@adr1anh adr1anh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good

@phated

phated commented Feb 24, 2023

Copy link
Copy Markdown
Author

Since the wasm tests don't run in CI, @dbanks12 recommended I run them locally, so I ran the following commands:

cd build_wasm
for test in ./bin/join_split_example_*tests; do
  wasmtime --dir .. $test;
done

and all succeed 🎉

@Rumata888 Rumata888 force-pushed the phated/disable-filesystem-wasm branch from 1300620 to 037b4d5 Compare March 2, 2023 15:15
@Rumata888 Rumata888 merged commit 0eae962 into master Mar 2, 2023
@Rumata888 Rumata888 deleted the phated/disable-filesystem-wasm branch March 2, 2023 15:59
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
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.

Remove or change <filesystem> usage in project

3 participants