Skip to content

Remappings are auto detected twice #10215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
DaniPopes opened this issue Mar 31, 2025 · 1 comment
Open
2 tasks done

Remappings are auto detected twice #10215

DaniPopes opened this issue Mar 31, 2025 · 1 comment
Labels
T-perf Type: performance

Comments

@DaniPopes
Copy link
Member

DaniPopes commented Mar 31, 2025

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

@DaniPopes DaniPopes added the T-perf Type: performance label Mar 31, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Mar 31, 2025
@mattsse
Copy link
Member

mattsse commented Mar 31, 2025

not exactly sure we need this step

// scan all library dirs and autodetect remappings

because this scans the remappings in libs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-perf Type: performance
Projects
Status: Todo
Development

No branches or pull requests

2 participants