-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
CI: use lld if present (Linux only) #8641
Conversation
ifeq ($(shell uname -s),Linux) | ||
EXPORT_CC ?= $(if $(shell command -v ld.lld),CC="cc -fuse-ld=lld") | ||
endif | ||
|
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.
How about just
ifeq ($(shell command -v ld.lld >/dev/null && uname -s),Linux)
CC ?= cc -fuse-ld=lld
endif
then leaving off all the stuff down the page.
This is cleaner, and still lets people override CC
in the environment if they wish.
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.
I updated the condition but the CC and other vars are not exported automatically
That is also a reason why an EXPORT
variable is used somewhere else in the Makefile.
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.
@RX14 Sounds reasonable. But when overriding CC
, you'd need to remember to add -fuse-ld=lld
explicitly...
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.
Writing export CC
works, and is much cleaner.
EXPORT_CC value can be overridden to disable lld lookup.
Please don't merge things before the person who reviewed has had a chance to respond to review followups! Especially when the fix merged wasn't the same as the one suggested. |
I agree. I've approved the PR because it seemed fine to me, but I also expected we'd wait for your approval before merging. Maybe there's a communication error and @bcardiff assumed I was sending my approval to merge this immediately. In general, I'd prefer to wait at least 24 hours before merging a PR to giver others a chance to review and comment. I'm not sure this should go into a policy or something, but it could help to think about that. While it's not a huge issue to apply changes after the PR has been merged via a second PR, it can still cause quite some friction which can be avoided by simply postponing a merge for a few hours. 😉 |
I couldn't make it work with
Adding a It seems that overriding It also leads to less explicit output. In the current PR the Since this is somehow a workaround that might affect some, and using lld is optional I think is better to have an explicit output to allow diagnostic whether lld is used or not. This trial and error + the approval encourage me to merge it. Probably I am missing something in my makefile-fu-ness. But I couldn't improve the current solution. |
Looks like I'm not sure about the benefits of having explicit, I personally find it messy. Either way, I appreciate the chance to test my makefile knowledge :P |
EXPORT_CC value can be overridden to disable lld lookup.
crystallang/crystal:0.32.1-build
andcrystallang/crystal:0.32.1-i386-build
docker images have been updated to include lld-8 according to Install lld-8 as ld.lld on build images crystal-dist#8