sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.87k stars 130 forks source link

Failed to build under FreeBSD 10.1-STABLE #121

Closed iron-udjin closed 9 years ago

iron-udjin commented 9 years ago

Hello,

I'm trying to build rmlint-2.2.0 under FreeBSD 10.1-STABLE r282569M. Here is output:

$ scons
scons: Reading SConscript files ...
Checking whether the C compiler works(cached) yes
Checking for git revision... fatal: Not a git repository (or any parent up to mount point /usr/home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Unable to find git revision.
(cached) unknown
Checking for pkg-config... (cached) yes
Checking for glib-2.0 >= 2.32... (cached) yes
Checking for gio-unix-2.0... (cached) yes
Checking for blkid... (cached) no
Checking for json-glib-1.0... (cached) yes
Checking for -std=c11 support...(cached) yes
Checking whether __SSE4_2__ is declared... (cached) yes
Checking whether blkid_devno_to_wholedisk is declared... (cached) no
Checking for existence of /sys/block... (cached) no
Checking for C function sysctlbyname()... (cached) yes
Checking for C header file libelf.h... (cached) yes
Checking for C library libelf... (cached) yes
Checking for C type struct fiemap... (cached) no
Checking for C function getxattr()... (cached) no
Checking size of off_t ... (cached) yes
Checking for C function stat64()... (cached) no
Checking whether G_CHECKSUM_SHA512 is declared... (cached) yes
Checking for C header file locale.h... (cached) yes
Checking for C header file sqlite3.h... (cached) yes
Checking for C library sqlite3... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
Building manpage from rst...
Using sphinx-build binary: /usr/local/bin/sphinx-build
Cannot import sphinx_bootstrap_theme; falling back to `nature`.
gzip_file(["docs/rmlint.1.gz"], ["docs/_build/man/rmlint.1"])
build_config_template(["lib/config.h"], ["lib/config.h.in"])
Compiling ==> lib/cmdline.c
In file included from /usr/include/_ctype.h:94:0,
                 from /usr/include/ctype.h:46,
                 from lib/cmdline.c:30:
/usr/include/runetype.h:92:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
 extern _Thread_local const _RuneLocale *_ThreadRuneLocale;
                      ^
/usr/include/runetype.h: In function '__getCurrentRuneLocale':
/usr/include/runetype.h:96:6: error: '_ThreadRuneLocale' undeclared (first use in this function)
  if (_ThreadRuneLocale) 
      ^
/usr/include/runetype.h:96:6: note: each undeclared identifier is reported only once for each function it appears in
scons: *** [lib/cmdline.o] Error 1
scons: building terminated because of errors
$ cc -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix
$ scons --version
SCons by Steven Knight et al.:
    script: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep
    engine: v2.3.0, 2013/03/03 09:48:35, by garyo on reepicheep
    engine path: ['/usr/local/lib/scons-2.3.0/SCons']
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
sahib commented 9 years ago

Hello.

Hmm, sadly this compiler error is not very enlightening. A quick search yielded that some other people had this problem with other packages (lsof) on FreeBSD 10.1. Maybe something wrong in your build env...

Can you try to use a different compiler (i.e. gcc)?

$ CC=gcc scons

I already built rmlint on a FreeBSD 10.1 box today, so it should work out somehow. :smiley:

iron-udjin commented 9 years ago

The same result:

$ CC=gcc48 scons
scons: Reading SConscript files ...
Checking whether the C compiler worksyes
Checking for git revision... fatal: Not a git repository (or any parent up to mount point /usr/home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Unable to find git revision.
(cached) unknown
Checking for pkg-config... yes
Checking for glib-2.0 >= 2.32... yes
Checking for gio-unix-2.0... yes
Checking for blkid... no
Checking for json-glib-1.0... yes
>> Using compiler: gcc48
Checking for -std=c11 support...(cached) yes
Checking whether __SSE4_2__ is declared... yes
Checking whether blkid_devno_to_wholedisk is declared... no
Checking for existence of /sys/block... (cached) no
Checking for C function sysctlbyname()... yes
Checking for C header file libelf.h... yes
Checking for C library libelf... yes
Checking for C type struct fiemap... no
Checking for C function getxattr()... no
Checking size of off_t ... yes
Checking for C function stat64()... no
Checking whether G_CHECKSUM_SHA512 is declared... yes
Checking for C header file locale.h... yes
Checking for C header file sqlite3.h... yes
Checking for C library sqlite3... yes
scons: done reading SConscript files.
scons: Building targets ...
Building manpage from rst...
Using sphinx-build binary: /usr/local/bin/sphinx-build
Cannot import sphinx_bootstrap_theme; falling back to `nature`.
gzip_file(["docs/rmlint.1.gz"], ["docs/_build/man/rmlint.1"])
build_config_template(["lib/config.h"], ["lib/config.h.in"])
Compiling ==> lib/cfg.c
Compiling ==> lib/checksum.c
Compiling ==> lib/checksums/city.c
Compiling ==> lib/checksums/murmur3.c
Compiling ==> lib/checksums/spooky-c.c
Compiling ==> lib/cmdline.c
In file included from /usr/include/_ctype.h:94:0,
                 from /usr/include/ctype.h:46,
                 from lib/cmdline.c:30:
/usr/include/runetype.h:92:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
 extern _Thread_local const _RuneLocale *_ThreadRuneLocale;
                      ^
/usr/include/runetype.h: In function '__getCurrentRuneLocale':
/usr/include/runetype.h:96:6: error: '_ThreadRuneLocale' undeclared (first use in this function)
  if (_ThreadRuneLocale) 
      ^
/usr/include/runetype.h:96:6: note: each undeclared identifier is reported only once for each function it appears in
scons: *** [lib/cmdline.o] Error 1
scons: building terminated because of errors.
iron-udjin commented 9 years ago

I just ried to compile on another FreeBSD server:

scons: Reading SConscript files ...
Checking whether the C compiler worksyes
Checking for git revision... git: not found
Unable to find git revision.
(cached) unknown
Checking for pkg-config... yes
Checking for glib-2.0 >= 2.32... yes
Checking for gio-unix-2.0... yes
Checking for blkid... no
Checking for json-glib-1.0... no
Checking for -std=c11 support...(cached) yes
Checking whether __SSE4_2__ is declared... yes
Checking whether blkid_devno_to_wholedisk is declared... no
Checking for existence of /sys/block... (cached) no
Checking for C function sysctlbyname()... yes
Checking for C header file libelf.h... yes
Checking for C library libelf... yes
Checking for C type struct fiemap... no
Checking for C function getxattr()... no
Checking size of off_t ... yes
Checking for C function stat64()... no
Checking whether G_CHECKSUM_SHA512 is declared... yes
Checking for C header file locale.h... yes
Checking for C header file sqlite3.h... yes
Checking for C library sqlite3... yes
scons: done reading SConscript files.
scons: Building targets ...
Building manpage from rst...
Using sphinx-build binary: /usr/local/bin/sphinx-build
Cannot import sphinx_bootstrap_theme; falling back to `nature`.
gzip_file(["docs/rmlint.1.gz"], ["docs/_build/man/rmlint.1"])
build_config_template(["lib/config.h"], ["lib/config.h.in"])
Compiling ==> lib/cfg.c
Compiling ==> lib/checksum.c
Compiling ==> lib/checksums/city.c
Compiling ==> lib/checksums/murmur3.c
Compiling ==> lib/checksums/spooky-c.c
Compiling ==> lib/cmdline.c
Compiling ==> lib/file.c
Compiling ==> lib/formats/csv.c
Compiling ==> lib/formats/fdupes.c
Compiling ==> lib/formats/json.c
Compiling ==> lib/formats/null.c
Compiling ==> lib/formats/pretty.c
Compiling ==> lib/formats/progressbar.c
build_python_formatter(["lib/formats/py.c"], ["lib/formats/py.c.in"])
Compiling ==> lib/formats/py.c
build_sh_formatter(["lib/formats/sh.c"], ["lib/formats/sh.c.in"])
Compiling ==> lib/formats/sh.c
Compiling ==> lib/formats/summary.c
Compiling ==> lib/formats/timestamp.c
Compiling ==> lib/formats.c
Compiling ==> lib/pathtricia.c
lib/pathtricia.c:30:10: fatal error: 'linux/limits.h' file not found
#include <linux/limits.h>
         ^
1 error generated.
scons: *** [lib/pathtricia.o] Error 1
scons: building terminated because of errors.
iron-udjin commented 9 years ago

Finally I compilled it after I replaced all:

#include <linux/limits.h>

to:

#include <limits.h>

But when I tried to run it, I got:

# ./rmlint --progress /usr/ports/
▕░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▏                                                                                                     Traversing (119213 usable files / 3 + 0 ignored files / folders)
▕░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▏                                                                                                Preprocessing (fiemap: +114981 -114981 #114984 / found 19 other lint)
▕░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▏                                                                                                      Matching (2180 dupes of 1446 originals; 0 B to scan in 0 files)

==> In total 119213 files, whereof 2180 are duplicates in 1446 groups.
==> This equals 1.90 MB of duplicates which could be removed.
==> 19 other suspicious item(s) found, which may vary in size.

Wrote a json file to: /root/rmlint-2.2.0/rmlint.json
Wrote a sh file to: /root/rmlint-2.2.0/rmlint.sh
Thread 401ac00 has exited with leftover thread-specific data afteTrh r4e adde s3tbr62ucc0t0o rh aist eerxaittieodn sw
ith leftover thread-specific data after 4 destructor iterations
Thread 3fbe800 has exited with leftover thread-specific data after 4 destructor iterations
Thread 3c6fc0Thre0ad  h4a0s1 be0x0i0t ehda swit h elxeiftteodv ewri tthh rleeafdt-osvpeerc iTtfhhircreead adda t3ab 6a3f4t0e0r  h4a sd eesxtirtuec-d twoisrpte hciitfei cl efrtdataitoonas 
avfer ttherre a4d -desstpreuccitoTrf hiircet addeTa 3hrrtfab daTact0iho0TTrneafherast
e rhde a d4ha 3 dd e4rsesb06324 0e1xaitTr08t0edu f hTahcrtbwe0 Thhor0aThdarre ehreesa ads ad0 ieitther0x i  tlea3t4i eedf f014addx3t ov0e1bi4b8o0 Trhh3ct60 hr a0afsbnebwdit hfe8t84s0exi tla000 de0 0h0r xesd
3 b ihhteeef6h3a adasd-0ses t oe00pd e cwihtehx viia shwaxs eeaxsitit re  x exelietffteiiteetd hdt clefowii  dd wdv iwiwatietrtwtiah hlteeftovreettr  ttharodh htrdv-espl eehhr  tehera awd-hs d -lfiptciafleflheesapeefecifitcteocfiifttvoo ficd e-s dacvpetveerr  dlacttiaf t hr ateicotrr dafftverh ratteeh rth4roreaea  adveesftda d-rs etaafatddr-asdpeec-pshtutceiet-psra fcroepee4  iafard i 4ficcicdecs d-asfpititf tdar err4e dc aefu c tiict e4r sdtadcdiestattro r f eiacudceat4  airtatat add saifteaerrtuofoar cetr ns satftr4t
itteatue oi trc rt ore orn s
4driut4  eaifreardaedtsetrtustctre r4tcoito nr sitdeeraoutrousrc sins
cttotttor
ireir uoctn rtaietorrsi
t ieaetttriaetiioorornast
nniaoTss
t
nhisroen
s
ad 441d800 has exited with leftover thread-specific data after 4 destructor iterations

It seems something wrong with threads. But at least it works.

sahib commented 9 years ago

Hi again.

Good to hear. I fixed that linux/limits.h problem already yesterday (forgot to mention, sorry), but that was after the release. It is in the master branch and will be included in the next patch release.

Regarding that threading issue: Looks like a bug in the underlying threading wrapper by glib or something else - we don't even use thread specific data. But apparently it's just a more or less harmless warning on BSD:

https://lists.freebsd.org/pipermail/freebsd-threads/2009-June/004563.html

iron-udjin commented 9 years ago

Thank you. We can close this issue.