bottlesdevs / Bottles

Run Windows software and games on Linux
https://usebottles.com
GNU General Public License v3.0
6.31k stars 262 forks source link

[Request] Local folder/directory/repository of dependencies #760

Closed WineBottles closed 2 years ago

WineBottles commented 2 years ago

I may be an edge case as I run every single non-Linux compatible game in Bottles (around 100 games) but whenever I make a new bottle I need to install a bunch of dependencies. This is great and normal. What I don't like is that it needs to download the repository each and every single time.

Request: have a local directory where the dependencies are downloaded just one time and then the dependency installer would look in this directory if the user has "local dependency repository" on.

How does this benefit the user? Saves on bandwidth. Not all users live in a country where bandwidth is unlimited and it can be expensive. Saves on install time because the user does not need to wait for the various dependencies download before installing.

How does this benefit Bottles? Would also remove some of Bottles own dependencies on Microsoft and other hosts. If Microsoft/other hosts remove those redistributables then we would need to find them from a different source.

How would this work? 1) User turns on the setting that they want to use a local folder/directory for Bottles dependencies. 2) A one time download for all dependencies is done to that folder. 3) When a user is installing dependencies for individual bottles, Bottles grabs the dependency from that local folder and bypasses the download portion and goes straight to installing it.

Notes: I dislike Microsoft with a passion, which is why I am using Wine/Bottles in the first place (because I cannot escape their grip on gaming). On that note I feel dirty seeing connections pop-up in my network logs to dl.microsoft.com by the dozens and random hosts around the world (www.ddsystem.com.br = Brazil?) whenever I am installing dependencies.

Legalese: Hosting our own dependency repository should not break any legal clause because we are not modifying them. They are simply redistributables that are being installed as they were intended without any modifications.

mirkobrombin commented 2 years ago

Hi, thank you for being so detailed.

Currently Bottles doesn’t download dependencies multiple time, after first install it keep the package in its temp (despite the name it is not a temporary path) folder and then look on it before download it again next time the user need it.

Talking about a user local repository, we are already working on it for caching purposes, it should not be intended as a full download of the entire repository (we are talking about ~5GB) but just hosting the indexes and manifests locally to avoid asking our repository each time the user require a dependency.

On the redistribution front, we can’t provide hosting to bring up a new repository where to host all the dependencies. Also each file should be validated, currently this process is transparent in our GitHub repository and each file provide its checksum and where be downloaded from its official provider to assure the user it is the real file. Letting other to host 3rd party repositories can compromise the user privacy, downloading malware or something else.

The legal problem here is that not every company/provider/developer allow others to redistribute their binaries, despite the free to download (that it is not intended as free software or a permissive license) the provider can explicitly ask to not redistribute its binaries, forcing the user to download it from their official repository/website.

WineBottles commented 2 years ago

Interesting. So I do see some of the installers in the Temp folder, not all. And when I try to install dependencies I already had before it still connects to various microsoft servers which could just be the checksum.

In other cases it is failing to install ones I've installed before which are missing from the Temp folder and says to see crash logs on the next launch of Bottles or via Terminal. The crash logs do not display on the next launch though.

I'm also curious why some of the dependencies (vcredists for example) are contacting www.ddsystem.com.br.

WineBottles commented 2 years ago

I found out why I kept having to download the dependencies 100 times lol. In preferences -> General I had the "Temp files" clean up turned on. Which is kind of what I was getting at with this ticket, should those redistributables be considered Temp files if they will be used for other Bottles in the future?

Are those dependencies the only "Temp files"? In which case I can just turn off that setting. I didn't think those would be considered temporary files which is why I had that setting checked off.

mirkobrombin commented 2 years ago

Interesting. So I do see some of the installers in the Temp folder, not all. And when I try to install dependencies I already had before it still connects to various microsoft servers which could just be the checksum.

this is weird because the checksum is in our repository, what link is it trying to reach?

In other cases it is failing to install ones I've installed before which are missing from the Temp folder and says to see crash logs on the next launch of Bottles or via Terminal. The crash logs do not display on the next launch though.

I need the log to figure out what Bottles is actually doing.

I'm also curious why some of the dependencies (vcredists for example) are contacting www.ddsystem.com.br.

There is only one dependency that is reaching this host https://github.com/bottlesdevs/dependencies/blob/6b93e04e45809bd5617402f01959ac6428adfc15/Essentials/vcredist6sp6.yml because Microsoft doesn't provide it anymore.

I found out why I kept having to download the dependencies 100 times lol. In preferences -> General I had the "Temp files" clean up turned on. Which is kind of what I was getting at with this ticket, should those redistributables be considered Temp files if they will be used for other Bottles in the future?

Ah. It is just an "old" naming, we start caching downloads some releases ago.

Are those dependencies the only "Temp files"? In which case I can just turn off that setting. I didn't think those would be considered temporary files which is why I had that setting checked off.

Normally it should set to False by default, idk why your installation was setting it to True, maybe something break that setting. I'll check.

Regarding the folder name, it is just an "old naming", we use that folder also to extract files from the binaries and install in your bottles. What we are doing is to move out the "cached binaries" from that folder and only keep it for extraction.

WineBottles commented 2 years ago

It's been a while but I think I turned on the Temp cleanup when I first started using bottles. With those dependencies being moved out of the Temp folder elsewhere that would solve this ticket and sounds perfect. We can close this ticket if you have another one or just a plan for the dependencies moving to a different directory.

mirkobrombin commented 2 years ago

I will keep this issue open for reference and for some notes that should not be missed. But repository caching is not yet planned, we are working on it but it doesn't have a date, so it will take some time.

mirkobrombin commented 2 years ago

Local repositories implemented: https://github.com/bottlesdevs/programs/issues/23

I'll keep this issue open for the Temp folder reorganization.

mirkobrombin commented 2 years ago

Closing in favor of #439