iovisor / iovisor/bcc

Cannot install lua bpf or ljsyscall packages

Open
#2,587 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

When I try to use bcc from lua such as from examples I get the error:

```
luajit: examples/lua/kprobe-write.lua:20: module 'bpf' not found:
no field package.preload['bpf']
no file 'src/lua//bpf.lua'
no file './bpf.lua'
no file '/usr/share/luajit-2.1.0-beta3/bpf.lua'
no file '/usr/local/share/lua/5.1/bpf.lua'
no file '/usr/local/share/lua/5.1/bpf/init.lua'
no file '/usr/share/lua/5.1/bpf.lua'
no file '/usr/share/lua/5.1/bpf/init.lua'
no file './bpf.so'
no file '/usr/local/lib/lua/5.1/bpf.so'
no file '/usr/lib64/lua/5.1/bpf.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'require'
examples/lua/kprobe-write.lua:20: in main chunk
[C]: in function 'dofile'
src/lua//bcc/run.lua:67: in function
src/lua/bcc-probe:20: in main chunk
[C]: at 0x55e858a51200

```

When I try to install bpf via luarocks I get caught in a dependency error where I cannot install the ljsyscall dependency. It's claiming to support 5.1 and 5.4 (which is not released yet).

```
[*] sudo luarocks install --server=https://luarocks.org/dev bpf 130 ↵
Installing https://luarocks.org/dev/bpf-scm-1.rockspec
Missing dependencies for bpf scm-1:
ljsyscall >= 0.12 (not installed)

bpf scm-1 depends on ljsyscall >= 0.12 (not installed)

Error: Could not satisfy dependency ljsyscall >= 0.12: Matching ljsyscall versions support only Lua 5.1 and Lua 5.4 but not Lua 5.3.
```

Is this something someone has a fix for, or is there a recommend course of action?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with examples/lua/kprobe-write.lua and src/lua/bcc/run.lua to reproduce the missing bpf module, then inspect the luarocks bpf and ljsyscall dependency metadata described in the report. Done means the Lua package dependencies install under the reported Lua version and the example runs without the module-not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, lua
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.