-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
build: Add de-duplication for non-result targets in get_all_link_deps #15284
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
base: master
Are you sure you want to change the base?
Conversation
|
Update: I rebased the changes from upstream into my fork via the GitHub interface. I made sure the button said "Rebase and merge". If I have done something incorrectly, please let me know. @jpakkane Can you or someone else that is on the team please take a look at this? |
|
Nope, unfortunately it didn't do the right thing. To rebase just use |
|
Also, please use |
mesonbuild/build.py
Outdated
| at link time, see get_dependencies() for that. | ||
| """ | ||
| result: OrderedSet[BuildTargetTypes] = OrderedSet() | ||
| nonresults: OrderedSet[BuildTargetTypes] = OrderedSet() |
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 can be a regular set:
nonresults: T.Set[BuildTargetTypes] = set()
which is faster than the ordered one.
|
Will do, thanks! I don't typically rebase, so not an area of Git I'm great with. Will try to resolve when I can. |
b70f9f5 to
a002714
Compare
|
Okay, changes made and rebase (hopefully) corrected! Let me know if anything else needs to be tweaked. |
|
Thanks, it's an improvement but there are changes to make:
It will add t.link_targets to the stack in opposite order compared to the incoming list. You can achieve what the original code does with the following: |
a002714 to
9e74769
Compare
|
Okay, hopefully that fixed it. I ran the rebase command you provided, and I think it worked since I don't see "RobotLeopard86 committed" all over the commits anymore. Sorry for having issues with the system; like I mentioned, I don't use rebase typically, so I'm bad with managing that. Hopefully this can be merged now if everything is good. |
9e74769 to
e7bb256
Compare
|
It does look good to me! |
|
All right, all checks passed. Is this ok to merge then? |
Note
This is my first time submitting a PR to Meson, so I hope I did everything right. I just followed the Contributing page on the website.
I recently started having an issue configuring one of my projects on Windows. Meson would get through configuration and just never finish and spit out a
build.ninja. I looked into it, and the problem seemed to be that inget_all_link_deps(build.py), the high numbers of interconnected static libraries from LLVM were causing the stack to get stuck in an infinite loop of adding the same libraries over and over, so it never emptied.I fixed this by adding a second set of "nonresults": targets that are not results, but we have seen and thus already know to ignore for this calculation. Any potential target to be added to the stack must not be in the nonresults list. It's possible that this check incurs a slight performance penalty due to iterating over the targets and adding them one by one instead of in one huge batch. However, it does allow everything to successfully configure and have a Ninja file actually be generated.
I know that feature freeze is in 2 days, so this is a bit of a rushed, quick patch, but I hope I did everything correctly and this can get in for Meson 1.10.0.
I'm not the best with Python or Meson's internals (I'm a C++ guy), so I hope I did everything right. This shouldn't affect anything that relies on
get_all_link_depssince it doesn't change the return value.