Skip to content

Leverage the declared ABI for conditional compilation of ink! core crates for compile time and binary size improvements/optimizations #2519

Open
@davidsemakula

Description

@davidsemakula

Overview

ink! projects can now declare their target ABI in their manifest file (i.e. Cargo.toml).
The specified ABI is then propagated into the build environment as a cfg flag ink_abi.

Motivation

Some definitions (and related dependencies) in ink! core crates are only relevant to specific ABIs.
As an example SolEncode and SolDecode implementations for Rust/ink! "primitive" types in ink_primitives and the related alloy_sol_types dependency are unnecessary when the ABI is "ink". The same is also likely true for some SCALE implementations for ink! specific types.
However, this doesn't only apply to ink_primitives but to other ink! core crates as well (e.g. ink, ink_env, ink_e2e e.t.c)

Design

TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-designDesigning a new component, interface or functionality.Breaking changeThis PR of issue introduces a breaking change

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions