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

flowey: only build with LTO on macOS #87

Merged
merged 1 commit into from
Oct 15, 2024
Merged

flowey: only build with LTO on macOS #87

merged 1 commit into from
Oct 15, 2024

Conversation

jstarks
Copy link
Member

@jstarks jstarks commented Oct 15, 2024

To restore build performance of flowey on non-macOS systems, add a trampoline binary to build flowey with LTO only on macOS.

Ideally, we'd work around this in a less invasive way, but cargo does not have support for target-specific profile options, target-specific environment variables, target-specific aliases, or anything else I can think of that would help here.

(We could also have a config.toml that gets passed to flowey invocations and sets a custom rust flag specifically for macos. However, due to other cargo limitations, that would require that all flowey invocations occur at the root of the workspace, which is annoying.)

To restore build performance of flowey on non-macOS systems, add a trampoline
binary to build flowey with LTO only on macOS.

Ideally, we'd work around this in a less invasive way, but cargo does not have
support for target-specific profile options, target-specific environment
variables, target-specific aliases, or anything else I can think of that would
help here.

(We could also have a config.toml that gets passed to flowey invocations and
sets a custom rust flag specifically for macos. However, due to other cargo
limitations, that would require that all flowey invocations occur at the root
of the workspace, which is annoying.)
@jstarks jstarks requested review from a team as code owners October 15, 2024 17:40
Copy link
Contributor

@daprilik daprilik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also remove the --profile flowey invocations in the flowey bootstrap logic that runs in CI?

We can land a more comprehensive fix there when we have macOS CI runners.

@jstarks
Copy link
Member Author

jstarks commented Oct 15, 2024

Can you also remove the --profile flowey invocations in the flowey bootstrap logic that runs in CI?

We can land a more comprehensive fix there when we have macOS CI runners.

Where is that?

@daprilik
Copy link
Contributor

Can you also remove the --profile flowey invocations in the flowey bootstrap logic that runs in CI?
We can land a more comprehensive fix there when we have macOS CI runners.

Where is that?

Ah, apologies - I meant to refer to the code in cargo xflowey regen, which passes --profile flowey.

I think CI is OK

@jstarks
Copy link
Member Author

jstarks commented Oct 15, 2024

If I remove the --profile flowey, then this change won't work, right?

@daprilik
Copy link
Contributor

Ohh, yep, you're right - I was mixing the different approaches we considered. Context switching is hard 😅

@jstarks jstarks enabled auto-merge (squash) October 15, 2024 18:14
@jstarks jstarks merged commit b9acac7 into microsoft:main Oct 15, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants