AcademySoftwareFoundation / AcademySoftwareFoundation/rez
Make os packages mutually exclusive
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 369
- Avg merge
- 12d 3h
- Merged PRs (30d)
- 5
Description
Last 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.
``` yaml
name: os
version: linux
```
``` yaml
name: os
version: darwin
```
``` yaml
name: os
version: windows
```
similarly, architectures can be implemented with `arch-i386` and `arch-x86_64` packages.
``` yaml
name: arch
version: x86_64
```
``` yaml
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.
``` yaml
name : windows
version: 7 # technically, this is version 6.1
requires:
- os-windows
variants:
- [arch-x86_64]
- [arch-i386]
```
``` yaml
name : windows
version: 6.0
version_alias: Vista
requires:
- os-windows
variants:
- [arch-x86_64]
- [arch-i386]
```
``` yaml
name : windows
version: 5.1
version_alias: XP
requires:
- os-windows
variants:
- [arch-x86_64]
- [arch-i386]
```
``` yaml
name : windows
version: 5.0
version_alias: 2000
requires:
- os-windows
- arch-i386
```
Contributor guide
Assessment
This issue has not been assessed yet.