View previous topic :: View next topic |
Author |
Message |
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 517
|
Posted: Thu Jun 06, 2024 6:58 am Post subject: General practices with C headers and other dev artefact |
|
|
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 |
|
|
xgivolari Tux's lil' helper
Joined: 26 Jul 2021 Posts: 102
|
Posted: Thu Jun 06, 2024 7:51 am Post subject: |
|
|
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 |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 517
|
Posted: Thu Jun 06, 2024 7:56 am Post subject: |
|
|
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 |
|
|
eschwartz Developer
Joined: 29 Oct 2023 Posts: 214
|
Posted: Thu Jun 06, 2024 1:35 pm Post subject: |
|
|
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 |
|
|
lars_the_bear Guru
Joined: 05 Jun 2024 Posts: 517
|
Posted: Thu Jun 06, 2024 1:47 pm Post subject: |
|
|
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 |
|
|
eschwartz Developer
Joined: 29 Oct 2023 Posts: 214
|
Posted: Thu Jun 06, 2024 2:00 pm Post subject: |
|
|
Debian is not well known as the fastest distro to get rid of historical baggage, that's for sure. |
|
Back to top |
|
|
|
|
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
|
|