AcademySoftwareFoundation / AcademySoftwareFoundation/rez

Modify package install_path based on build args

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

Description

Hi

I'm trying to modify the `install_path` used in a `rezbuild.py` package so if I pass
the argument `dev` to `rez-build` like so: `rez-build --install --ba dev` the install folder get renamed to `../dev` instead of `version` found in the package.

Basically I want it to install package `foo` version `1.0.0` into the local package path but instead of install it into `1.0.0` folder I want `dev` folder name.

So I've to do this in `rezbuild.py`, but it seems that `rez-build` is doing something else to copy the `package.py` file to the default `install_path` with package version folder.

Here what I've done:

in `rezbuild.py`:

```python
def _rename_to_dev():
# override install_path version if DEV args is found
version_dir=os.path.basename(install_path)
dev_install_path=install_path.replace(version_dir,'dev')

print "Renaming %s to %s" %(install_path,dev_install_path)
os.rename(install_path, dev_install_path)
....
if "install" in (targets or []):
_install()

if "dev" in (build_args or []):
_rename_to_dev()
```

After the build install I correctly have my folder renamed to `dev` but it missing the `package.py` file
and this file has been put into the `1.0.0` folder version like so:

```shell
.../packages/builds/foo/1.0.0
contains only the package.py file
```

```
.../packages/builds/foo/dev
contains my deployed package files
```

Any idea on how I'm supposed to do this correctly ?

Thanks!
Maty

Contributor guide

Open the contributing guide

Research direction

Start with the rez-build install flow and the rezbuild.py install handling described in the report, then trace where package.py is copied after the deployment is renamed. Reproduce the command `rez-build --install --ba dev` and verify that the deployed files and package.py are both under the dev directory, with no package.py left under 1.0.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.