Skip to content

Remappings are auto detected twice #10215

@DaniPopes

Description

@DaniPopes

Component

Forge, Other (please describe)

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 1.0.0-stable (e144b82 2025-02-13T20:02:34.979686000Z)

What version of Foundryup are you on?

N/A

What command(s) is the bug in?

No response

Operating System

macOS (Apple Silicon)

Describe the bug

Remappings are auto detected twice when loading a foundry_config::Config through load_config, in different ways.

  1. Config::with_root builds a default ProjectPathsConfig which detects remappings
    let paths = ProjectPathsConfig::builder().build_with_root::<()>(root);
  2. Config::to_figment uses RemappingsProvider which has different logic of auto detection
    .flat_map(|lib| Remapping::find_many(&lib))

Both are called in load_config through Config::figment_with_root

pub fn figment_with_root(root: impl AsRef<Path>) -> Figment {
Self::with_root(root.as_ref()).into()
}

See samply profile: https://share.firefox.dev/41SgAYV

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-perfType: performance

    Type

    No type

    Projects

    Status

    Next Up

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions