Re:Reducing Tailscale’s binary size on macOS
by zacwest on Friday February 17, 2023 @10:58AM
(#34836163)
Generally on Apple platforms the move here would be putting the shared binary into a dynamic .framework rather then trying to eliminate the shared dependency. Is this a limitation of authoring it in Go that it has to be entirely static?
Re:Reducing Tailscale’s binary size on macOS
by mihaip on Friday February 17, 2023 @12:08PM
(#34837294)
(I’m the author of the post)
The solution we ended up with was partially a matter of the minimum change to fix the issue, and partly because we have a lot of platforms to cover with a small team, so the fewer platform-specific concepts we have (frameworks in this case), the easier it is to maintain.
Re:Reducing Tailscale’s binary size on macOS
by mihaip on Friday February 17, 2023 @04:01PM
(#34840512)
What would you recommend? dlopen is only used when running in CLI mode (which is not super performance sensitive), but not making it slower than it needs to be would be good too.
Re:Reducing Tailscale’s binary size on macOS
by saagarjha on Friday February 17, 2023 @10:25PM
(#34843564)
You should link against the library directly. dyld’s optimizations are complex, especially when it comes to third party code, but by linking directly the system can cache some of the work.
Re:Reducing Tailscale’s binary size on macOS
by mihaip on Friday February 17, 2023 @03:57PM
(#34840469)
There is a way to build an even smaller version of Tailscale for embedded systems, though there are some trade offs with regards to ease of use and security. https://tailscale.com/kb/1207/small-tailscale/ has more details.
Re:Reducing Tailscale’s binary size on macOS
by tarasglek on Saturday February 18, 2023 @03:13AM
(#34845039)
Method described gets most of the win from UPX.
That's not applicable on openwrt as it already uses lzma on filesystem level. Switching to UPX would cause excessive ram usage as binary would be in anonymous memory and no longer be backed by filesystem pages.
Re:Reducing Tailscale’s binary size on macOS
by mihaip on Friday February 17, 2023 @03:59PM
(#34840486)
upx is not used in the macOS build (we only mention it as a possibility in https://tailscale.com/kb/1207/small-tailscale/, which is for embedded systems), so I have no done any benchmarking with it.
Re:Reducing Tailscale’s binary size on macOS
by 1vuio0pswjnm7 on Saturday February 18, 2023 @12:51AM
(#34844314)
If the program in inteneded by me to run on a small form factor computer with limited storage, such as a router, then the program nearly doubling in size is going to draw attention.
Bloated is subjective. That means there will different opinions, like it or not. Not every computer owner has the same usage patterns nor equipment.
What's interstig is that I never used the word "bloated". I simply noted the program size increased. That is not a subjective opinion it is a fact.
Re:Reducing Tailscale’s binary size on macOS
by least on Friday February 17, 2023 @04:49PM
(#34841053)
Somewhat tangential, but ever since a recent update of the MacOS tailscale client, I've been unable to connect to any other exit nodes. I click on the exit node I'd like to connect to and it just silently fails. I tried making a shortcut as well that would connect to that node and it also fails. I've verified the exit node itself is working correctly on other devices, it only fails on the Macbook.
Re:Reducing Tailscale’s binary size on macOS
by mihaip on Friday February 17, 2023 @09:16PM
(#34843160)
Can you sent a message to [email protected] about this and include a bug report ID (option click on the Tailscale menu icon and choose Debug -> Bug Report…)?
Re:Reducing Tailscale’s binary size on macOS
by mihaip on Tuesday February 21, 2023 @07:14PM
(#34889695)
One change that went into 1.36 is that you can no longer use an exit node while advertising one (https://github.com/tailscale/tailscale/issues/3569). The Mac UI was not updated for that in time, but the next release the menu items should be disabled correctly.
The solution we ended up with was partially a matter of the minimum change to fix the issue, and partly because we have a lot of platforms to cover with a small team, so the fewer platform-specific concepts we have (frameworks in this case), the easier it is to maintain.
11452 -rwxr-xr-x 1 root root 11.2M Sep 1 2021 /usr/sbin/tailscaled
7612 -rwxr-xr-x 1 root root 7.4M Sep 1 2021 /usr/sbin/tailscale
I love tailscale, but it forces me to use usb sticks on most of my openwrt routers.
@mihaip, have you been able to measure any changes before/after?
https://news.ycombinator.com/item?id=34732782
hard to take seriously the idea that 11MB is bloated in a normal linux server or user desktop environment
Bloated is subjective. That means there will different opinions, like it or not. Not every computer owner has the same usage patterns nor equipment.
What's interstig is that I never used the word "bloated". I simply noted the program size increased. That is not a subjective opinion it is a fact.
Has anyone else encountered this issue?
https://github.com/google/bloaty
Or goweight.