Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miss-leaded error message while building with invalid package metadata #915

Closed
davidlatwe opened this issue Aug 1, 2020 · 4 comments · Fixed by #918
Closed

Miss-leaded error message while building with invalid package metadata #915

davidlatwe opened this issue Aug 1, 2020 · 4 comments · Fixed by #918

Comments

@davidlatwe
Copy link
Contributor

Hi everyone 👋🏼

While I was trying to rez-build my Python project, I got an error message saying that I have no build system to use :

01:21:32 ERROR    BuildSystemError: No build system is associated with the path ...

But the doc says if package.py have build_command attribute, custom build system should be used.

Here's what my package.py looks like:

name = "foo"

authors = ["davidlatwe"]

description = "Awesome foo"

version = "0.1.0"

requires = [
    "python*",
]

variants = [
    ["default"],
]


build_command = "some fancy command"


def commands():
    env.PYTHONPATH.append("{this.root}")

I think my package.py was fine, at least should be enough to summon custom build system.

So I start to hunt the cause, and I found it was because my required package "python*" some how failed the schema validation.

And here's the reason why the PackageMetadataError and PackageRequestError was not raised :

https://github.com/nerdvegas/rez/blob/103270d1b39e139223dec706236cbaffc4e14669/src/rez/build_system.py#L31-L36

Any reason why it's being ignored ? I think there should be at least a warning message. 🤔

@instinct-vfx
Copy link
Contributor

instinct-vfx commented Aug 1, 2020

I agree that the error is somewhat misleading. python* is not a valid request though, so the fail itself is expected. What did you want to request? Any python version? That would be just python. The reason for your string not to be a valid request is that Rez uses - as a separator between package name and version. If there is no -, then Rez considers the whole string to be the package name and * is not a valid character for package names, hence the schema validation fails.

See also the help on package attributes for the name attribute: https://github.com/nerdvegas/rez/wiki/Package-Definition-Guide#name
Only alphanumerics and underscores are allowed as package names.

@davidlatwe
Copy link
Contributor Author

Thanks for the info ! Yes, I changed the request package name to python or python-* and it resolved. 👍🏼

@nerdvegas
Copy link
Contributor

nerdvegas commented Aug 3, 2020 via email

@nerdvegas
Copy link
Contributor

Actually I'll make this an error - this then matches existing behaviour when build system is know (eg, a CMakeLists.txt is present)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants