Skip to content

Cross config for multiple targets? #1244

Open
@VorpalBlade

Description

@VorpalBlade

Checklist

Describe your request

I need to install OpenSSL when cross compiling to other Linux architectures (e.g. ARM, Aarch64, i686). However the documented command in https://github.com/cross-rs/cross/wiki/Recipes#openssl would as far as I understand lead to code duplication.

I can't find anywhere to specify a glob pattern, e.g.:

[target.*-unknown-linux-*]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH"
]

(and that specific syntax does not work). Do I really need to duplicate this for every single architecture I want to compile to? Or is there a way to stick to the DRY principle (Don't Repeat Yourself)?

Describe why this would be a good inclusion for cross

If this is not supported, it seems like an obvious feature to avoid repetition (and risk of these lines getting out of sync). All matching sections should be applied (e.g. apply both a *windows* and a *x86_64-pc-windows* section when building for 64-bit windows)

Adding a custom docker image for each architecture, maintaining that, and dealing with CI for it is way outside of my personal project scope as well as outside my expertise. Especially since I plan to use a ready-made GitHub CI action to do this (once I confirm everything works locally).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions