Skip to content

Conversation

Martinsos
Copy link
Member

@Martinsos Martinsos commented Oct 14, 2025

TODO:

  • Discuss some of the implementation details ("node.cmd" vs full path, ...), I left comments.
  • Add some tests.
  • Add CI support that runs what works so far on Windows in CI? Or make that a separate issue?
  • Add the two external contributors that did other two PRs, older and newer, as co-authors.

prismaExecutableAbs =
waspProjectDir
</> nodeModulesDirInWaspProjectDir
</> SP.castRel (getPathToExecutableInNodeModules "prisma")
Copy link
Member Author

Choose a reason for hiding this comment

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

We are now being system-agnostic here, when figuring out abs path to prisma binary.

@Martinsos Martinsos deployed to fly-deploy-test October 14, 2025 11:53 — with GitHub Actions Active
{-# NOINLINE nodeExec #-}
nodeExec :: ExecName
nodeExec =
-- NOTE: We are taking whole resolved absolute path here because just using the resolved exec name
Copy link
Member Author

Choose a reason for hiding this comment

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

This I am not super happy with.
So basically just resolving npm to npm.cmd was not enough, we were still getting errors on Windows. Not the same ones, we moved forward, but different kind, I wish I wrote them down, something about not being able to find some .js files in node_modules.
But maybe it is for the best to have absolute paths to executables we use? Not 100% sure, I think if npm.cmd was working I woudl have stuck with it.

Interested in discussion here. Maybe I should try I again and write down the errors, that might help us make a decision.

nodeExec =
-- NOTE: We are taking whole resolved absolute path here because just using the resolved exec name
-- was still flaky on Windows in some situations.
fromAbsFile $ snd $ unsafePerformIO $ resolveExecNameIO "node"
Copy link
Member Author

Choose a reason for hiding this comment

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

Instead of doing unsaferPerformIO, we could have actually obtained these in real IO, somweher at the start of our app, and then propagated them through the code, likely via our monad stack.
While that would be the "best" way to do it, I didn't think it makes much sense to bother with such big refactoring at the moment, for no real gain. We can do it if it turns out it is needed.

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.

1 participant