AcademySoftwareFoundation / rez

An integrated package configuration, build and deployment system for software
https://rez.readthedocs.io
Apache License 2.0
954 stars 341 forks source link

TypeError: not enough arguments for format string in rez-cp _copy_variant_payload #1309

Open jopollack opened 2 years ago

jopollack commented 2 years ago

I get the following error when running rez-cp as part of a release procedure. It appears as though it should raise a PackageCopyError, but instead breaks due to a bad format string.

Traceback (most recent call last):
  File "/rel/third_party/rez/2.106.0/bin/rez/rez-cp", line 8, in <module>
    sys.exit(run_rez_cp())
  File "/rel/third_party/rez/2.106.0/lib/python3.7/site-packages/rez/cli/_entry_points.py", line 127, in run_rez_cp
    return run("cp")
  File "/rel/third_party/rez/2.106.0/lib/python3.7/site-packages/rez/cli/_main.py", line 191, in run
    returncode = run_cmd()
  File "/rel/third_party/rez/2.106.0/lib/python3.7/site-packages/rez/cli/_main.py", line 183, in run_cmd
    return func(opts, opts.parser, extra_arg_groups)
  File "/rel/third_party/rez/2.106.0/lib/python3.7/site-packages/rez/cli/cp.py", line 168, in command
    dry_run=opts.dry_run
  File "/rel/third_party/rez/2.106.0/lib/python3.7/site-packages/rez/package_copy.py", line 206, in copy_package
    verbose=verbose
  File "/rel/third_party/rez/2.106.0/lib/python3.7/site-packages/rez/package_copy.py", line 248, in _copy_variant_payload
    "be present on disk (%s)." % src_variant.uri, variant_root
TypeError: not enough arguments for format string

Environment

To Reproduce

  1. change a package.py's variants so that they no longer match the file path.
  2. rez-cp the resulting package to trigger the PackageCopyError that's supposed to occur. You will instead get the above TypeError.
garrett-wbpa commented 7 months ago

I'm seeing something similar on Windows, though it's related to the shortened variant symlinks not working on Windows.