Make os packages mutually exclusive
See original GitHub issueLast week I started experimenting with using rez on linux and osx, and quickly discovered that OS packages are not mutually exclusive (I think I may be the first person actually using rez on two operating systems at the same site). There is nothing stopping a resolve on osx from pulling in packages that require Linux. Making Linux and Darwin anti-packages of each other only protects against bad resolves by aborting the resolution.
My plan is to create an “os” package, with versions per os: os-darwin
, os-linux
, os-windows
. Versions are inherently mutually exclusive, so it will prevent os-darwin
and os-linux
from being loaded simultaneously, and thus allow packages that require or vary on these to resolve properly.
To achieve this, we will first need to implement a new type of Version
subclass that supports a string label.
name: os
version: linux
name: os
version: darwin
name: os
version: windows
similarly, architectures can be implemented with arch-i386
and arch-x86_64
packages.
name: arch
version: x86_64
name: arch
version: i386
lastly, specific versions of an operating system can be implemented as their own packages. e.g. osx-10.8.1
, fedora-19
, etc. Here are some complete examples from windows, with numeric versions taken from wikipedia.
name : windows
version: 7 # technically, this is version 6.1
requires:
- os-windows
variants:
- [arch-x86_64]
- [arch-i386]
name : windows
version: 6.0
version_alias: Vista
requires:
- os-windows
variants:
- [arch-x86_64]
- [arch-i386]
name : windows
version: 5.1
version_alias: XP
requires:
- os-windows
variants:
- [arch-x86_64]
- [arch-i386]
name : windows
version: 5.0
version_alias: 2000
requires:
- os-windows
- arch-i386
Issue Analytics
- State:
- Created 10 years ago
- Comments:26 (16 by maintainers)
Top GitHub Comments
Yes, we’ve standardized on platform/arch/os packages for a long time now. That’s juts default behavior though, you’re free to do this as you’d like. Note this entry in rezconfig.py:
implicit_packages = [ “~platform=={system.platform}”, “~arch=={system.arch}”, “~os=={system.os}”, ]
https://github.com/nerdvegas/rez/wiki/Basic-Concepts#weak-references Some packages may not be platform dependent, hence the weak references.
Hth A
On Mon, Apr 22, 2019 at 11:41 PM Marcus Ottosson notifications@github.com wrote:
Is this implemented? 😃