coreos-installer icon indicating copy to clipboard operation
coreos-installer copied to clipboard

Support building only the image download and manipulation subcommands for MacOS

Open sacundim opened this issue 1 year ago • 0 comments

cargo install coreos-installer fails to compile on MacOS with an assortment of errors that can be summarized by the first one: it just relies on features only available in Linux.

error[E0433]: failed to resolve: could not find `linux` in `os`
  --> /Users/sacundim/.cargo/registry/src/github.com-1ecc6299db9ec823/coreos-installer-0.17.0/src/blockdev.rs:28:14
   |
28 | use std::os::linux::fs::MetadataExt;
   |              ^^^^^ could not find `linux` in `os`

An 2021 ticket about a compilation failure in MacOS was closed citing that there was no use case for building or running the tool in MacOS:

coreos-installer isn't expected to build or run on macOS. What's the use case you have in mind?

I don't know what the situation was back then, but I just came across this compilation feature simply because I want to use the coreos-installer download and coreos-installer iso subcommands to build a custom ISO in a Mac.

If the Linux-specific bits can be isolated to just the coreos-installer install subcommand, maybe it is possible to either (a) not build that part of the codebase when targeting a platform that doesn't have the requisite support, or (b) split those other subcommands into a separate tool?

Workaround (which documentation mentions and I've used successfully): run the tool from a Docker image:

docker run --pull=always --privileged --rm \
    -v /dev:/dev -v /run/udev:/run/udev -v "$(pwd)":/data -w /data \
    quay.io/coreos/coreos-installer:release [ARGS ...]

sacundim avatar May 23 '23 00:05 sacundim