nodejs / nodejs/node

Build from source on Windows - Cargo error without Rust toolchain

Đang mở
#63,451 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

build windows
Ngôn ngữ chính
JavaScript
Star
122k
Fork
37.3k
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
283

Mô tả

Follows on from https://github.com/nodejs/node/issues/63213

Version

v27.0.0-pre 0e8fb913d857b0d4123995e401293a0c9ee5efd8

Platform
Microsoft Windows NT 10.0.26200.0 x64
Subsystem

build

What steps will reproduce the bug?

On Windows 11 25H2, follow prerequisite Manual install instructions using:

  • Python 3.14.5
  • Visual Basic 2026 Build Tools 18.6.0 (May 2026)
    • C++ Clang Compiler for Windows (Microsoft.VisualStudio.Component.VC.Llvm.Clang)
    • MSBuild support for LLVM (clang-cl) toolset (Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset)
  • NASM 3.01
  • Do not install a Rust toolchain (and otherwise ensure that there is no rustc or cargo installed).

In PowerShell 7 terminal, execute:

git clone https://github.com/nodejs/node
cd node
git switch main
git clean -xfd # if repeating
.\vcbuild.bat
Release\node -e "console.log('Hello from Node.js', process.version)"
How often does it reproduce? Is there a required condition?

Always if there is no Rust toolchain installed. Test with the following, which should both return errors:

rustc --version
cargo --version
What is the expected behavior? Why is that the expected behavior?

If a Rust toolchain is not installed, vcbuild.bat should warn (check for rustc & cargo) that Temporal support is disabled and continue to build without error.

This is implied by the documentation section Building Node.js with Temporal support and the fact that on Linux, builds succeed if there is no Rust toolchain installed.

If --v8-enable-temporal-support and --v8-disable-temporal-support are both omitted, configure.py probes for cargo and rustc. If either is missing, a warning is printed and Temporal support is disabled.

It should also be possible to disable temporal support actively when building under Windows.

What do you see instead?

Build emits error message and continues:

C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'Cargo.toml' exited with code 1
. [C:\Users\mikem\github\NODEJS\node\deps\crates\node_crates.vcxproj]

Directory Release is not created. (out\Release also contains no node.exe)

Additional information

Logs

.\vcbuild.bat
Looking for Python
Python found in C:\Users\mikem\AppData\Local\Microsoft\WindowsApps\\python.exe
Python 3.14.5
Looking for NASM
ClangCL is required because the Node.js version being compiled is >= 24.
Looking for Visual Studio 2026
calling: "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\\Auxiliary\Build\vcvarsall.bat" amd64
**********************************************************************
** Visual Studio 2026 Developer Command Prompt v18.6.0
** Copyright (c) 2026 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Found MSVS version 18.0
Found Clang version 20.1.8
configure  --dest-cpu=x64 --clang-cl=20.1.8
[WARNING] A shebang '/bin/sh' was found but does not match any supported template (e.g. '/usr/bin/python'), so it will be treated as an arbitrary command.
[WARNING] To prevent execution of programs that are not Python runtimes, set 'shebang_can_run_anything' to 'false' in your configuration file.
Node.js configure: Found Python 3.14.5...
Warning: Missing input files:
C:\Users\mikem\github\NODEJS\node\deps\uv\src\win\atomicops-inl.h
C:\Users\mikem\github\NODEJS\node\deps\inspector_protocol\crdtp\maybe.h
C:\Users\mikem\github\NODEJS\node\tools\v8_gypfiles\..\..\deps\v8\third_party\abseil-cpp\absl\base\internal\nullability_impl.h
C:\Users\mikem\github\NODEJS\node\tools\v8_gypfiles\..\..\deps\v8\third_party\abseil-cpp\absl\base\internal\fast_type_id.h
C:\Users\mikem\github\NODEJS\node\tools\v8_gypfiles\..\..\deps\v8\third_party\abseil-cpp\absl\base\internal\identity.h
INFO: configure completed successfully
Project files generated.

src\hdr_histogram.c(149,23): warning : incompatible pointer types passing 'uint32_t *' (aka 'unsigned int *') to parameter of type 'unsigned long *' [-Wincompatible-pointer-types] [C:\Us
ers\mikem\github\NODEJS\node\deps\histogram\histogram.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\Llvm\x64\lib\clang\20\include\intrin0.h(71,48): message : passing argument to parameter '_Index' here [C:\Users\mike
m\github\NODEJS\node\deps\histogram\histogram.vcxproj]
  In file included from src\hdr_histogram.c:18:
src\hdr_atomic.h(23,13): warning : unused function 'hdr_atomic_store_pointer' [-Wunused-function] [C:\Users\mikem\github\NODEJS\node\deps\histogram\histogram.vcxproj]
  histogram.vcxproj -> ..\..\out\Release\lib\histogram.lib
  cargo_build
  Traceback (most recent call last):
    File "C:\Users\mikem\github\NODEJS\node\deps\crates\cargo_build.py", line 60, in <module>
      main()
      ~~~~^^
    File "C:\Users\mikem\github\NODEJS\node\deps\crates\cargo_build.py", line 47, in main
      ret = subprocess.call(cmd)
    File "C:\Users\mikem\AppData\Local\Python\pythoncore-3.14-64\Lib\subprocess.py", line 396, in call
      with Popen(*popenargs, **kwargs) as p:
           ~~~~~^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mikem\AppData\Local\Python\pythoncore-3.14-64\Lib\subprocess.py", line 1039, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                          pass_fds, cwd, env,
                          ^^^^^^^^^^^^^^^^^^^
      ...<5 lines>...
                          gid, gids, uid, umask,
                          ^^^^^^^^^^^^^^^^^^^^^^
                          start_new_session, process_group)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mikem\AppData\Local\Python\pythoncore-3.14-64\Lib\subprocess.py", line 1553, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                         ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                               # no special security
                               ^^^^^^^^^^^^^^^^^^^^^
      ...<4 lines>...
                               cwd,
                               ^^^^
                               startupinfo)
                               ^^^^^^^^^^^^
  FileNotFoundError: [WinError 2] The system cannot find the file specified
C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Microsoft\VC\v180\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for 'Cargo.toml' exited with code 1
. [C:\Users\mikem\github\NODEJS\node\deps\crates\node_crates.vcxproj]

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với deps/crates/cargo_build.py và đường dẫn build Windows được vcbuild.bat gọi; so sánh phép thăm dò cargo/rustc của configure.py với hướng dẫn hỗ trợ Temporal trong BUILDING.md và hành vi Linux đã được báo cáo. Tái hiện với rustc và cargo không khả dụng, sau đó xác minh rằng build Windows hoàn tất mà không gặp lỗi dự án Cargo và cách được tài liệu hóa để tắt hỗ trợ Temporal hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, python, rust
Lĩnh vực
build-system, operating-systems
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.