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

can not compile - gnulib problem #114

Open
alperyilmaz opened this issue Aug 12, 2020 · 11 comments
Open

can not compile - gnulib problem #114

alperyilmaz opened this issue Aug 12, 2020 · 11 comments

Comments

@alperyilmaz
Copy link

Hi,
I checked out the latest commit d74313e53dfb and tried to compile.

I got the following error:

lib/freadseek.c: In function 'freadptrinc':
lib/freadseek.c:68:3: error: #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."
   68 |  #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."
      |   ^~~~~
make[4]: *** [Makefile:9351: lib/freadseek.o] Error 1
make[4]: Leaving directory '/home/alper/softwares/dgsh/unix-tools/coreutils'
make[3]: *** [Makefile:11764: all-recursive] Error 1
make[3]: Leaving directory '/home/alper/softwares/dgsh/unix-tools/coreutils'
make[2]: *** [Makefile:6303: all] Error 2
make[2]: Leaving directory '/home/alper/softwares/dgsh/unix-tools/coreutils'
make[1]: *** [Makefile:90: make] Error 2
make[1]: Leaving directory '/home/alper/softwares/dgsh/unix-tools'
make: *** [Makefile:81: unix-tools] Error 2

Then I installed gnulib via sudo apt install gnulib and re-compiled and I got the same error. Is this a problem with my system? (Ubuntu 20.04, Pop OS 20.04 actually)
I noticed in another post about this type of error, someone reported upgrading coreutils might be helpful. My coreutils version is 8.30-3ubuntu2.
Is there a workaround for this problem?
Thanks.

@dspinellis
Copy link
Owner

It looks like your system's implementation of GNU lib is not compatible with the dgsh port of GNU coreutils. Can you please try updating the coreutils repository to the current GNU coreutils version or to the version that ships with Pop OS 20.4?

@alperyilmaz
Copy link
Author

Thanks for your quick reply. I really appreciate your time although my problem is such a trivial one.
The info about coreutils in my systems is as follows (description part is clipped):

$ apt show coreutils
Package: coreutils
Version: 8.30-3ubuntu2
Priority: required
Essential: yes
Section: utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Michael Stone <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 7,369 kB
Pre-Depends: libacl1 (>= 2.2.23), libattr1 (>= 1:2.4.44), libc6 (>= 2.28), libselinux1 (>= 2.1.13)
Homepage: http://gnu.org/software/coreutils
Task: minimal
Download-Size: 1,249 kB
APT-Manual-Installed: yes
APT-Sources: http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages

coreutils download page has versions 8.31 and 8.32, should I be upgrading to 8.32?

@dspinellis
Copy link
Owner

No need to upgrade coreutils. The dgsh distribution contains its own patched version of coreutils, because some utilities are enhanced with multipipe functionality. This is the compilation that causes you a problem. So what you would need to do is to cd unix-tools/coreutils/, add as a remote origin the GNU coreutils Git repo, and merge the current version with the dgsh one.

@alperyilmaz
Copy link
Author

Hi, I tried installing coreutils in docker environment following the instruction at this site. The version number is shown below:

$ wc --version
wc (GNU coreutils) 8.32.54-5b816
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin and David MacKenzie.

Although ls still shows ls (GNU coreutils) 8.30 as its version number, other coreutils programs seemed upgraded. Then I followed instructions at dgsh site (checked out 5e09612ebf commit), and still get the same error:

lib/freadseek.c:68:3: error: #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."
   68 |  #error "Please port gnulib freadseek.c to your platform! Look at the definition of getc, getc_unlocked on your system, then report this to bug-gnulib."
      |   ^~~~~
make[4]: *** [Makefile:9351: lib/freadseek.o] Error 1
make[4]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils'
make[3]: *** [Makefile:11764: all-recursive] Error 1
make[3]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils'
make[2]: *** [Makefile:6303: all] Error 2
make[2]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils'
make[1]: *** [Makefile:90: make] Error 2
make[1]: Leaving directory '/home/docker/dgsh/unix-tools'
make: *** [Makefile:81: unix-tools] Error 2

I shared the Dockerfile in a newly created repo. How can I resolve or debug this issue? The expression "Please port gnulib freadseek.c to your platform!" is puzzling, I insallted gnulib package and compiled again with no luck.
I was wondering, if this is a issue with Ubuntu coreutils or not. Am I the only person not being able to install dgsh in Ubuntu?
Thanks..

