Skip to content

Improper multi-line templating of pre-build configuration #1554

Open
@arthuro555

Description

@arthuro555

Checklist

Describe your issue

Using a multi-line string in Cross.toml's pre-build field causes $CROSS_DEB_ARCH to not be properly replaced with the current architecture.

What target(s) are you cross-compiling for?

armv7-unknown-linux-gnueabihf

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.2.5

Example

Here are two failing configurations:

[build]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update",
    """apt-get --assume-yes --no-install-recommends install
    libssl-dev:$CROSS_DEB_ARCH
    libcairo2-dev:$CROSS_DEB_ARCH
    """,
]
[build]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update",
    """apt-get --assume-yes --no-install-recommends install \
    libssl-dev:$CROSS_DEB_ARCH \
    libcairo2-dev:$CROSS_DEB_ARCH \
    """,
]

Here is an equivalent, working configuration using a simple string:

[build]
pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update",
    "apt-get --assume-yes --no-install-recommends install libssl-dev:$CROSS_DEB_ARCH libcairo2-dev:$CROSS_DEB_ARCH",
]

Expected behavior:

# Functional
apt-get --assume-yes --no-install-recommends install
    libssl-dev:armhf
    libcairo2-dev:armhf

Current behavior:

# Errors: Unknown architecture
apt-get --assume-yes --no-install-recommends install
    libssl-dev:$CROSS_DEB_ARCH
    libcairo2-dev:$CROSS_DEB_ARCH

Additional information / notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions