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

Use stable path to node module #241

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Use stable path to node module #241

merged 1 commit into from
Mar 5, 2024

Conversation

aborg-dev
Copy link

@aborg-dev aborg-dev commented Mar 1, 2024

This fixes #238

@aborg-dev aborg-dev requested a review from MCJOHN974 March 1, 2024 11:32
Comment on lines 83 to 82
.to_str()
.unwrap()
.to_string();
Copy link
Collaborator

@nagisa nagisa Mar 4, 2024

Choose a reason for hiding this comment

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

Suggested change
.to_str()
.unwrap()
.to_string();
.display()
.to_string();

Ideally this did not force filesystem paths to be utf-8, but I can imagine that npm or node in general won't take kindly to it anyway, so whatever. And I don't think any of us will have non-utf-8 working directories...

That said there's a caveat with file! -- it is affected by the --remap-path-prefix flag so if for any reason that flag is used, this code will most likely break. An alternative could be to use env!("CARGO_MANIFEST_DIR") and base the path from that.

Copy link
Author

Choose a reason for hiding this comment

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

Both great points, thanks! I ended up switching to CARGO_MANIFEST_DIR which uses an absolute path.

@aborg-dev aborg-dev enabled auto-merge March 5, 2024 13:53
@aborg-dev aborg-dev added this pull request to the merge queue Mar 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 5, 2024
@aborg-dev aborg-dev added this pull request to the merge queue Mar 5, 2024
Merged via the queue into main with commit 3e35ac4 Mar 5, 2024
24 checks passed
@aborg-dev aborg-dev deleted the stable_path_to_node branch March 5, 2024 15:05
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.

Make zkasm runner working with any current working directory
2 participants