mapbox / mason

Cross platform package manager for C/C++ apps
BSD 2-Clause "Simplified" License
254 stars 69 forks source link

Message following "Updating binary package" doesn't make sense #697

Open lightmare opened 5 years ago

lightmare commented 5 years ago

Before af24915ba36c57ef7133023eb55148712a6023f1 the message was:

* Updating binary package linux-x86_64/gdal/2.4.1.tar.gz...
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
* Binary package is still up to date

the script was broken, and the message could not be trusted, because it didn't actually check the package URL.

After af24915ba36c57ef7133023eb55148712a6023f1 it is:

* Updating binary package linux-x86_64/gdal/2.4.1.tar.gz...
* Binary not available yet for linux-x86_64/gdal/2.4.1.tar.gz

Now it actually checks the URL, but then says it's not available. I'd assume curl should succeed with HTTP status 304 Not Modified, but it appears to work differently.

springmeyer commented 5 years ago

I did not write the updating support. But I vaguely think it may be triggered in the case that the binary has been cached locally but it is being also checked remotely? But overall, if it was broken for so longer and nobody noticed/complained them it may actually be find to remove the support. The usecase of having things locally and updating is one I handle by rm -rf mason_packages/ && mason install ...

lightmare commented 5 years ago

I prefer not re-downloading what I already have; especially when I'm on slow limited connection. That's why I symlink mason_packages/.binaries to ~/.cache/mapbox/mason.binaries (which mason should be using by default, IMO, but that's a different discussion).

I'm okay with skipping the remote check by default, if the local file already exists. But as long as packages can be re-published under the same version number, there should be some way to force this cheap check (curl -z aka If-Modified-Since).

springmeyer commented 5 years ago

which mason should be using by default, IMO, but that's a different discussion).

Yes, I've often wanted this, just not had time to write tests for it.

I'm okay with skipping the remote check by default, if the local file already exists.

👌

But as long as packages can be re-published under the same version number, there should be some way to force this cheap check (curl -z aka If-Modified-Since).

Right. As previously discussed, we tried to get away from that. Or at least it should be so rare that it should not need to be supported locally with re-fetching.