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

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

Open
x-yuri opened this issue Mar 29, 2023 · 1 comment
Open

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

x-yuri opened this issue Mar 29, 2023 · 1 comment

Comments

@x-yuri
Copy link

x-yuri commented Mar 29, 2023

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.

@jiegec
Copy link
Contributor

jiegec commented Mar 29, 2023

sh might not support function in some places. I also suggest you to use the new build system based on autotools.

jiegec added a commit that referenced this issue Mar 30, 2023
This will reduce confusion, see #283.
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