Bogdanp / racket-gui-easy

Declarative GUIs in Racket.
https://docs.racket-lang.org/gui-easy/index.html
134 stars 18 forks source link

Duplicate `gui-easy-lib` dependency #48

Closed shhyou closed 11 months ago

shhyou commented 11 months ago

In the dependencies of gui-easy, the package gui-easy-lib is listed twice -- once as deps and once as build-deps. This ended up creating duplicate dependencies.

I am not sure whether this is related, but the last few lines seem to suggest that duplicate dependencies cause problems when updating packages:

Resolving "gui-easy-lib" via https://pkgs.racket-lang.org
The following out-of-date packages are listed as dependencies of gui-easy
and they will be automatically updated:
   gui-easy-lib
   gui-easy-lib
Using cached17005413591700541359311 for https://github.com/Bogdanp/racket-gui-easy.git?path=gui-easy-lib
...
Uninstalling to prepare re-install of gui-easy-lib
Moving gui-easy-lib to trash: <PATH>
Uninstalling to prepare re-install of gui-easy-lib
raco pkg update: package not currently installed
  package: gui-easy-lib
  current scope: installation

from https://racket.discourse.group/t/package-removed-after-trying-to-update-them/2521

Bogdanp commented 11 months ago

I think the build dependency is necessary to be able to build the docs and the runtime dependency is necessary for implies to work correctly, so I think the definitions should be OK as-is. Off the top of my head from when I last touched that part of raco setup, I think it's possible for it to double-print package names in cases like this, but it shouldn't cause issues. What is the result of raco pkg show gui-easy-lib for you?

EDIT: Ah, sorry, coffee hadn't kicked in yet. I see now that the "Uninstalling. .." part of the log is duplicated. I guess I would still consider this an issue with raco setup. Does the problem go away if you try to update gui-easy-lib by itself?

shhyou commented 11 months ago
● [Nov21 00:24:56] $ raco pkg show -a | gri easy
74: gui-easy*                     118687846290...  catalog...-easy
75: gui-easy-lib*                 118687846290...  catalog...y-lib

I think this is because I got gui-easy and gui-easy-lib by installing Rhombus. I've already grabbed gui-easy-lib back by hand so I can't test updating it now.

The docs of build-deps and deps seems to suggest otherwise: https://docs.racket-lang.org/raco/setup-check-deps.html#%28part._.Declaring_.Build-.Time_.Dependencies%29

Dependencies listed in deps, meanwhile, are treated as both run-time and build-time dependencies.

https://docs.racket-lang.org/pkg/metadata.html#(idx._(gentag._4._(lib._pkg%2Fscribblings%2Fpkg..scrbl)))

The build-deps and deps lists are appended, while raco pkg create strips away build-deps when converting a package for --binary mode.

Together these read to me like the overall dependencies are build-deps + deps, while the non-building-time dependency (for distribution?) is deps.

Bogdanp commented 11 months ago

The docs of build-deps and deps seems to suggest otherwise: [...]

I see, thanks! I thought I tried removing gui-easy-lib from the build deps and saw --check-pkg-deps complain about it, but I just tried again and it doesn't so I've gone ahead and removed it.

shhyou commented 11 months ago

Thanks a lot! Yes, looks like --check-pkg-deps is happy with the current setup.