-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Pass compile mode to the custom build script #10126
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,8 @@ pub struct UnitInner { | |
pub kind: CompileKind, | ||
/// The "mode" this unit is being compiled for. See [`CompileMode`] for more details. | ||
pub mode: CompileMode, | ||
/// The "mode" of the root unit. Required when unit's mode is `CompileMode::RunCustomBuild` | ||
pub root_mode: CompileMode, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than adding an additional field you don't always need, I think it might make sense to add a field to the RunCustomBuild unit: enum CompileMode {
RunCustomBuild { root_mode: Box<CompileMode> },
} There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jyn514 that's an awesome idea, thanks! One issue -- the enum implements |
||
/// The `cfg` features to enable for this unit. | ||
/// This must be sorted. | ||
pub features: Vec<InternedString>, | ||
|
@@ -176,6 +178,7 @@ impl UnitInterner { | |
profile: Profile, | ||
kind: CompileKind, | ||
mode: CompileMode, | ||
root_mode: CompileMode, | ||
features: Vec<InternedString>, | ||
is_std: bool, | ||
dep_hash: u64, | ||
|
@@ -207,6 +210,7 @@ impl UnitInterner { | |
profile, | ||
kind, | ||
mode, | ||
root_mode, | ||
features, | ||
is_std, | ||
dep_hash, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't matter to the build script, no dependencies will be built after it runs.