rez icon indicating copy to clipboard operation
rez copied to clipboard

Misleading package conflicts error message

Open hughetop opened this issue 2 years ago • 4 comments

The package conflicts error message can be misleading and confusing sometimes. Possibly caused by missing platform-specific variants for implicit package requests.

Environment

  • osx 12.4
  • Rez version 2.111.2
  • Rez python version 3.9.13

To Reproduce

  1. create a package that requires platform-specific variants of 2 other packages
  2. build correct platform variant of one package
  3. forget to build the correct platform variant of the other package
  4. rez-env the custom package on the wrong platform
  5. Edit: the package missing the platform variant must come later alphabetically

Expected behavior Package conflict error message should tell you which package is causing the conflict

Actual behavior The error message gives me a different package than the conflicting one.

% arch -x86_64 rez-env cool_package
resolve failed, by hughetop@NVVK6XW4H5, on Wed Jul 20 10:00:28 2022, using Rez v2.111.2

requested packages:
cool_package   
~platform==osx  (implicit)
~arch==x86_64   (implicit)
~os==osx-12.4   (implicit)

The context failed to resolve:
The following package conflicts occurred: (platform-osx <--!--> platform-linux)

Resolve paths starting from initial requests to conflict:
  cool_package --> cool_package-0.1.0 --> PySide2-5.15.2.1 --> platform-osx
  ~platform==osx --> platform-osx
  ~os==osx-12.4 --> os-osx-12.4 --> platform-osx

The cool_package requires ['python-3', 'PySide2', 'rez-2']

I already have a "platform-osx" variant of PySide2, so this confused me. The actual problem is that "cool_package" requires rez-2 as a package and I forgot to do rez-bind rez on osx. So the conflict was due to the "rez" package only having a "platform-linux" variant, which conflicted with the implicit "platform-osx" package. But the error message implied that PySide2 was causing the conflict somehow.

If it matters, all of the osx-specific packages/variants are still in ~/packages and haven't been released yet as I am still testing.

hughetop avatar Jul 20 '22 17:07 hughetop

Just wanted to echo this bug, it's difficult to read. The "Resolve paths starting from initial requests to conflict:" portion only shows platform-osx, platform-osx, platform-osx, which is of course not actually a conflict. The only hint you have for the real problem is the (platform-osx <--!--> platform-linux) but still don't know which package caused it.

ColinKennedy avatar Jul 23 '22 16:07 ColinKennedy

Could you post the resolve graph? To do that, you "rez-env ... -o fail.rxt", then you can "rez-context -g fail.rxt".

I think I've seen this before - it's the interpretation of the resolve graph that's wrong (ie what's getting written to stdout there isn't necessarily incorrect, but also isn't necessarily describing the graph in a useful way).

A

On Sun, Jul 24, 2022 at 2:32 AM Colin Kennedy @.***> wrote:

Just wanted to echo this bug, it's difficult to read. The "Resolve paths starting from initial requests to conflict:" portion only shows platform-osx, platform-osx, platform-osx, which is of course not actually a conflict. The only hint you have for the real problem is the (platform-osx <--!--> platform-linux) but still don't know which package caused it.

— Reply to this email directly, view it on GitHub https://github.com/AcademySoftwareFoundation/rez/issues/1350#issuecomment-1193151892, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMOUSUH4EP2GYL537P6Z2DVVQNDNANCNFSM54ERDNWA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

nerdvegas avatar Jul 24 '22 22:07 nerdvegas

I have not gotten the fail graph to work on osx, which made it difficult to debug. I'll see what I can do on that.

hughetop avatar Jul 25 '22 18:07 hughetop

Update: I still can't get a graph, but it seems to break if the offending package is later alphabetically. My basic "cool_package" requres ['python-3', 'Pillow', 'PySide2', 'zzz'], there is no osx variant for Pillow or zzz (a fake package that I made). If I rez-env I will get:

% rez-env cool_package
resolve failed, by hughetop@NVVK6XW4H5, on Mon Jul 25 11:20:46 2022, using Rez v2.111.2

requested packages:
cool_package    
~platform==osx  (implicit)
~arch==arm64    (implicit)
~os==osx-12.4   (implicit)

The context failed to resolve:
The following package conflicts occurred: (platform-linux <--!--> ~platform==osx)

Resolve paths starting from initial requests to conflict:
  cool_package --> cool_package-0.1.0 --> Pillow-9.2.0 --> platform-linux
  ~platform==osx --> platform-linux

To see a graph of the failed resolution, add --fail-graph in your rez-env or rez-build command.

This is accurate since there is no osx variant for Pillow. Now if I remove Pillow from the requirements and do rez-env again:

% rez-env cool_package
resolve failed, by hughetop@NVVK6XW4H5, on Mon Jul 25 11:27:40 2022, using Rez v2.111.2

requested packages:
cool_package    
~platform==osx  (implicit)
~arch==arm64    (implicit)
~os==osx-12.4   (implicit)

The context failed to resolve:
The following package conflicts occurred: (platform-linux <--!--> ~platform==osx)

Resolve paths starting from initial requests to conflict:
  cool_package --> cool_package-0.1.0 --> [PySide2==5.15.2.1 --> platform-linux
  ~platform==osx --> platform-linux

To see a graph of the failed resolution, add --fail-graph in your rez-env or rez-build command.

There is definitely an osx variant for PySide2. What it's really missing is an osx variant of the 'zzz' package.

hughetop avatar Jul 25 '22 18:07 hughetop