mapbox / mapbox/cmake-node-module

Running the example fails

未关闭
#1 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
CMake
星标
20
派生
3
PR 合并指标
30 天内没有已合并 PR

描述

I've got the following trace :
```
$ ./run.sh
> simple@1.0.0 install /tmp/cmake-node-module/test/simple
> cmake-node-module

-- The CXX compiler identification is GNU 8.2.1
-- The C compiler identification is GNU 8.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning at node_modules/@mapbox/cmake-node-module/module.cmake:64 (message):
[Node.js] Unused arguments: 'INSTALL_DIR;lib'
Call Stack (most recent call first):
CMakeLists.txt:8 (add_node_module)

-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/cmake-node-module/test/simple/build
Scanning dependencies of target simple.abi-64
[ 50%] Building CXX object CMakeFiles/simple.abi-64.dir/simple.cpp.o
[100%] Linking CXX shared library simple.abi-64.node
[100%] Built target simple.abi-64
npm WARN simple@1.0.0 No description
npm WARN simple@1.0.0 No repository field.
npm WARN simple@1.0.0 No license field.

audited 1 package in 2.257s
found 0 vulnerabilities

internal/modules/cjs/loader.js:583
throw err;
^

Error: Cannot find module './simple.abi-64'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object. (/tmp/cmake-node-module/test/simple/simple.js:1:80)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
[1] 4465 exit 1 ./run.sh
```

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

在 test/simple 中运行 ./run.sh,并检查 test/simple/simple.js 的失败信息。阅读 add_node_module 调用处的 CMakeLists.txt,以及第 64 行附近的 node_modules/@mapbox/cmake-node-module/module.cmake,然后将构建出的 .node 文件与正在 require 的路径进行比较。当示例能够成功运行且不再出现 module-not-found 错误时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cmake, cpp, javascript, node.js
领域
build-system, devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。