@alperyilmaz
Copy link
Author

Ooops, I missed your reply when I was preparing my reply. So, I merge coreutils first and then compile dgsh.. I'll try that..

@dspinellis
Copy link
Owner

Trying to compile coreutils from source on your system is also a good approach. I think some preprocessor definition may be missing.

@alperyilmaz
Copy link
Author

Hi again, the current remote url for unix-tools/coreutils is show as "https://github.com/mfragkoulis/coreutils", I replace it with "https://www.github.com/coreutils/coreutils.git" and try to merge/pull and then compile..

@alperyilmaz
Copy link
Author

Sorry for bothering again. I tried to change the submodule to coreutils repo and did the following commands (taken from this post, I hope I did them right). I'm not sure if gnulib, which is sub-submodule, is taken care of correctly.

nano .gitmodules
#change url for coreutils module to https://github.com/coreutils/coreutils
git submodule sync --recursive
cd unix-tools/coreutils
git fetch
git checkout origin/master
git branch master -f
git checkout master

then I did make config and make, this time I got the following error:

make[3]: Entering directory '/home/docker/dgsh/unix-tools/coreutils'
Making all in po
make[4]: Entering directory '/home/docker/dgsh/unix-tools/coreutils/po'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils/po'
Making all in .
make[4]: Entering directory '/home/docker/dgsh/unix-tools/coreutils'
Updating ./doc/version.texi
  GEN      doc/constants.texi
make[4]: *** No rule to make target 'doc/fdl.texi', needed by 'doc/coreutils.info'.  Stop.
make[4]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils'
make[3]: *** [Makefile:12957: all-recursive] Error 1
make[3]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils'
make[2]: *** [Makefile:7056: all] Error 2
make[2]: Leaving directory '/home/docker/dgsh/unix-tools/coreutils'
make[1]: *** [Makefile:90: make] Error 2
make[1]: Leaving directory '/home/docker/dgsh/unix-tools'
make: *** [Makefile:81: unix-tools] Error 2

@alperyilmaz
Copy link
Author

I thought I might have messed up submodule update so I tried getting the submodules manually by:

git clone  https://github.com/dspinellis/dgsh.git
cd dgsh/unix-tools/
git clone https://github.com/mfragkoulis/bash.git
git clone --recursive https://github.com/mfragkoulis/grep
git clone --recursive https://github.com/coreutils/coreutils.git
cd ..

after that, make config completed fine and make gave error:

make[5]: Entering directory '/home/docker/dgsh/unix-tools/grep/lib'
  CC       argmatch.o
gcc: warning: switch '-Wchkp' is no longer supported
cc1: error: '-Wabi' won't warn about anything [-Werror=abi]
cc1: note: '-Wabi' warns about differences from the most up-to-date ABI, which is also used by default
cc1: note: use e.g. '-Wabi=11' to warn about changes from GCC 7
cc1: all warnings being treated as errors
make[5]: *** [Makefile:1705: argmatch.o] Error 1
make[5]: Leaving directory '/home/docker/dgsh/unix-tools/grep/lib'
make[4]: *** [Makefile:1473: all] Error 2
make[4]: Leaving directory '/home/docker/dgsh/unix-tools/grep/lib'
make[3]: *** [Makefile:1288: all-recursive] Error 1
make[3]: Leaving directory '/home/docker/dgsh/unix-tools/grep'
make[2]: *** [Makefile:1229: all] Error 2
make[2]: Leaving directory '/home/docker/dgsh/unix-tools/grep'
make[1]: *** [Makefile:91: make] Error 2
make[1]: Leaving directory '/home/docker/dgsh/unix-tools'
make: *** [Makefile:81: unix-tools] Error 2

@alperyilmaz
Copy link
Author

sorry for too much chatter, I'm just trying to document the struggle while I'm trying to compile dgsh. I tried debian:stable docker image to compile instead of ubuntu container and I got the same results, meaning;

  • recursively check out dgsh repo and then make config / make -> Please port gnulib freadseek.c to your platform
  • clone dgsh repo, get submodules manually -> cc1: error: -Wabi won't warn about anything [-Werror=abi]

I guess this is not ubuntu or my system specific problem..

@dspinellis
Copy link
Owner

Documenting is good! Problem 2 seems to be a GNU coreutils problem. It should be easy to resolve by them, once reported. Problem 1 will be solved when 2 is solved and then the dgsh changes are merged into the updated coreutils version.

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