On Sun, Aug 09, 2020 at 03:22:20PM +0100, Barak A. Pearlmutter wrote: > I'm maintaining mlpack. It is able to generate julia bindings, so on > architectures in which julia is available I'd like to generate julia > bindings, and this requires julia to be installed at build time. I've > set up debian/rules to check if julia is installed, and set > configuration options appropriately. Similarly, it seems best to build > the package using clang if possible, but if clang isn't available it > can be built using GCC (assuming you build single threaded and roughly > six hundred mysterious GCC space-saving options are set). > > I thought I could accomplish this with build dependencies like > > Build-Depends: julia | hello, ..., clang | buthead > > where hello and buthead are stupid little packages that are available > on all architectures but would not otherwise be installed. Ugly, sure, > but maybe it would get the job done. Nope! The build daemons just try > to install julia and clang and fail if either's not available. I've > also seen > > Build-Depends: julia | dpkg, ..., clang | dpkg > > but that also doesn't work.
It is intentional that the buildds consider only the first option of an alternative for dependency resoltion of build dependencies in unstable. If due to some hiccup in unstable julia is temporarily not installable, what do you prefer to happen? a) silently build without julia installed b) package build happens as soon as julia is installable again There are also similar problems that a dependency resolver might opt not to install julia when dpkg is already installed, or when some other dependencies already result in hello being installed. Or when deep inside dependency resolution installing hello produces a "better" solution than installing julia. > I could check which architectures have julia, and which have clang, > and list them. > > Build-Depends: julia [amd64 arm64 i386 ...], clang [amd64 arm64 armel > armhf i386 ...] > > but that makes my skin crawl because it is highly non-future-proof and > violates all sorts of software engineering principles. > > Anybody know if there's a good solution to this problem? For clang all release architectures and all relevant non-release architectures already provide clang, but if you want your package to build everywhere you could write clang [!alpha !hppa !ia64 !m68k !sh4 !x32] julia is actually the first package that would come into my mind for all kinds of If-Available problems: julia | 0.3.2-2 | oldoldstable | source, amd64, i386 julia | 0.4.7-6+b3 | oldstable | amd64, arm64, armhf, i386, mips64el, ppc64el julia | 1.0.3+dfsg-4 | stable | source, amd64, arm64, armhf, i386, ppc64el julia | 1.4.1+dfsg-1 | unstable | source, amd64, arm64, i386 The pragmatic solution is to list the 3 architectures where julia currently builds. The software engineering solution would be a dependency package julia-or-nothing that depends depending on the architecture either on julia or nothing. cu Adrian