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

Prioritizing --help arg handling #6667

Merged
merged 28 commits into from
Mar 20, 2024

Conversation

cometkim
Copy link
Contributor

@cometkim cometkim commented Mar 5, 2024

cc @DZakh

This also indirectly fixes the indeterministic build timeout on the master branch

If the process intercepts and handles the SIGTERM signal and doesn't exit, the parent process will wait until the child process has exited.

@cometkim
Copy link
Contributor Author

cometkim commented Mar 5, 2024

This also indirectly fixes the indeterministic build timeout on the master branch

It should, but didn't

maybe we just need to avoid to use spawnSync in tests

@cometkim

This comment was marked as outdated.

rescript Outdated Show resolved Hide resolved
rescript Outdated Show resolved Hide resolved
scripts/rescript_bsb.js Outdated Show resolved Hide resolved
scripts/rescript_bsb.js Outdated Show resolved Hide resolved
@cometkim

This comment was marked as resolved.

@cometkim cometkim force-pushed the fix-help-with-args branch 2 times, most recently from 6d3f8f9 to 709d202 Compare March 6, 2024 18:14
@cometkim cometkim requested a review from DZakh March 15, 2024 14:14
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Great work fixing the build getting stuck! 👍

Some remarks:

jscomp/build_tests/utils.js Show resolved Hide resolved
SIGTERM: 15,
};

/**
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if you could add a comment here explaining why we need this function instead of spawnSync / what issue it fixes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is an asynchronous version of spawnSync, with no special behavior. But preferred than spawnSync because spawnSync is unstable for unknown reason.

I think it would be better to add some explanation onto execReScript util you suggested.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we can do it there, too.

async function test() {
{
// Shows build help with --help arg
const out = await exec(`../../../rescript`, ["build", "--help"], {
Copy link
Member

Choose a reason for hiding this comment

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

If we are already refactoring this, we could add a helper function in this file so that we can just write

const out = await execReScript(["build", "--help"]);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I separate it into a separate pure refactor PR?

Aside from the cli_help test, there are many other places to change.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, of course!

@DZakh
Copy link
Contributor

DZakh commented Mar 18, 2024

I'll take a look during the day

Copy link
Contributor

@DZakh DZakh left a comment

Choose a reason for hiding this comment

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

I'm not super familiar with FS api, but logic wise the code looks good 👍

@cometkim cometkim requested a review from cknitt March 20, 2024 15:09
@cknitt cknitt merged commit b5d901a into rescript-lang:master Mar 20, 2024
14 checks passed
@cometkim cometkim deleted the fix-help-with-args branch March 21, 2024 02:10
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.

None yet

3 participants