Skip to content

Do not fail rez-env on missing package.py #1936

Open
@herronelou

Description

@herronelou

I'm putting this as a Feature request rather than a Bug because I believe the current behavior to be intentional.

Currently, if there is a folder within a PackageFamily folder (which may or may not be a Package Version), and it does not contain a package.py, the entire rez-env command will fail with PackageDefinitionFileMissing: Missing package definition file: FileSystemPackageResource({'location': '/path/to/location', 'name': 'package_name', 'version': x.x.x', 'repository_type': 'filesystem'}).

I wonder if this could be more of a warning rather than an error. Skip this version and move on.
I understand Rez doesn't like this format, and that something is very wrong when this happens, however due to some other external problems it could end up happening, and completely failing rez-env commands seems a bit overkill.

Motivation
In our case, it happens occasionally because the system we have in place to sync our rez repository across facilities has a tendency to create the folder structure first, then the files, so the directory appears first, before the .building lock file gets synced, then the rest of the files, then the .building is removed. However when the sync queue is larger there may be a gap between the dir creation and the files arriving, causing the entire facility receiving the updates to not being able to use rez whatsoever if this is a common packages.

Really while I agree our failure is due to issues with our sync system, I can't really think of a drawback of ignoring directories without a package.py, besides making it obvious that something is wrong.

Related Issues/PRs
Somewhat related to: #1618

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions