Code Monkey home page Code Monkey logo

db_file's People

Contributors

atoomic avatar jkeenan avatar pmqs avatar toddr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

db_file's Issues

DB_File leaks handle on croak

In bleadperl under Address Sanitizer, 3 of the test files (db-btree, db-hash, db-recno) report leaks. This appears to be because a croak doesn't close the recently-opened DB handle, thus not freeing its resources. The attached proof-of-concept diff makes the issue apparently go away (tested only
on DB 5.3.28)

db_file.txt

ParseOpenInfo() leaks if it croaks

ParseOpenInfo() initially mallocs a DB_File_type buf. If it then croaks for any reason, this buffer leaks. This shows up in bleadperl as failing tests under clang's Address Sanitizer. A sample failure script (reduced from db-btree.t) is

use DB_File; 
my $filename = "xyz";
my @x;
eval { tie @x, 'DB_File', $filename, 0x42, 0640, $DB_BTREE } ;
unlink $filename;

Can a LICENSE file be added?

Hello!

I'm submitting a recipe for DB_File to conda-forge. I was wondering if you could include a LICENSE file in your repo.

Or, would you rather I manually include a license for Perl_5 (https://dev.perl.org/licenses/) (e.g. text for Artistic License or GPLv1+, or both)

Thank you!

Building with gcc12 emits build-time warnings -- but only in Perl 5 blead, not in DB_File's own repo

When compiling Perl 5 blead (here, a threaded build on FreeBSD-12) using gcc12 as the C-compiler, make test_prep emits build-time warnings during compilation of cpan/DB_File/DB_File.xs. But when I use that same perl to build DB_File in a checkout from its own repository, I do not get those warnings.

Here is the relevant part of the output from make test_prep run in Perl 5 blead at commit 765cd54646, using gcc12 on FreeBSD-12 and building with threads:

$ cat DB_File.blead.gcc12.make.output.txt 
./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.so  MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic
Parsing config.in...
Looks Good.
Warning (mostly harmless): No library found for -ldb
Generating a Unix-style Makefile
Writing Makefile for DB_File
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
/usr/home/jkeenan/gitwork/perl/cpan/DB_File/../../miniperl "-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs ../../lib/auto/DB_File/DB_File.bs 644
gcc12 -c  -I/usr/local/BerkeleyDB/include  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -O2    -DVERSION=\"1.856\"  -DXS_VERSION=\"1.856\" -DPIC -fPIC "-I../.."  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t version.c
"../../miniperl" "-I../../lib" "../../lib/ExtUtils/xsubpp" -noprototypes -typemap '/usr/home/jkeenan/gitwork/perl/cpan/DB_File/../../lib/ExtUtils/typemap' -typemap '/usr/home/jkeenan/gitwork/perl/cpan/DB_File/typemap'  DB_File.xs > DB_File.xsc
mv DB_File.xsc DB_File.c
gcc12 -c  -I/usr/local/BerkeleyDB/include  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wno-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -O2    -DVERSION=\"1.856\"  -DXS_VERSION=\"1.856\" -DPIC -fPIC "-I../.."  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t DB_File.c
DB_File.xs: In function 'ParseOpenInfo':
DB_File.xs:476:44: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  476 |         if (RETVAL->dbp) err_close(RETVAL) ;                           \
      |                                            ^
DB_File.xs:1044:13: note: in expansion of macro 'croak_and_free'
 1044 |             croak_and_free("type parameter is not a reference") ;
      |             ^~~~~~~~~~~~~~
DB_File.xs:476:44: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  476 |         if (RETVAL->dbp) err_close(RETVAL) ;                           \
      |                                            ^
DB_File.xs:1050:13: note: in expansion of macro 'croak_and_free'
 1050 |             croak_and_free("internal error") ;
      |             ^~~~~~~~~~~~~~
DB_File.xs:476:44: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  476 |         if (RETVAL->dbp) err_close(RETVAL) ;                           \
      |                                            ^
DB_File.xs:1056:17: note: in expansion of macro 'croak_and_free'
 1056 |                 croak_and_free("DB_File can only tie an associative array to a DB_HASH database") ;
      |                 ^~~~~~~~~~~~~~
DB_File.xs:476:44: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  476 |         if (RETVAL->dbp) err_close(RETVAL) ;                           \
      |                                            ^
DB_File.xs:1091:17: note: in expansion of macro 'croak_and_free'
 1091 |                 croak_and_free("DB_File can only tie an associative array to a DB_BTREE database");
      |                 ^~~~~~~~~~~~~~
DB_File.xs:476:44: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  476 |         if (RETVAL->dbp) err_close(RETVAL) ;                           \
      |                                            ^
DB_File.xs:1140:17: note: in expansion of macro 'croak_and_free'
 1140 |                 croak_and_free("DB_File can only tie an array to a DB_RECNO database");
      |                 ^~~~~~~~~~~~~~
DB_File.xs:476:44: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  476 |         if (RETVAL->dbp) err_close(RETVAL) ;                           \
      |                                            ^
DB_File.xs:1229:13: note: in expansion of macro 'croak_and_free'
 1229 |             croak_and_free("type is not of type DB_File::HASHINFO, DB_File::BTREEINFO or DB_File::RECNOINFO");
      |             ^~~~~~~~~~~~~~
rm -f ../../lib/auto/DB_File/DB_File.so
gcc12  -shared  -L/usr/local/lib -fstack-protector-strong  version.o DB_File.o  -o ../../lib/auto/DB_File/DB_File.so        
chmod 755 ../../lib/auto/DB_File/DB_File.so

Now here is the output of DB_File's make run with that gcc12-compiled, threaded perl on the same machine.

$ cat 0a1c14ff3e.DB_File.make.output.txt
cp DB_File.pm blib/lib/DB_File.pm
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
"/usr/home/jkeenan/testing/alt/blead/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
gcc12 -c  -I/usr/local/BerkeleyDB/include  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O2    -DVERSION=\"1.856\"  -DXS_VERSION=\"1.856\" -DPIC -fPIC "-I/home/jkeenan/testing/alt/blead/lib/perl5/5.35.10/amd64-freebsd-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t version.c
"/usr/home/jkeenan/testing/alt/blead/bin/perl" "/home/jkeenan/testing/alt/blead/lib/perl5/5.35.10/ExtUtils/xsubpp" -noprototypes -typemap '/home/jkeenan/testing/alt/blead/lib/perl5/5.35.10/ExtUtils/typemap' -typemap '/usr/home/jkeenan/gitwork/zzzothers/DB_File/typemap'  DB_File.xs > DB_File.xsc
mv DB_File.xsc DB_File.c
gcc12 -c  -I/usr/local/BerkeleyDB/include  -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_FORTIFY_SOURCE=2 -O2    -DVERSION=\"1.856\"  -DXS_VERSION=\"1.856\" -DPIC -fPIC "-I/home/jkeenan/testing/alt/blead/lib/perl5/5.35.10/amd64-freebsd-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t DB_File.c
rm -f blib/arch/auto/DB_File/DB_File.so
gcc12  -shared  -L/usr/local/lib -fstack-protector-strong  version.o DB_File.o  -o blib/arch/auto/DB_File/DB_File.so        
chmod 755 blib/arch/auto/DB_File/DB_File.so

I always like to eliminate build-time warnings from Perl 5's make as much as possible. If I apply the following patch to Perl 5 blead, those warnings are eliminated:

diff --git a/cpan/DB_File/DB_File.xs b/cpan/DB_File/DB_File.xs
index d0ed44379f..1dde57d52f 100644
--- a/cpan/DB_File/DB_File.xs
+++ b/cpan/DB_File/DB_File.xs
@@ -473,7 +473,7 @@ typedef DBT DBTKEY ;
 #define croak_and_free(x)                                             \
     do                                                                \
     {                                                                 \
-        if (RETVAL->dbp) err_close(RETVAL) ;                           \
+        if (RETVAL->dbp) { err_close(RETVAL) ; }                      \
         Safefree(RETVAL);                                             \
         croak(x);                                                     \
     } while (0)

... and perl builds and tests successfully, as in this smoke-me branch.

But I concede that I find the absence of build-time warnings when I build in DB_File's own repository surprising.

clang warning in pppport.h

In file included from DB_File.xs:125:
./ppport.h:4390:10: warning: 'WIDEST_UTYPE' macro redefined [-Wmacro-redefined]
# define WIDEST_UTYPE U64TYPE
         ^
/home/paul/base/install/clang-8/perl/std/5.30.0/lib/5.30.0/x86_64-linux/CORE/handy.h:1072:12: note: 
      previous definition is here
#   define WIDEST_UTYPE U64
           ^
1 warning generated.
$ clang --version
clang version 8.0.0-3 (tags/RELEASE_800/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

DB_File-1.858 does not build on Rocky Linux 8.8 (aarch64)

DB_File-1.858 does not build on Rocky Linux 8.8 due to an error caused by an unknown architectural extension called ssbs when compiled with GCC-12.2.0 on an AWS c6g-class instance.

This doesn't seem to be an issue for x86_64.

Any insights you could offer would be appreciated.

$ cpanm DB_File
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz ... OK
Configuring DB_File-1.858 ... OK
Building and testing DB_File-1.858 ... FAIL
! Installing DB_File failed. See /build/rocky8_arm64/.cpanm/work/1691521891.3090198/build.log for details. Retry with --force to force install it.

Here the logs.

$ cat /build/rocky8_arm64/.cpanm/work/1691522214.3090269/build.log
cpanm (App::cpanminus) 1.7046 on perl 5.036000 built for aarch64-linux-thread-multi
Work directory is /build/rocky8_arm64/.cpanm/work/1691522214.3090269
You have make /usr/bin/make
You have LWP 6.67
You have /usr/bin/tar: tar (GNU tar) 1.30
Copyright (C) 2017 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 John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching DB_File () on cpanmetadb ...
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.858.tar.gz
-> OK
Unpacking DB_File-1.858.tar.gz
Entering DB_File-1.858
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.64)
Configuring DB_File-1.858
Running Makefile.PL
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.64)
Building and testing DB_File-1.858
cp DB_File.pm blib/lib/DB_File.pm
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
"/build/rocky8_arm64/software/Perl/5.36.0-GCCcore-12.2.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
gcc -c  -I/usr/local/BerkeleyDB/include -D_REENTRANT -D_GNU_SOURCE -O2 -ftree-vectorize -mcpu=native -fno-math-errno -fPIC -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"1.858\" -DXS_VERSION=\"1.858\" -fPIC "-I/build/rocky8_arm64/software/Perl/5.36.0-GCCcore-12.2.0/lib/perl5/5.36.0/aarch64-linux-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   version.c
Assembler messages:
Error: unknown architectural extension `ssbs'
Error: unrecognized option -march=armv8.2-a+crypto+fp16+rcpc+dotprod+ssbs
make: *** [Makefile:360: version.o] Error 2
-> FAIL Installing DB_File failed. See /build/rocky8_arm64/.cpanm/work/1691522214.3090269/build.log for details. Retry with --force to force install it.

Difficulty building on HPC (Linux)

Hi, I've referenced previous resolved issue #14 to cpan DB_File using:

export LDFLAGS="-L/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/lib"
export CPPFLAGS="-I/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/include"
export DB_FILE_LIB="/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/lib"
export DB_FILE_INCLUDE="/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/include"

Here is the CPAN output:

cpanm (App::cpanminus) 1.7047 on perl 5.026002 built for x86_64-linux-thread-multi
Work directory is /gpfs1/home/tchen/.cpanm/work/1711638695.1356205
You have make /usr/bin/make
You have /gpfs1/home/tchen/anaconda3/bin/wget
You have /usr/bin/tar: tar (GNU tar) 1.30
Copyright (C) 2017 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 John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching DB_File () on cpanmetadb ...
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.859.tar.gz
-> OK
Unpacking DB_File-1.859.tar.gz
Entering DB_File-1.859
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.24)
Configuring DB_File-1.859
Running Makefile.PL
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.24)
Building and testing DB_File-1.859
cp DB_File.pm blib/lib/DB_File.pm
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
"/gpfs2/home/tchen/anaconda3/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
gcc -c  -I/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/include -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"1.859\" -DXS_VERSION=\"1.859\" -fPIC "-I/gpfs2/home/tchen/anaconda3/lib/5.26.2/x86_64-linux-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   version.c
"/gpfs2/home/tchen/anaconda3/bin/perl" "/gpfs1/home/tchen/perl5/lib/perl5/ExtUtils/xsubpp" -noprototypes -typemap '/gpfs2/home/tchen/anaconda3/lib/5.26.2/ExtUtils/typemap' -typemap '/gpfs2/home/tchen/.cpanm/work/1711638695.1356205/DB_File-1.859/typemap'  DB_File.xs > DB_File.xsc
mv DB_File.xsc DB_File.c
gcc -c  -I/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/include -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"1.859\" -DXS_VERSION=\"1.859\" -fPIC "-I/gpfs2/home/tchen/anaconda3/lib/5.26.2/x86_64-linux-thread-multi/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   DB_File.c
rm -f blib/arch/auto/DB_File/DB_File.so
LD_RUN_PATH="/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/lib" gcc  -shared -O2 -L/gpfs1/home/tchen/anaconda3/lib -L/usr/local/lib -fstack-protector-strong version.o DB_File.o  -o blib/arch/auto/DB_File/DB_File.so  \
   -L/gpfs2/home/tchen/homebrew/Cellar/berkeley-db@5/5.3.28_1/lib -ldb   \
  
chmod 755 blib/arch/auto/DB_File/DB_File.so
Manifying 1 pod document
"/gpfs2/home/tchen/anaconda3/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
PERL_DL_NONLAZY=1 "/gpfs2/home/tchen/anaconda3/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t

#   Failed test 'use DB_File;'
#   at t/000prereq.t line 23.
#     Tried to use 'DB_File'.
#     Error:  
# DB_File was build with libdb version 5.3.28,
# but you are attempting to run it with libdb version 6.2.32
# Compilation failed in require at t/000prereq.t line 23.
# BEGIN failed--compilation aborted at t/000prereq.t line 23.
Use of uninitialized value $DB_File::db_version in concatenation (.) or string at t/000prereq.t line 28.
Use of uninitialized value $DB_File::db_ver in concatenation (.) or string at t/000prereq.t line 28.
# 
# 
# DB_File version            1.859
# DB_File::db_version        
# DB_File::db_ver            
# 
# Looks like you failed 1 test of 1.
t/000prereq.t ... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

DB_File was build with libdb version 5.3.28,
but you are attempting to run it with libdb version 6.2.32
Compilation failed in require at t/db-btree.t line 32.
BEGIN failed--compilation aborted at t/db-btree.t line 32.
t/db-btree.t .... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 

DB_File was build with libdb version 5.3.28,
but you are attempting to run it with libdb version 6.2.32
Compilation failed in require at t/db-hash.t line 17.
BEGIN failed--compilation aborted at t/db-hash.t line 17.
t/db-hash.t ..... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 

DB_File was build with libdb version 5.3.28,
but you are attempting to run it with libdb version 6.2.32
Compilation failed in require at t/db-recno.t line 15.
BEGIN failed--compilation aborted at t/db-recno.t line 15.
t/db-recno.t .... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 

DB_File was build with libdb version 5.3.28,
but you are attempting to run it with libdb version 6.2.32
Compilation failed in require at t/db-threads.t line 8.
BEGIN failed--compilation aborted at t/db-threads.t line 8.
t/db-threads.t .. 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
t/meta-json.t ... skipped: Test::CPAN::Meta::JSON required for testing META.json
t/meta-yaml.t ... skipped: Test::CPAN::Meta required for testing META.yml
t/pod.t ......... skipped: Test::Pod 1.00 required for testing POD

Test Summary Report
-------------------
t/000prereq.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
t/db-btree.t  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/db-hash.t   (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/db-recno.t  (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
t/db-threads.t (Wstat: 512 Tests: 0 Failed: 0)
  Non-zero exit status: 2
  Parse errors: No plan found in TAP output
Files=8, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.21 cusr  0.08 csys =  0.33 CPU)
Result: FAIL
Failed 5/8 test programs. 1/1 subtests failed.
make: *** [Makefile:1055: test_dynamic] Error 255
-> FAIL Installing DB_File failed. See /gpfs1/home/tchen/.cpanm/work/1711638695.1356205/build.log for details. Retry with --force to force install it.

Any help/insight would be greatly appreciated, I am not the best at perl but I did try to troubleshoot but to no avail, thank you!

Licence confusion

The COPYRIGHT section of DB_File's main man page (https://metacpan.org/pod/DB_File#COPYRIGHT) refers to "the Berkeley DB FAQ (at http://www.oracle.com/technology/products/berkeley-db/db/index.html)," quoting some text from it which explains that it is not necessary to license Berkeley DB to use it in Perl scripts.

Unfortunately, that link now goes somewhere else (https://www.oracle.com/database/technologies/related/berkeleydb.html), which isn't an FAQ page. There is a "Berkeley DB FAQ" link on that page, which goes to https://www.oracle.com/database/technologies/berkeleydb-db-faq.html, but there is no sign of the text quoted in DB_File's man page...

That very much leaves one wondering what the licence situation now is, since Berkeley DB's own licences (a choice of two are available) do not sound as friendly as the text quoted in DB_File's man page would suggest.

Please could you clarify what the current situation is, and update the man page link and/or text appropriately.

Can't build on OS X (arm)

Not sure if this requires homebrew berkeley-db. In any case, I do have that package installed, but this doesn't help

export LDFLAGS="-L/opt/homebrew/opt/berkeley-db/lib"
export CPPFLAGS="-I/opt/homebrew/opt/berkeley-db/include"

cpan output

cpanm (App::cpanminus) 1.7047 on perl 5.038000 built for darwin-thread-multi-2level
Work directory is /Users/ilevy/.cpanm/work/1696859796.27435
You have make /usr/bin/make
You have /opt/homebrew/bin/wget
You have /usr/bin/tar: bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.0.5 bz2lib/1.0.8 
You have /usr/bin/unzip
Searching DB_File () on cpanmetadb ...
--> Working on DB_File
Fetching http://www.cpan.org/authors/id/P/PM/PMQS/DB_File-1.859.tar.gz
-> OK
Unpacking DB_File-1.859.tar.gz
Entering DB_File-1.859
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.70)
Configuring DB_File-1.859
Running Makefile.PL
Parsing config.in...
Looks Good.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for DB_File
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.70)
Building and testing DB_File-1.859
cp DB_File.pm blib/lib/DB_File.pm
Running Mkbootstrap for DB_File ()
chmod 644 "DB_File.bs"
"/opt/homebrew/Cellar/perl/5.38.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB_File.bs blib/arch/auto/DB_File/DB_File.bs 644
cc -c  -I/usr/local/BerkeleyDB/include -fno-common -DPERL_DARWIN -mmacosx-version-min=14.0 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -Wno-error=implicit-function-declaration -O3   -DVERSION=\"1.859\" -DXS_VERSION=\"1.859\"  "-I/opt/homebrew/opt/perl/lib/perl5/5.38/darwin-thread-multi-2level/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   version.c
"/opt/homebrew/Cellar/perl/5.38.0/bin/perl" "/opt/homebrew/opt/perl/lib/perl5/5.38/ExtUtils/xsubpp" -noprototypes -typemap '/opt/homebrew/opt/perl/lib/perl5/5.38/ExtUtils/typemap' -typemap '/Users/ilevy/.cpanm/work/1696859796.27435/DB_File-1.859/typemap'  DB_File.xs > DB_File.xsc
mv DB_File.xsc DB_File.c
cc -c  -I/usr/local/BerkeleyDB/include -fno-common -DPERL_DARWIN -mmacosx-version-min=14.0 -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -Wno-error=implicit-function-declaration -O3   -DVERSION=\"1.859\" -DXS_VERSION=\"1.859\"  "-I/opt/homebrew/opt/perl/lib/perl5/5.38/darwin-thread-multi-2level/CORE"  -D_NOT_CORE  -DmDB_Prefix_t=size_t -DmDB_Hash_t=u_int32_t   DB_File.c
rm -f blib/arch/auto/DB_File/DB_File.bundle
LD_RUN_PATH="/opt/homebrew/Cellar/berkeley-db/18.1.40_2/lib" cc -Wl,-rpath,"/opt/homebrew/Cellar/berkeley-db/18.1.40_2/lib" -mmacosx-version-min=14.0 -bundle -undefined dynamic_lookup -fstack-protector-strong  version.o DB_File.o  -o blib/arch/auto/DB_File/DB_File.bundle  \
	   -ldb   \
	  
ld: library 'db' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [blib/arch/auto/DB_File/DB_File.bundle] Error 1
-> FAIL Installing DB_File failed. See /Users/ilevy/.cpanm/work/1696859796.27435/build.log for details. Retry with --force to force install it.
$ env | grep -i perl
PATH=/Users/ilevy/.rbenv/shims:/Users/ilevy/.pyenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/ilevy/bin:/Users/ilevy/.local/bin:/Library/Ruby/Gems/2.6.0:/usr/local/sbin:/Users/ilevy/perl5/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
PERL5LIB=/Users/ilevy/perl5/lib/perl5
PERL_LOCAL_LIB_ROOT=/Users/ilevy/perl5
PERL_MB_OPT=--install_base "/Users/ilevy/perl5"
PERL_MM_OPT=INSTALL_BASE=/Users/ilevy/perl5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.