Skip to content

Prioritizing --help arg handling #6667

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 28 commits into from
Mar 20, 2024

Conversation

cometkim
Copy link
Member

@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
Member 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.

@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 force-pushed the fix-help-with-args branch from 709d202 to 6098902 Compare March 6, 2024 18:28
@cometkim cometkim force-pushed the fix-help-with-args branch from acd2ca7 to 321013c Compare March 6, 2024 19:22
@cometkim cometkim force-pushed the fix-help-with-args branch from 7abc713 to 09f6741 Compare March 6, 2024 20:22
@cometkim cometkim force-pushed the fix-help-with-args branch from 4d37a0f to e4134be Compare March 15, 2024 12:30
@cometkim cometkim force-pushed the fix-help-with-args branch from e4134be to 3d47b87 Compare March 15, 2024 12:38
@cometkim cometkim force-pushed the fix-help-with-args branch from accc231 to f3bbcb7 Compare March 15, 2024 13:27
@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:

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
Member 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
Member 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
Member

DZakh commented Mar 18, 2024

I'll take a look during the day

Copy link
Member

@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
tsnobip added a commit that referenced this pull request Jan 31, 2025
cknitt added a commit that referenced this pull request Feb 1, 2025
* backport bundle stdlib JS files for playground (#7255)

* replace deprecated pipes with shlex

* update setup-ocaml

* use node 18

* add rollup linux as an optional dependency

* use ubuntu-24.04 and ubuntu-24.04-arm

* backport fix for hanging tests (#6667)

* update artifacts.txt

* backport: CI: don't run npm pack twice (#6923)

* CI: don't run npm pack twice

* Add typedefs for PackOutput

* Update comments

* update artifacts

* Fix CHANGELOG.md

---------

Co-authored-by: Christoph Knittel <[email protected]>
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.

3 participants