News for hackers. Stuff that matters.
Re:The Simplicity of Single-File Golang Deployments by drewg123 on Wednesday March 22, 2023 @07:51PM (#35268707)
Can you link something substantial, like Firefox, statically on NetBSD?
Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Wednesday March 22, 2023 @08:19PM (#35268949)
Compiling Firefox on NetBSD (dynamically) takes longer than compiling the kernel, maybe even longer than compiling an entire base system. It's been a long time since I tried it but it just took far too long so I lost interest. Granted, the computers I use have limited resources. Anyway, I gave up on graphical browsers many years ago. There are many programs I can compile statically because I prefer smaller software.^1 For example, the text-only browser, the TCP clients, the forward proxy, tmux, tinysshd, nvi, lua, stunnel, djbdns, daemontools, clockspeed, openssl, bssl, ffmpeg and various other programs I use are all static binaries. I also prefer crunched binaries on BSD to save space. These are static.

Whether a program can be compiled statically is a factor in whether I choose to use it. That effectively screens out many large programs that have numerous dependencies because compiling them statically often becomes too much hassle and the binaries are too large. For example, I compiled dnsdist statically using musl. Of course, "large" is subjective. I consider an 11M C program to be large but some HN commenters using memory-safe languages might think 11M is nothing.

1. Some have dependencies other than libc.

Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Wednesday March 22, 2023 @11:26PM (#35270198)
Graphical web browsers from "tech" companies are too large, too complex, too difficult for the user to control. IMHO.
Re:The Simplicity of Single-File Golang Deployments by 1vuio0pswjnm7 on Thursday March 23, 2023 @06:02PM (#35281908)
If "you" means "a person", then yes.

If "you" means me, then no, because I do not have the patience nor do I think it would be worth the trouble.

The binary would be enormous.

One thing I used to do many years ago is create compressed images of directories containing programs or files needed by those programs, e.g., /usr/pkg/bin, etc., using makefs and vndcompress, then save these to bootable USB stick. For example, I might install Firefox, then create the images. The way I use NetBSD is that I boot into RAM from USB. I may or may not use a disk. Writeable directories are mounted as tmpfs. I use RAM as disk. This is one reason I like small programs. Installing Firefox would take up too much space, i.e., RAM, so I would mount the USB stick after boot, then mount the compressed images over certain directories, e.g., /usr/pkg/bin. As I recall, this worked, but eventually I gave up on graphical browsers, as well as X11.