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

Replace path.join with path.resolve for absolute path handling #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BowTiedRadone
Copy link
Collaborator

This PR updates the codebase to use path.resolve instead of path.join for path resolution consistency. The changes include:

  • Replacing join with resolve across the app.
  • Ensuring all paths, such as manifest directories, deployment plans, and contract sources, are resolved to absolute paths.
  • Updating related variable names and comments to reflect the new behavior.

This PR will be complete when issue #64 is fully resolved across all architectures.

@BowTiedRadone BowTiedRadone requested a review from a team as a code owner December 19, 2024 22:24
Copy link
Member

@moodmosaic moodmosaic left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! It works as expected on Debian (as it should), but there's still an issue on Windows.


Works here on Debian:

  • Shell: /bin/bash
  • OS: Debian 12 (bookworm)
  • Architecture: aarch64
  • GCC: 12.2.0
  • Clang: 14.0.6

Doesn't work here (different error than in #64):

  • Shell: /bin/bash
  • OS: MINGW64_NT-10.0-22631
  • Architecture: x86_64
  • GCC: Not installed
  • Clang: Not installed
Nikos@WIN-ARM64 CLANGARM64 ~/dev/stacks/rendezvous (fix/paths-handling)
$ ./rv example/ counter test
Using manifest path: C:\Snapshot\dev\stacks\rendezvous\example\Clarinet.toml
Target contract: counter
node:internal/process/promises:389
      new UnhandledPromiseRejection(reason);
      ^

UnhandledPromiseRejection: This error originated either by throwing inside of
  an async function without a catch block, or by rejecting a promise which was
  not handled with .catch(). The promise rejected with the reason
  "unable to mutate url".
    at throwUnhandledRejectionsMode (node:internal/process/promises:389:7)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32) {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v20.18.1

@moodmosaic
Copy link
Member

Merge after CI setup in #75 or another round of manual checks.

This commit updates the codebase to use path.resolve instead of path.join for
path resolution consistency. The changes include:

- Replacing `join` with `resolve` across the app.
- Ensuring all paths, such as manifest directories, deployment plans, and
  contract sources, are resolved to absolute paths.
- Updating related variable names and comments to reflect the new behavior.
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.

2 participants