Add Linux/.NET 8 cross-platform support - #6
Open
S3cur3Th1sSh1t wants to merge 1 commit into
Open
Conversation
Retarget net48 -> net8.0 so Volumiser builds and runs as a native Linux
(and macOS) binary as well as on Windows, and fix the cross-platform
issues that surfaced:
- AWS EBS: the SDK's synchronous ListSnapshotBlocks/GetSnapshotBlock
overloads only exist on .NET Framework. Use the *Async variants so the
EBS snapshot path builds and runs on .NET 8.
- Local disk images: VirtualDisk.OpenDisk(path) routes through a file
locator that hardcodes a '\' separator and fails on Linux/macOS
(e.g. "/tmp\/disk.img"). Dispatch by extension to the per-format path
constructors instead. This also fixes multi-extent VMDKs (a descriptor
pointing at -flat/-s001 extents), which the stream constructor rejected
with "Unknown type" / "Only Monolithic Sparse ... via a stream".
- Listings and downloads: replace Path.GetFileName with a
separator-agnostic LeafName so in-disk ('\') paths yield clean leaf
names off-Windows (ls output and download target filenames).
- Drop the Windows-only dnMerge IL-merge package; use the built-in
PublishSingleFile for single-binary output.
Build for Linux:
dotnet publish -c Release -r linux-x64 --self-contained \
-p:PublishSingleFile=true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Heyho,
If I were you I would not merge this one its just FYI and for anyone else to know. With these changes linux support is added - as it's targetting .NET Core 8.0 the tool would not be
execute-assemblycapable anymore so that's why its a bad idea to merge. Anyway if someone needs linux support at some time. This will help.Build for Linux:
dotnet publish -c Release -r linux-x64 --self-contained \ -p:PublishSingleFile=true
Greetings