Skip to content

Berkeley-db: Added minimal external detection#27752

Merged
bernhardkaindl merged 1 commit intospack:developfrom
tldahlgren:berkeley-db-detectable
Dec 3, 2021
Merged

Berkeley-db: Added minimal external detection#27752
bernhardkaindl merged 1 commit intospack:developfrom
tldahlgren:berkeley-db-detectable

Conversation

@tldahlgren
Copy link
Copy Markdown
Contributor

@tldahlgren tldahlgren commented Dec 1, 2021

I was trying to install software on a cray that was experiencing timeouts trying to download this dependency's source and determined there was already a version installed on the system.

This PR adds minimal detection of the external package and assumes it is sufficient to simply check for db_load.

It has been manually tested on one each of linux-rhel7-cascadelake and cray-rhel8-zen2.

@bernhardkaindl
Copy link
Copy Markdown
Contributor

@spackbot re-run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app bot commented Dec 3, 2021

I've started that pipeline for you!

@spack spack deleted a comment from spackbot-app bot Dec 3, 2021
@bernhardkaindl
Copy link
Copy Markdown
Contributor

bernhardkaindl commented Dec 3, 2021

This PR adds minimal detection of the external package and assumes it is sufficient to simply check for db_load.

On all Debian- and Ubuntu-based distros, db_load is provided by the db-util package:

dpkg -S db_load
db-util: /usr/bin/db_load
db-util: /usr/share/man/man1/db_load.1.gz

It has no dependency on libdb-dev which provides the development libraries for db:

apt search libdb-dev
Sorting... Done
Full Text Search... Done
libdb-dev/hirsute,now 1:5.3.21~exp1ubuntu2 amd64 [installed,automatic]
  Berkeley Database Libraries [development]

Note: libdb-dev is just an empty virtual package which depends on e.g. libdb5.3-dev, which provides the development library and headers.

To know that the db library is installed, you'd have to call the compiler to build a test program.

Also: In case some distro supports different versions of Berkely DB, the version of the db_load tool and the development library could even differ.

Copy link
Copy Markdown
Contributor

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, as said: It will only work when the dev/devel package of the libdb is also installed.

It's not perfect, but perfection is the enemy of the good.

As it does not have to work always (as it's for developers), so it's ok and a first step, and can help a lot like in the case which happened to you, so I approve.

@bernhardkaindl bernhardkaindl merged commit 6f9dc1c into spack:develop Dec 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants