Skip to content

Add Linux/.NET 8 cross-platform support - #6

Open
S3cur3Th1sSh1t wants to merge 1 commit into
CCob:masterfrom
S3cur3Th1sSh1t:linuxsupport
Open

Add Linux/.NET 8 cross-platform support#6
S3cur3Th1sSh1t wants to merge 1 commit into
CCob:masterfrom
S3cur3Th1sSh1t:linuxsupport

Conversation

@S3cur3Th1sSh1t

Copy link
Copy Markdown

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-assembly capable 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant