Skip to content

[BUG] It doesn't build from a cloned repo under Alpine Linux #283

Description

@x-yuri

Describe the bug
It doesn't build, see below.

To Reproduce

$ docker run --rm -it alpine:3.17 sh
/ # apk add build-base git
/ # git clone https://github.com/lsof-org/lsof
/ # cd lsof

/lsof # ./Configure -n linux
./Configure: line 256: perl: not found
Testing C library type with cc ... done
The C library type is not glibc.
rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c dstore.c dzfs.h kernelbase.h machine.h machine.h.old new_machine.h __lseek.s Makefile Makefile.zfs ./tests/config.cflags
rm -f ./tests/config.cc ./tests/config.xobj ./tests/config.ldflags
Testing C library for localtime() and strftime(), using cc ... present
./Configure: line 4963: ./lib/dialects/linux/Mksrc: not found
Makefile and lib/Makefile created.
./tests/config.cc created
./tests/config.cflags created
./tests/config.ldflags created
./tests/config.xobj created

/lsof # make
(cd lib; make DEBUG="" CFGF="-DLINUXV=61012 -DHASIPv6 -DHASNORPC_H -DNEEDS_NETINET_TCPH -DHAS_DUP2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR=\"6.1.12-arch1-1\"")
make[1]: Entering directory '/lsof/lib'
cc  -DLINUXV=61012 -DHASIPv6 -DHASNORPC_H -DNEEDS_NETINET_TCPH -DHAS_DUP2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR="6.1.12-arch1-1"  -I.. -I../include -Idialects/linux    -c -o ckkv.o ckkv.c
cc  -DLINUXV=61012 -DHASIPv6 -DHASNORPC_H -DNEEDS_NETINET_TCPH -DHAS_DUP2 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAS_STRFTIME -DLSOF_VSTR="6.1.12-arch1-1"  -I.. -I../include -Idialects/linux    -c -o cvfs.o cvfs.c
cvfs.c:42:10: fatal error: ../machine.h: No such file or directory
   42 | #include "../machine.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [<builtin>: cvfs.o] Error 1
make[1]: Leaving directory '/lsof/lib'
make: *** [Makefile:96: lib/liblsof.a] Error 2

Expected behavior
It builds.

Program output
See above.

Environment (please complete the following information):

  • Kernel: Linux
  • OS: Arch Linux
  • lsof Version: master (44d61e8ca31bed00d946239d474f91947ac54bd2)
  • Origin: git

Additional context
The culprit. Was there a reason to switch to bash? Aside from switching back, you can use #!/usr/bin/env sh.

The workaround: install bash before building.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions