AcademySoftwareFoundation / AcademySoftwareFoundation/rez

rez-suite broken in 2.104.7- cannot add second context

Open
#1,222 6 comments 0 reactions 0 assignees View on GitHub
bug rez-suite
Dominant language
Python
Stars
1.1k
Forks
374
Avg merge
9d 12h
Merged PRs (30d)
5

Description

The following fails for me:
## generate two contexts from two different packages
rez env sgq_schema -o sgqschema.rxt
rez env am_query -o amquery.rxt

## create the suite
rez suite --create ./misc_suite

## add the first context
rez suite --add ./sgqschema.rxt --context sqgschema

# attempt to add the second context per the documentation
rez suite --add ./amquery.rxt --context amquery

```
Traceback (most recent call last):
File "/laika/depts/prod_tech/rez/lib/python/linux/rez/bin/rez/rez-suite", line 8, in
sys.exit(run_rez_suite())
File "/net/ent-prod.nfs.laika.com/ifs/laika/depts/prod_tech/rez/lib/python/linux/rez-2.104.7/lib/python2.7/site-packages/rez/cli/_entry_points.py", line 239, in run_rez_suite
return run("suite")
File "/net/ent-prod.nfs.laika.com/ifs/laika/depts/prod_tech/rez/lib/python/linux/rez-2.104.7/lib/python2.7/site-packages/rez/cli/_main.py", line 191, in run
returncode = run_cmd()
File "/net/ent-prod.nfs.laika.com/ifs/laika/depts/prod_tech/rez/lib/python/linux/rez-2.104.7/lib/python2.7/site-packages/rez/cli/_main.py", line 183, in run_cmd
return func(opts, opts.parser, extra_arg_groups)
File "/net/ent-prod.nfs.laika.com/ifs/laika/depts/prod_tech/rez/lib/python/linux/rez-2.104.7/lib/python2.7/site-packages/rez/cli/suite.py", line 200, in command
suite.save(opts.DIR)
File "/net/ent-prod.nfs.laika.com/ifs/laika/depts/prod_tech/rez/lib/python/linux/rez-2.104.7/lib/python2.7/site-packages/rez/suite.py", line 442, in save
shutil.rmtree(path)
File "/net/ent-prod.nfs.laika.com/ifs/laika/home/j/jgerber/packages/python/2.7.18/platform-linux/arch-x86_64/os-CentOS-7.7.1908/lib/python2.7/shutil.py", line 270, in rmtree
rmtree(fullname, ignore_errors, onerror)
File "/net/ent-prod.nfs.laika.com/ifs/laika/home/j/jgerber/packages/python/2.7.18/platform-linux/arch-x86_64/os-CentOS-7.7.1908/lib/python2.7/shutil.py", line 279, in rmtree
onerror(os.rmdir, path, sys.exc_info())
File "/net/ent-prod.nfs.laika.com/ifs/laika/home/j/jgerber/packages/python/2.7.18/platform-linux/arch-x86_64/os-CentOS-7.7.1908/lib/python2.7/shutil.py", line 277, in rmtree
os.rmdir(path)
OSError: [Errno 39] Directory not empty: '/net/ent-prod.nfs.laika.com/ifs/laika/dist/rel/packages/rez-suites/linux/cli_utils/contexts'
```
At the point of failure, the bin directory and suite.yaml have both been removed. (why?)

I know that this used to work with previous versions.

Contributor guide

Open the contributing guide

Research direction

Reproduce the two-context sequence from the issue, then inspect rez/cli/suite.py and rez/suite.py around suite.save and the shutil.rmtree call shown in the traceback. Confirm why the second add removes bin and suite.yaml; done means both contexts are added successfully and the suite remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.