dlang / dub

Package and build management system for D
MIT License
678 stars 227 forks source link

Build cache in %APPDATA% suffering from read-only flags #2607

Closed veelo closed 1 year ago

veelo commented 1 year ago

Since Dub started using the central build cache under %APPDATA% on Windows, I am having trouble building subpackages of Pegged.

The problem occurs both in GitHub Actions and locally on my machine. When I inspect the properties of the build folder, I notice that the check box for Read-only is marked black, suggesting that some files/folders are read-only while others are not. I can uncheck the box and apply recursively, but when I check back immediately after, the box is ticked again.

I actually don't think this is Dub's fault, it possibly is some "security" feature of Windows (I am running 10 Pro), but I don't know how to work around it. I already have added an exclusion for the cache directory under Windows "Virus & thread protection settings".

I don't see an option in the documentation to set the cache location manually for dub test.

I am reporting it here for others to see, maybe %APPDATA% cannot be relied on for build cache.

Geod24 commented 1 year ago

It looks like my release notes were wrong. The cache is in %LOCALAPPDATA%, not %APPDATA%. That's the way it should be. The implementation works as intended, the release notes were the only error. The difference between %APPDATA% and %LOCALAPPDATA% is that the former roams, while the latter doesn't. IOW, if you are in a domain, your settings will be there whatever machine you log on in, while your build and package cache will not.

Geod24 commented 1 year ago

The path in your link is 272 characters, which is over the 256 chars limit. It is likely you are hitting https://github.com/dlang/dub/issues/2538 which will be fixed in the next release.