-
-
Notifications
You must be signed in to change notification settings - Fork 784
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
xrepo: a remove flag which automatically removes older versions of packages #3679
Comments
try |
I didn't know about For example, nazarautils:
when I look at the references.txt file from the 2023.04.11 version I get this:
nzsl 2023.03.29 is an older version as well, and it was referenced from its cache? |
right, it's from cache. |
I improved it, it will remove cache first. |
It removed a few more packages, but
|
Because there is another valid project that is referencing it. you can move NazaraEngine to other position.
|
Yes, that's the issue, NazaraEngine is not using this package but an updated version of it.
I understand, perhaps a flag to remove outdated version of a lib may be useful in this case? |
no, xmake does not know quickly, precisely and simply what is outdated At least If you want to remove it with complete precision, you can use |
By outdated I meant "where a newer version was installed", that is "same config but more recent version". However I didn't know about xrepo clean, so now I think it's more about the references.txt file not being updated after a package update? Would it be possible for |
When installing a package, xmake can only fetch the reference.txt path of the current new version of the package and update it, it cannot fetch the previous package instance and reference.txt |
I understand that, but maybe the reference checker could check that the repository uses that version of the package (from xmake cache)? |
Accessing the cache of other projects is a little hacking and may have compatibility issues. |
I understand. Maybe xmake config could store a file dedicated to this? Like .xmake/windows/references.txt which would store all packages and their hashes with the sole purpose to let and for backward compatibility, |
I will consider it later. |
|
It looks like it's working great! Thank you! |
Oh, I just noticed it worked only for the current mode if your packages depends on this. I know this won't be exhaustive but could it be possible to store references per mode? |
No, that's all it can do at the moment. Not only mode, but also various configs, custom options, platforms, and arch may affect package hash. As I said before, it can't be completely accurate. |
Yes I know it wouldn't be accurate, but if we put configs to the side and keep plat+arch+mode I think it would work for most cases. A bit like what package lock file does |
require lock now also only deals with host/arch, not mode. Even though I now support host/arch/mode, perhaps there may be feedback from other users that more configurations need to be saved. There is no set standard for this. I think this is a bit overly complicated, and it's enough to just deal with the current configuration. Also the current project does not use any other configured packages. I don't intend to consider handling other configurations. |
I understand your point of view, but I think this will be a very common issue on Windows, all of my packages have different hash in debug and release mode, as it changes the vs_runtime (I use "MDd" in debug and "MD" in release, by the way I think this should be the default for mode.debug and mode.release as MT runtime have some issues, as I explained here: #3683 (comment)). I find it quite normal that having different configs changes the references.txt and that xmake doesn't handle this, but for arch/config that's another issue, because when you run |
I wouldn't modify it, it would break a lot of existing user projects. mode.debug is just a built-in rule, you can do not use it. Then customise debug mode to configure it.
But it is also possible that the user no longer compiles using other modes and arch, then these packages can never be cleaned up. They may also feedback a similar problem, just as you did when you reported that the entire project's packages were not cleaned up. Also So no matter how it is done, it is imprecise and cannot fully satisfy the needs of all users. I think the revert patch is probably the right one. If you want to accurately clean up the current project of outdated packages, you can only |
Also, since I have improved it. |
This is good enough for what I do, thank you! |
Is your feature request related to a problem? Please describe.
I'm working with some packages that get updated pretty often, and only use the last version of those.
However, when I'm updating, previous packages versions stay there taking up space, I'd like a way to remove these older versions.
Describe the solution you'd like
Maybe a
--only-outdated
, likexrepo remove --only-outdated --all <package>
flag which would select only package that got a more recent version installed (with the same config).Describe alternatives you've considered
Removing all packages before updating, a bit cumbersome.
Additional context
No response
The text was updated successfully, but these errors were encountered: