pkgxdev / brewkit

build infra & `$ pkg build`
57 stars 18 forks source link

Allow to condition build dependencies according to the pkg version #319

Open felipecrs opened 4 months ago

felipecrs commented 4 months ago

For example, openjdk.org@11 needs llvm.org<16 while openjdk@16 works fine with llvm.org<17.

And I think it makes a lot of sense. Someday some other package may require a different build dependency set that is will no longer build previous versions of the pkg, and this feature may come in handy.

Refs https://github.com/pkgxdev/pantry/pull/5472#issuecomment-1986438987

mxcl commented 4 months ago

Yes this is certainly needed.

Doing it for build deps only is easier than for runtime (it makes the graph calculation significantly more complex, potentially unsolvable even, which is part of the reason other package managers can get themselves into a state sometimes).

felipecrs commented 4 months ago

(it makes the graph calculation significantly more complex, potentially unsolvable even, which is part of the reason other package managers can get themselves into a state sometimes).

I am not familiar with the way how libpkgx works under the hoods, but a silly suggestion which may potentially not be even applicable would be to publish some kind of stripped, resolved manifest alongside each package version published to https://dist.pkgx.dev/.

The idea would be to leave dependencies resolution (like applying conditions to runtime dependencies) be done in build time. When installing the pkg, pkgx would only need to resolve the version spec and download such manifest to get a list of the dependencies.