Skip to content

Support building only the image download and manipulation subcommands for MacOS #1191

Open
@sacundim

Description

@sacundim

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 ...]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @sacundim

      Issue actions

        Support building only the image download and manipulation subcommands for MacOS · Issue #1191 · coreos/coreos-installer