AcademySoftwareFoundation / AcademySoftwareFoundation/rez

ScopeContext not behaving as expected

Open
#498 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
1.1k
Forks
369
Avg merge
12d 3h
Merged PRs (30d)
5

Description

I've encountered a situation where I need to release packages over both unix and windows based machines. The release process is just unpacking and does not involve any building. But as the context resolves I'm encountering (not unexpected) that if my platform variant does not match my system it won't let me continue.

From what I've gathered I'm supposed to be able to use the scope context to do an override by:

```python
#package.py

with scope('config') as c:
c.implicit_packages = []
```
I'm still getting:
```bash
Resolving build environment: platform-windows arch-x86_64
The context failed to resolve:
The following package conflicts occurred: (platform-windows <--!--> ~platform==linux)
```
The way I've worked around this at the moment is having a rezconfig.py that I've removed the implicit_packages in.
```bash
REZ_CONFIG_FILE=/path/to/reznoimplicitconfig.py rez build
```

I feel a bit dirty doing it this way and feel I might have missed something. But it might be the wanted and expected behavior.

Contributor guide

Open the contributing guide

Research direction

Start with the package.py scope('config') override and compare its behavior with the rezconfig.py workaround loaded through REZ_CONFIG_FILE. Reproduce the rez build resolution for platform-windows on a Linux system, then determine whether implicit_packages should be overridden in this context; done means the intended behavior is documented or covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.