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

installation instructions do not mention tar.exe is required on a PATH #227

Closed
nikmalenovic opened this issue Aug 8, 2021 · 1 comment
Closed

Comments

@nikmalenovic
Copy link

Describe the bug
Alternative installation instructions fail to mention requirement that tar.exe capable of handling bzip content is on the path, e.g. libarchive's bsdtar with a link from bsdtar.exe to tar.exe since CMakeLists.txt hardcodes the tar executable name as tar without an opportunity to specify or discover alternative executable names.

To Reproduce
Use Windows 2012 R2 x64 (Microsoft Windows [Version 6.3.9600]). Install Visual C++ redistributable 2013 x64. Install SAP NW RFC SDK 7.50 (750 Patch Level 8). Install node.js LTS 14 (14.17.3) along with tooling. Set SAPNWRFC_HOME=c:\nwrfcsdk. Add c:\nwrfcsdk\lib to the PATH. Check that rfcexec (c:\nwrfcsdk\bin\rfcexec.exe) runs without errors. Install Visual Studio 2019 for C++ build. Follow the alternative installation instructions (git clone, npm install, npm run addon). Build errors out with "file RENAME failed to rename" on line 69 of CMakeLists.txt which attempts to rename folder created by tar command on line 67: execute_process(COMMAND tar -xzf ${NODE_HEADERS_DOWNLD_PATH}).

Screenshots
The following is the transcript showing the error on a system without tar.exe in the path:


C:\temp>git clone --single-branch https://github.com/SAP/node-rfc.git
Cloning into 'node-rfc'...
remote: Enumerating objects: 2737, done.
remote: Counting objects: 100% (528/528), done.
remote: Compressing objects: 100% (267/267), done.
remote: Total 2737 (delta 377), reused 360 (delta 256), pack-reused 2209R
Receiving objects: 100% (2737/2737), 15.21 MiB | 6.09 MiB/s, done.
Resolving deltas: 100% (1800/1800), done.

C:\temp>cd node-rfc

C:\temp\node-rfc>npm install

> node-rfc@2.5.1 preinstall C:\temp\node-rfc
> npm install cmake-js prebuild-install prebuild node-addon-api

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-
random for details.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ node-addon-api@4.0.0
+ prebuild@10.0.1
+ cmake-js@6.2.1
+ prebuild-install@6.1.3
added 811 packages from 485 contributors and audited 812 packages in 84.942s

54 packages are looking for funding
  run `npm fund` for details

found 4 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

> node-rfc@2.5.1 install C:\temp\node-rfc
> prebuild-install --tag-prefix -r napi || cmake-js rebuild

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

audited 812 packages in 89.995s

54 packages are looking for funding
  run `npm fund` for details

found 4 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

C:\temp\node-rfc>npm run addon

> node-rfc@2.5.1 addon C:\temp\node-rfc
> prebuild --backend cmake-js -r napi --force --strip --verbose

prebuild info begin Prebuild version 10.0.1
prebuild info build Preparing to prebuild node-rfc@2.5.1 for napi 6 on win32-x64 using cmake-js
prebuild verb starting build process cmake-js
[
  'C:\\Program Files\\nodejs\\node.exe',
  'C:\\temp\\node-rfc\\node_modules\\cmake-js\\bin\\cmake-js',
  'rebuild',
  '--arch=x64',
  '--CDnapi_build_version=6'
]
info TOOL Using Visual Studio 16 2019 generator.
info CMD CLEAN
info RUN [ 'cmake', '-E', 'remove_directory', 'C:\\temp\\node-rfc\\build' ]
info CMD CONFIGURE
info RUN [
info RUN   'cmake',
info RUN   'C:\\temp\\node-rfc',
info RUN   '--no-warn-unused-cli',
info RUN   '-G',
info RUN   'Visual Studio 16 2019',
info RUN   '-A',
info RUN   'x64',
info RUN   '-DCMAKE_JS_VERSION=6.2.1',
info RUN   '-DCMAKE_BUILD_TYPE=Release',
info RUN   '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=C:\\temp\\node-rfc\\build',
info RUN   '-DCMAKE_JS_INC=C:\\Users\\%USERNAME%\\.cmake-js\\node-x64\\v14.17.4\\include\\node',
info RUN   '-DCMAKE_JS_SRC=C:/temp/node-rfc/node_modules/cmake-js/lib/cpp/win_delay_load_hook.cc',
info RUN   '-DNODE_RUNTIME=node',
info RUN   '-DNODE_RUNTIMEVERSION=14.17.4',
info RUN   '-DNODE_ARCH=x64',
info RUN   '-DCMAKE_JS_LIB=C:\\Users\\%USERNAME%\\.cmake-js\\node-x64\\v14.17.4\\win-x64\\node.lib',
info RUN   '-Dnapi_build_version=6',
info RUN   '-DCMAKE_SHARED_LINKER_FLAGS=/DELAYLOAD:NODE.EXE'
info RUN ]
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 6.3.9600.
-- The C compiler identification is MSVC 19.29.30040.0
-- The CXX compiler identification is MSVC 19.29.30040.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30037/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Downloading node-v14.17.4-headers.tar.gz to C:/temp/node-rfc/build/node-v14.17.4-headers.tar.gz ...
CMake Error at CMakeLists.txt:69 (file):
  file RENAME failed to rename

    C:/temp/node-rfc/build/node-v14.17.4/include

  to

    C:\Users\%USERNAME%\AppData\Roaming\npm/include

  because: The system cannot find the path specified.





N-API version: 6   C:\Users\%USERNAME%\AppData\Roaming\npm/include
SAP NWRFC SDK: 750 Patch Level 8

-- Configuring incomplete, errors occurred!
See also "C:/temp/node-rfc/build/CMakeFiles/CMakeOutput.log".
ERR! OMG Process terminated: 1
prebuild ERR! build Error: Failed to build cmake with exit code 1
prebuild ERR! build     at ChildProcess.<anonymous> (C:\temp\node-rfc\node_modules\prebuild\cmakebuild.js:32:19)
prebuild ERR! build     at ChildProcess.emit (events.js:400:28)
prebuild ERR! build     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! node-rfc@2.5.1 addon: `prebuild --backend cmake-js -r napi --force --strip --verbose`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the node-rfc@2.5.1 addon script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\%USERNAME%\AppData\Roaming\npm-cache\_logs\2021-08-08T21_45_47_581Z-debug.log

C:\temp\node-rfc>

Environment

  • The output of node -p "require('node-rfc').environment" is not available because module won't install

Additional context
Certain Windows 10 builds ship with libarchive's bsdtar implementation in C:\Windows\System32\tar.exe - see Microsoft blog post ; or download your own copy from libarchive. Once downloaded, add it's bin to path and use mklink to link bsdtar.exe as tar.exe.

@bsrdjan bsrdjan closed this as completed in 886aea9 Aug 9, 2021
@bsrdjan bsrdjan reopened this Aug 9, 2021
@bsrdjan
Copy link
Contributor

bsrdjan commented Aug 9, 2021

Thank you very much for finding this bug. There is a new CMake option for using any unarchiver available on system now incorporated into CMakeLists: 886aea9

The fix will be shipped in next release.

@bsrdjan bsrdjan closed this as completed Aug 9, 2021
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

No branches or pull requests

2 participants