pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

Not all packages have "provides"

Open magnusviri opened this issue 2 years ago • 6 comments

> tea -X which -a curl
/usr/local/bin/curl
/usr/bin/curl
> tea +curl.se which -a curl
/opt/tea/curl.se/v7.86.0/bin/curl
/usr/local/bin/curl
/usr/bin/curl

Sure enough, curl is missing "provides"

magnusviri avatar Nov 18 '22 04:11 magnusviri

Maybe I should have put this issue in one of the pantry repos.

magnusviri avatar Nov 18 '22 04:11 magnusviri

Yeah, I'm sure there's a few where it's missing. But tea -X which ... is looking for which. If you want curl, that tea -X curl, which does work, absent the provides, so we've clearly done something clever there.

jhheider avatar Nov 18 '22 04:11 jhheider

I don't think it is working. I just removed tea's curl and wget.

> tea -X curl
curl: try 'curl --help' or 'curl --manual' for more information
> tea -X wget
tea: installed: /opt/tea/gnu.org/wget/v1.21.3
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
> tea -X which wget
> tea -X which curl
/usr/bin/curl
> ls -l /opt/tea/curl.se
ls: /opt/tea/curl.se: No such file or directory

tea installed wget because there is no other wget. However, it ran /usr/bin/curl. You can verify this if you create a stub /usr/local/bin/curl that just prints a message. tea will run that instead of installing.

magnusviri avatar Nov 18 '22 05:11 magnusviri

Oh, right. Of course:

$ curl --version
curl 7.84.0 (x86_64-apple-darwin22.0) libcurl/7.84.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.47.0
Release-Date: 2022-06-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets
$ tea -X curl --version
curl 7.84.0 (x86_64-apple-darwin22.0) libcurl/7.84.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.47.0
Release-Date: 2022-06-27
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe UnixSockets
$ tea +curl.se curl --version
curl 7.86.0 (aarch64-apple-darwin21.6.0) libcurl/7.86.0 OpenSSL/1.1.1q zlib/1.2.11
Release-Date: 2022-10-26
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HSTS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets

It's not finding curl (because no provides) so it's passing through to the system curl. Which... seems like it could at least be a warning.

jhheider avatar Nov 18 '22 05:11 jhheider

One solution is to add -Y that will only run tea installed binaries... Then all we're missing is the -Z... LOL

magnusviri avatar Nov 18 '22 17:11 magnusviri

I've been thinking about this a lot because I've had more trouble with -X running binaries than anything. It's been very hard trying to figure out if it's running something from /usr/bin, /usr/local/bin, or if it is running something that it installed. Part of the problem is my setup, which is kind of hacked so I can do dev and use it at the same time. But I'm not sure why anyone would want to use tea -X ... to run anything in /usr/bin or /usr/local/bin or ./ (cwd). I guess maybe someone would want to run something from the cwd if they were testing it.

magnusviri avatar Nov 23 '22 16:11 magnusviri

yeah I agree, we shouldn’t be running stuff from outside tea with -X. I'll fix this.

edit: ca948900b5686d22a621ec56cb485327986c87f6

mxcl avatar Nov 26 '22 15:11 mxcl

Adding all the provides is an ongoing task. I could probably do a quick pass

mxcl avatar Nov 26 '22 15:11 mxcl

I see @jhheider beat me to it: https://github.com/teaxyz/pantry.core/pull/37#pullrequestreview-1194887333

Closing

mxcl avatar Nov 26 '22 16:11 mxcl