Skip to content

Six examples fail to compile on a plain Linux host, and no CI job sees that configuration #6

Open

Description

@iagodpassos

Found while reviewing #5. On a host that is neither Windows nor macOS, with no
features enabled, the library compiles — but six of the nine examples do not:

rustup target add x86_64-unknown-linux-gnu   # reproduces from any host
cargo check --target x86_64-unknown-linux-gnu --examples
Example Errors
anchored_click E0432 unresolved imports
diagnose E0432
list_windows E0432, E0433
port_from_csharp E0432
read_field E0432
wait_until_ready E0432

The cause is structural: AutoIt, recipes and friends only exist under
cfg(any(windows, target_os = "macos", feature = "mock-loader", docsrs)), and
these examples import them unconditionally. macos_permissions,
portable_selectors and type_safely already compile everywhere.

CI cannot catch this today. The lint job runs --all-features, which turns on
mock-loader and makes every item exist; the test matrix is macOS and Windows
only. The plain-Linux configuration is built nowhere.

What to do

  1. Gate the six examples the way port_from_autoit (docs: add a compiled AutoIt porting example #5) does: imports and
    driving code behind the crate's platform cfg, with a small fallback main
    that prints why there is nothing to drive. That example is the template —
    after docs: add a compiled AutoIt porting example #5 it is the only driving example that compiles on plain Linux.
  2. Pin the configuration in CI so it cannot regress — one line in the lint
    job: cargo check --examples (no features, ubuntu runner).

When a Linux backend lands (discussion #4), these gates shrink rather than
grow: the fallback arm stays for whatever platforms remain unsupported.

No Windows machine or DLL is needed for any of this.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions