frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Updating Desktop Rust

https://tritium.legal/blog/update
25•piker•3d ago

Comments

saagarjha•2h ago
> On POSIX systems, in theory, we can just update the files in place. Except for dynamically loaded assets, this should work just fine. The OS treats file locking as advisory and open file descriptors are irrelevant, so even if the file is running you overwrite it in place and the user will get the freshest version on the next launch.

If you do this on macOS, and your code is codesigned, you are setting yourself for pain. Instead you should replace the file entirely so the file gets a new vnode.

piker•2h ago
That's super interesting. Tritium is signed and notarized (as is required) and uses the clean second-binary approach on all platforms, so I never ran into this. One thing that did come up was the requirement to use `ditto` rather than a standard unzipping utility to preserve some macOS-sensitive metadata.

[EDIT: the post has been updated for this point. Thanks so much. https://tritium.legal/blog/update#3.]

saagarjha•2h ago
FWIW https://developer.apple.com/documentation/security/updating-... is the relevant documentation for this if you want more details.
silon42•1h ago
Not just MacOS, on Linux this is the correct strategy too.

It covers more cases: either a new instance is starting, or it hasn't fully loaded the file yet.

IshKebab•1h ago
If you want to do this really well I'd do it like A/B updates on Android work.

1. Have two directories for the app: A and B. One contains the "current" version and one contains (possibly) the "next" version.

2. Have the actual app you start be a separate launcher program that just picks which version to launch.

3. While the app is running, periodically check for updates. If an update is available download and unzip it to the A or B directory that isn't currently in use.

4. Next time the launcher program starts it can say "an updated version is already installed, would you like to use it" (or you can just do that automatically if you - or your user - decide that's the best option). If so it marks the appropriate A/B directory as "current" and launches that one.

Zero delay for users, works on all OSes, works with "always use the latest version" as well as "ask the user to update".

I've never tried this tbf - just an idea.

whytevuhuni•1h ago
One caveat (which most apps already do anyway) is to ensure apps have at most one open instance (i.e. switch focus to the existing one), otherwise this might block both versions and result in some really confusing errors for the user, or corrupt a running app’s state if it doesn’t expect its resources to change.
lifthrasiir•1h ago
For Windows, there is an alternative approach: simply rename the running application to a different name (e.g. app.exe to app-old-timestamp.exe). This frees up the file name which can be overwritten to any other executable. The only problem I'm aware of is that this process may leave app.exe non-existent for a moment [1], but in return a need for keeping two executables vanishes.

[1] Technically speaking I believe this can be solved with transactional NTFS (deprecated but still available as of Windows 11, AFAIK).

mrasong•1h ago
Love that they prioritized both privacy (no sketchy background daemons) and security (launch-time checks) for legal apps—finally a team that gets how critical "no surprises" is for tools handling sensitive docs.
goodpoint•33m ago
> An integrated drafting environment needs to be trusted with reading, editing and redlining confidential and trade secret documents.

And yet it's running on windows?!

ginko•20m ago
At least on linux programs shouldn't update themselves. This is the package manager's job.
tyilo•8m ago
I use the `self_replace` crate for this: https://docs.rs/self-replace/latest/self_replace/

Britain has wasted £1,112,293,718 switching off wind turbines in 2025

https://wastedwind.energy/
65•bashy•34m ago•17 comments

FSF announces Librephone project

https://www.fsf.org/news/librephone-project
973•g-b-r•10h ago•383 comments

Pixnapping Attack

https://www.pixnapping.com/
134•kevcampb•4h ago•20 comments

Show HN: Firm, a text-based work management system

https://github.com/42futures/firm
44•danielrothmann•3h ago•22 comments

Beliefs that are true for regular software but false when applied to AI

https://boydkane.com/essays/boss
411•beyarkay•16h ago•310 comments

DOJ seizes $15B in Bitcoin from 'pig butchering' scam based in Cambodia

https://www.cnbc.com/2025/10/14/bitcoin-doj-chen-zhi-pig-butchering-scam.html
164•pseudolus•19h ago•161 comments

Interviewing Intel's Chief Architect of x86 Cores

https://chipsandcheese.com/p/interviewing-intels-chief-architect
101•ryandotsmith•5d ago•13 comments

Just Talk to It – The No-Bs Way of Agentic Engineering

https://steipete.me/posts/just-talk-to-it
27•freediver•4h ago•6 comments

How bad can a $2.97 ADC be?

https://excamera.substack.com/p/how-bad-can-a-297-adc-be
243•jamesbowman•17h ago•129 comments

Unpacking Cloudflare Workers CPU Performance Benchmarks

https://blog.cloudflare.com/unpacking-cloudflare-workers-cpu-performance-benchmarks/
245•makepanic•14h ago•45 comments

A modern approach to preventing CSRF in Go

https://www.alexedwards.net/blog/preventing-csrf-in-go
97•todsacerdoti•19h ago•50 comments

Updating Desktop Rust

https://tritium.legal/blog/update
25•piker•3d ago•11 comments

How AI hears accents: An audible visualization of accent clusters

https://accent-explorer.boldvoice.com/
227•ilyausorov•18h ago•101 comments

A 12,000-year-old obelisk with a human face was found in Karahan Tepe

https://www.trthaber.com/foto-galeri/karahantepede-12-bin-yil-oncesine-ait-insan-yuzlu-dikili-tas...
354•fatihpense•1w ago•146 comments

Nvidia DGX Spark: great hardware, early days for the ecosystem

https://simonwillison.net/2025/Oct/14/nvidia-dgx-spark/
127•GavinAnderegg•9h ago•73 comments

A Early History of Algebraic Data Types

https://www.hillelwayne.com/post/algdt-history/
22•surprisetalk•5d ago•2 comments

Europe's Digital Sovereignty Paradox – "Chat Control" Update

https://www.process-one.net/blog/chat-control-update-oct-2025/
37•neustradamus•2h ago•26 comments

Hacking the Humane AI Pin

https://writings.agg.im/posts/hacking_ai_pin/
148•agg23•6d ago•33 comments

Intel Announces Inference-Optimized Xe3P Graphics Card with 160GB VRAM

https://www.phoronix.com/review/intel-crescent-island
115•wrigby•16h ago•82 comments

Printing Petscii Faster

https://retrogamecoders.com/printing-petscii-faster/
32•ibobev•4d ago•6 comments

Astronomers 'image' a mysterious dark object in the distant Universe

https://www.mpg.de/25518363/1007-asph-astronomers-image-a-mysterious-dark-object-in-the-distant-u...
231•b2ccb2•19h ago•129 comments

How to turn liquid glass into a solid interface

https://tidbits.com/2025/10/09/how-to-turn-liquid-glass-into-a-solid-interface/
173•tambourine_man•15h ago•120 comments

SmolBSD – build your own minimal BSD system

https://smolbsd.org
212•birdculture•17h ago•20 comments

Can we know whether a profiler is accurate?

https://stefan-marr.de/2025/10/can-we-know-whether-a-profiler-is-accurate/
44•todsacerdoti•8h ago•12 comments

Python's splitlines does more than just newlines

https://yossarian.net/til/post/python-s-splitlines-does-a-lot-more-than-just-newlines/
21•woodruffw•6d ago•2 comments

CSS for Styling a Markdown Post

https://webdev.bryanhogan.com/miscellaneous/styling-markdown/
47•bryanhogan•1w ago•11 comments

Why Is SQLite Coded In C

https://www.sqlite.org/whyc.html
240•plainOldText•14h ago•247 comments

What Americans die from vs. what the news reports on

https://ourworldindata.org/does-the-news-reflect-what-we-die-from
574•alphabetatango•16h ago•351 comments

Surveillance data challenges what we thought we knew about location tracking

https://www.lighthousereports.com/investigation/surveillance-secrets/
411•_tk_•14h ago•97 comments

Fixing bugs automatically from a screen recording

https://nitpicks.ai
7•miguelaeh•1w ago•0 comments