Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
General practices with C headers and other dev artefact
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Thu Jun 06, 2024 6:58 am    Post subject: General practices with C headers and other dev artefact Reply with quote

Hi folks

Please bear with me -- I saw Gentoo for the first time this week, and I'm still struggling with a lot of things.

In other Linux distributions I use (Fedora, Ubuntu...) there are specific '-dev' packages that contain development-related artefacts, like C/C++ headers and static libraries. I don't know if there's anything similar for Gentoo.

So far I've found that the headers for general-purpose libraries like ncurses, readline, alsa, etc., are already in place. I presume that happened when I installed the packages for these libraries (or, rather, when the dependency management system did).

So my question is: is this a general principle in Gentoo? If it is, does it apply also when packages are downloaded in binary format, rather than built from source? Or must I do something particular to retrieve these artefacts?

Thanks, Lars
Back to top
View user's profile Send private message
xgivolari
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2021
Posts: 102

PostPosted: Thu Jun 06, 2024 7:51 am    Post subject: Reply with quote

In Gentoo, header files are always installed when you emerge a package. If you need e.g. the headers for libffi, you install them by installing dev-libs/libffi. If you need libffi as a static library, you can enable the "static-libs" USE-flag for the package. There is no splitting of packages and their development files in Gentoo. (with the exception of linux headers, which is distributed as a dedicated package for consistency) This also applies if you download a package from a binhost rather than building from source.
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Thu Jun 06, 2024 7:56 am    Post subject: Reply with quote

Thank you.

Now I think about it, I wonder why other Linux distributions work the way they do. When you consider the amount of bloat that automatic dependency resolution tends to generate, adding a few extra kB for dev artefacts hardly seems like much of an overhead. And it would make developer's jobs easier.

BR, Lars
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 214

PostPosted: Thu Jun 06, 2024 1:35 pm    Post subject: Reply with quote

The answer is that Debian and Fedora are intended for use by end users that don't build their own software (neither via a package manager like portage that builds packages from source, nor as the developer of a project where you build and test by hand).

So to them, it is worth "reducing the size of an installed OS image" even if it makes things much more difficult and annoying to write new packages or do your own development work. They're optimizing for the common case, and apparently in the common case reducing the size of the operating system by a couple dozen KB per package is beneficial?

Gentoo isn't the only distro that rejects the notion of splitting packages into separate -dev packages. Arch does the same thing (even though it's a binary distro, they do encourage people to write their own packages in the AUR, plus Arch is optimized for the use cases of the developers that maintain it, who... often build their own packages!)
Back to top
View user's profile Send private message
lars_the_bear
Guru
Guru


Joined: 05 Jun 2024
Posts: 517

PostPosted: Thu Jun 06, 2024 1:47 pm    Post subject: Reply with quote

eschwartz wrote:
They're optimizing for the common case, and apparently in the common case reducing the size of the operating system by a couple dozen KB per package is beneficial?


Yeah, maybe. Being generous, it might just be historical. I guess in the days when Slackware came on a box-full of floppy disks, perhaps saving a few tens of kB per package might have been worthwhile. Dunno, really. I prefer the Gentoo approach but, then, I mostly use Linux for development.

BR, Lars.
Back to top
View user's profile Send private message
eschwartz
Developer
Developer


Joined: 29 Oct 2023
Posts: 214

PostPosted: Thu Jun 06, 2024 2:00 pm    Post subject: Reply with quote

Debian is not well known as the fastest distro to get rid of historical baggage, that's for sure. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum