Skip to content

Add bsc_path helper + use bsc.exe for super-errors test #5471

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

Merged
merged 4 commits into from
Jun 26, 2022

Conversation

jchavarri
Copy link
Contributor

Fixes #5394.

Alternative to #5469.

  • Adds a helper bin_path.js where paths to bsc.exe and other binaries can be derived in a single place
  • Uses bsc.exe path directly in super-errors to avoid issues with hanging streams
  • Replaces manual calculations of paths with bin_path values across scripts.

Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

Looking great thank you!

@cristianoc cristianoc merged commit 68178bf into rescript-lang:master Jun 26, 2022
@jchavarri jchavarri deleted the bin_path branch June 26, 2022 17:23
@cknitt
Copy link
Member

cknitt commented Jun 26, 2022

@jchavarri @cristianoc This was merged even though it didn't build. It seems this PR broke Windows CI.

@jchavarri
Copy link
Contributor Author

@cknitt sorry, i wrongly assumed windows ci build was not 100% reliable yet. Will fix.

@jchavarri jchavarri mentioned this pull request Jun 26, 2022
@@ -130,7 +130,7 @@ function runTests() {
console.log(`testing ${file}`);
// note existsSync test already ensure that it is a directory
try {
cp.execSync(`node input.js`, { cwd: testDir, encoding: "utf8" });
cp.exec(`node input.js`, { cwd: testDir, encoding: "utf8" });
Copy link
Member

Choose a reason for hiding this comment

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

If this is not sync anymore, doesn't that mean that success will be logged immediately and failure not caught?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was originally exec and @cristianoc changed it to sync in jchavarri@0fbf257. I understood this was part of the fix for tests hanging, that we could safely revert now.

If a callback is passed to exec then everything should work fine:

If a callback function is provided, it is called with the arguments (error, stdout, stderr). On success, error will be null. On error, error will be an instance of Error. The error.code property will be the exit code of the process. By convention, any exit code other than 0 indicates an error. error.signal will be the signal that terminated the process.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Indeed the call-back needs to be added back, or this won't fail on failed tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added back in #5477.

@jchavarri jchavarri mentioned this pull request Jun 26, 2022
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.

Sometimes build tests don't complete
3 participants