News for hackers. Stuff that matters.
Re:HTTP/3 is everywhere but nowhere by homebrewer on Monday March 17, 2025 @10:26AM (#43388962)
If your code does not rely on native libraries, or you're fine with shipping multiple copies for different operating systems, a single build works everywhere with dotnet installed.

Or you can cross-compile and run without having dotnet on the target system, I do it from Linux to all three platforms all the time, it's pretty seamless. The application can be packaged into a single binary (similar to Go), or as a bunch of files which you can then then package up into a zip file.

Re:HTTP/3 is everywhere but nowhere by actionfromafar on Monday March 17, 2025 @11:20AM (#43389508)
How do you cross compile from linux to macos?
Re:HTTP/3 is everywhere but nowhere by orphea on Monday March 17, 2025 @11:38AM (#43389665)

  dotnet publish -r osx-x64 --self-contained
https://learn.microsoft.com/en-us/dotnet/core/deploying/#pub...
Re:HTTP/3 is everywhere but nowhere by mlhpdx on Monday March 17, 2025 @12:30PM (#43390226)
Just like for windows or Linux, in other words. The dotnet tooling is amazingly friction and ceremony free these days.
Re:HTTP/3 is everywhere but nowhere by neonsunset on Monday March 17, 2025 @02:50PM (#43391611)
JIT deployments do not care where they get built on. AOT deployments do because they use OS-provided linker to produce the final binary, much like C++ and Rust do (unless you use PublishAotCross nuget package which uses Zig toolchain to allow you to build Linux binaries from under Windows, I'm sure if someone's interested it could be extended further)

Also, if you want to have just a single binary, you want to do 'dotnet publish /p:PublishSingleFile=true /p:PublishTrimmed=true' instead. Self-contained build means it just ships everything needed to run in a folder without merging the assembly files or without trimming unreachable code and standard library components.