Skip to content
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

Profiles for non root package #15262

Open
Ghamza-Jd opened this issue Mar 4, 2025 · 4 comments
Open

Profiles for non root package #15262

Ghamza-Jd opened this issue Mar 4, 2025 · 4 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@Ghamza-Jd
Copy link

Problem

I want to change the default release profile to optimize for size. If I set the profile in a workspace member package it logs this warning:

warning: profiles for the non root package will be ignored, specify profiles at the workspace root

So I've moved the profile to the root package but it didn't take any effect (size went from 48 MBs to 88 MBs)

And if I have the profile in both, it does ignore the non root one so no issue in their.

Summary: non root packages are ignoring the profile from the root package

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version


@Ghamza-Jd Ghamza-Jd added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Mar 4, 2025
@ehuss
Copy link
Contributor

ehuss commented Mar 4, 2025

Can you please include a complete reproduction? It's not clear what the issue here is from the description.

@Ghamza-Jd
Copy link
Author

Ghamza-Jd commented Mar 4, 2025

Can you please include a complete reproduction? It's not clear what the issue here is from the description.

Sure, the repo I'm working on is: https://github.com/Ghamza-Jd/janus-mobile-sdk

Currently the release profile config is inside rslib/Cargo.toml, if we run cargo run -p rslib --release the size of the static lib .a is 39 MB and for the .rlib its 7.2 MB

But if you move the config to the root Cargo.toml and rerun cargo run -p rslib --release the size of the static lib .a is 75 MB and the .rlib is 13.1 MB

So the configs aren't being used when they're in the root package

@ehuss
Copy link
Contributor

ehuss commented Mar 4, 2025

I believe it is working correctly when the profile is moved to the workspace. lto = "thin" can result in substantially larger binaries due to inlining.

You can use the --verbose flag to verify which flags are being passed to rustc.

@epage
Copy link
Contributor

epage commented Mar 4, 2025

Note that for cargo install from a registry, the workspace profile will be lost. We are tracking that in #8264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants