Skip to content

pass 'detached:true' for diff tool#56293

Merged
rbuckton merged 2 commits into
mainfrom
exec-detached
Nov 3, 2023
Merged

pass 'detached:true' for diff tool#56293
rbuckton merged 2 commits into
mainfrom
exec-detached

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

@rbuckton rbuckton commented Nov 2, 2023

Properly detach subprocess when spawning diff tool for hereby diff so that it doesn't terminate immediately when the NodeJS process terminates.

@rbuckton rbuckton requested a review from jakebailey November 2, 2023 14:54
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 2, 2023
Copy link
Copy Markdown
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

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

To be honest I didn't even know anyone used this and considered removing it... I just diff using a shell alias as the diff command we have in CONTRIBUTING is extremely useful elsewhere.

Comment thread scripts/build/utils.mjs
else {
proc.unref();
// wait a short period in order to allow the process to start successfully before Node exits.
setTimeout(() => resolve({ exitCode: undefined }), 100);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't someone still need to resolve this promise? Otherwise hereby will just keep running? (I haven't tested quite yet)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, fair point. I'll fix.

@rbuckton
Copy link
Copy Markdown
Contributor Author

rbuckton commented Nov 2, 2023

To be honest I didn't even know anyone used this and considered removing it... I just diff using a shell alias as the diff command we have in CONTRIBUTING is extremely useful elsewhere.

I use this quite regularly.

@jakebailey
Copy link
Copy Markdown
Member

Tested this out locally, and it seems like output doesn't appear:
image

But, it also doesn't show up on main either...

@rbuckton
Copy link
Copy Markdown
Contributor Author

rbuckton commented Nov 3, 2023

Ah, the diff build task is primarily designed to launch a GUI diff tool, like Beyond Compare, so it doesn't redirect standard output to the console.

@jakebailey
Copy link
Copy Markdown
Member

Oh, gotcha. Not a regression, of course, just not what I thought it was for.

@rbuckton rbuckton merged commit e1ef69d into main Nov 3, 2023
@rbuckton rbuckton deleted the exec-detached branch November 3, 2023 15:18
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants