-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Currently, they are no standards regarding the definition of external dependencies for gems. We have requirements field in the specification that is quite benevolent and as such does not allow to write useful third-party tooling to handle the problem of installing proper header files/libraries on targeted systems.
They are projects like https://github.com/voxik/gem-nice-install that tries to work around it by creating their own specification file, but that's a path that does not scale well.
What I would like to see is a standardize requirements field that would provide a structured information about external system dependencies. Note that on RubyGems part this can be implemented as a guideline, proper installation of those dependencies can be left to external tooling such as gem-nice-install.
My idea is to leverage the requirements field and make it a JSON schema of external dependencies such as:
{
"ruby": {
"libxml2": {
"fedora": {
"22": [
"libxml2-devel"
],
"default": [
"libxml2-devel"
]
},
"ubuntu": {
"14.04": [
"libxml2-dev"
]
}
}
},
"java": {
}
}
The highest level would represent platforms as known from RubyGems (ruby, java, x86-mingw32, ...), then there will be a list of dependencies (official names) with definition of operating systems and their versions which would at last specify the package/port name for a given OS version.
OS identifiers would have to be standardize ideally so they remain the same across all released gems:
fedora, rhel,
opensuse, sles,
ubuntu, debian,
arch,
coreos,
darwin,
gentoo,
nixos,
solaris,
freebsd, openbsd, netbsd,
darwin,
windows
RubyGems part would be to ensure that the requirements field is a valid JSON in the given format with valid identifiers issuing a warning on gem build if not.
Please note that even if one dependency or two will be specified by the author, it might still be enough information on downloading a proper dependency on other systems (Fedora -devel vs Debian -dev sub-packages).
This standardization could enable many Ruby developers to create proper tooling and make installing gems with extensions finally as easy as installing those without. It will also enable us to improve gem-to-rpm conversions (and conversions to other formats) automaticaly with proper dependencies stated. It's something I really miss in current RubyGems.