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

Build failures in WSL Ubuntu #41459

Closed
MrJithil opened this issue Jan 10, 2022 · 4 comments
Closed

Build failures in WSL Ubuntu #41459

MrJithil opened this issue Jan 10, 2022 · 4 comments
Labels
build Issues and PRs related to build files or the CI. wsl Issues and PRs related to the Windows Subsystem for Linux.

Comments

@MrJithil
Copy link
Member

MrJithil commented Jan 10, 2022

Version

latest

Platform

Linux 5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

build

What steps will reproduce the bug?

Fresh checkout on a WSL Ubuntu.
run sh ./configure and observe an error as below:

: not found: 2:
: not found: 1:
Node.js configure: Found Python 3.8.10...
 not found (cwd: /mnt/e/OpenSource/node) while trying to load
Error running GYP

Screenshot:
image

How often does it reproduce? Is there a required condition?

Always in normal conditions.

What is the expected behavior?

Configure should be success as per the Build docs

What do you see instead?

Error and exit the process

Additional information

No response

@Mesteery Mesteery added build Issues and PRs related to build files or the CI. wsl Issues and PRs related to the Windows Subsystem for Linux. labels Jan 10, 2022
@MrJithil
Copy link
Member Author

Tried with a different flavor of ubuntu wsl and it above error is not showing unless we use sudo.

But, if we are running without sudo, error will be as below:

: not found: 2:
: not found: 1:
Node.js configure: Found Python 3.8.10...
Traceback (most recent call last):
  File "./configure", line 27, in <module>
    import configure
  File "/mnt/e/OpenSource/node/configure.py", line 1981, in <module>
    os.chmod('config.status', 0o775)
PermissionError: [Errno 1] Operation not permitted: 'config.status'

@MrJithil
Copy link
Member Author

Figured out that the issue is from run_gyp

@MrJithil
Copy link
Member Author

And finally, 2 hours of reverse engineering, helped me to figure out the issue.

https://github.com/nodejs/node/blob/master/configure.py#L2041 - calling the run_gyp->...->...->tools/gyp/pylib/gyp/input.py was throwing the error raise GypError(f"{build_file_path} not found (cwd: {os.getcwd()})")

The reason for this issue is from configure.py calling run_gyp() with some carriage returns (\r\r).

https://github.com/nodejs/node/blob/master/configure.py#L2035 - In this line, the \r\r is being added.

Once I commented out the code #gyp_args += args, all went well.

MrJithil added a commit to MrJithil/node that referenced this issue Jan 11, 2022
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: nodejs#41459
@MrJithil
Copy link
Member Author

Pull request created

targos pushed a commit that referenced this issue Jan 16, 2022
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: #41459

PR-URL: #41476
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
mawaregetsuka pushed a commit to mawaregetsuka/node that referenced this issue Jan 17, 2022
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: nodejs#41459

PR-URL: nodejs#41476
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
thedull pushed a commit to thedull/node that referenced this issue Jan 18, 2022
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: nodejs#41459

PR-URL: nodejs#41476
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Jan 31, 2022
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: nodejs#41459

PR-URL: nodejs#41476
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
danielleadams pushed a commit that referenced this issue Feb 1, 2022
On WSL systems, `./configure` causes appending of carriage return
(`\r\r`) as leftover and will be appended to the `gyp_args`.
Therefore, it will lead to unhandled exceptions from the `./configure`
execution.
Excluded the empty or whitespace item from the `args` array to
fix the issue.

Fixes: #41459

PR-URL: #41476
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. wsl Issues and PRs related to the Windows Subsystem for Linux.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants