Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

fix: missing entrypoint when launched from self-created child process #1949

Merged
merged 3 commits into from
Jun 21, 2023
Merged

fix: missing entrypoint when launched from self-created child process #1949

merged 3 commits into from
Jun 21, 2023

Conversation

Luzzifus
Copy link
Contributor

There is a bug that occurs when a packaged executable (Windows 11) is launched from a child process which was created by the executable itself (like for a self updating executable). This bug was reported already in #1861.

It seems that there is a conditional block at the start of bootstrap.js which has the potential to cause ENTRYPOINT to become undefined. I have to admit that I don't understand the purpose of the that specific code block, but I understand as much as that there always needs to be an entrypoint to successfully launch the executable. So I simply added an else statement as a fall back to the DEFAULT_ENTRYPOINT.

Copy link
Contributor

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

Could you add a test that covers this?

@Luzzifus
Copy link
Contributor Author

Could you add a test that covers this?

I added one. I also changed the actual fix a little bit to make sure it really only is a fallback for the case that argv[1] is undefined after all other modifications to argv.

@robertsLando robertsLando changed the title fix missing entrypoint when launched from self-created child process fix: missing entrypoint when launched from self-created child process Jun 20, 2023
Copy link
Contributor

@robertsLando robertsLando left a comment

Choose a reason for hiding this comment

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

Thanks for the test. Could you also fix lint issues please?

@Luzzifus
Copy link
Contributor Author

Thanks for the test. Could you also fix lint issues please?

How would I do that? I ran yarn lint and yarn fix locally and it didn't change anything and I also got neither warnings nor errors for the files I changed/added.

@robertsLando
Copy link
Contributor

The error is shown here: https:/vercel/pkg/actions/runs/5321783982/jobs/9638103625?pr=1949#step:6:19

Try using npx eslint lib prelude test --fix

@Luzzifus
Copy link
Contributor Author

Got it. Fixed.

@robertsLando robertsLando merged commit 73a03d1 into vercel:main Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants