openresty / openresty/luajit2

s390x - attempt to call global 'require' (a nil value)

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.4k
Forks
252
Avg merge
7d 11h
Merged PRs (30d)
3

Description

Issue

This issue occurs on Alpine (specifically, in a Docker container). When I try to run a file foo.lua with the following code in it:

local ffi = require('ffi')

ffi.cdef[[
typedef struct {
  size_t total_size;
  size_t off;
  size_t len;
  uint8_t * src;
  uint8_t byte;
} count_eq_data;
]]

I get an error message like so:

/usr/bin/luajit: foo.lua:1: attempt to call global 'require' (a nil value)

How to reproduce

You will need Docker available, and the daemon running.

  1. Run docker run --privileged multiarch/qemu-user-static --reset -p yes
  2. Run docker run --rm -i -t s390x/alpine:latest to start a shell in the emulated Alpine container.
  3. Run apk update followed by apk add luajit.
  4. Put the contents of the above Lua code into a file foo.lua.
  5. Attempt luajit foo.lua,
  6. Enjoy the error.

Expected behaviour

The script should execute (doing nothing), and return a success status code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the listed Docker commands on s390x Alpine, using foo.lua and the luajit entry point. Investigate why the global require is unavailable in this environment; done means the script runs successfully and returns a success status code.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.