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

fix: Fixed has target check taking ages for large projects #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmachowinski
Copy link

The old implementation took up to 30 seconds for packages, were a lot of targets existed. This is a common case for interface packages containing a lot of messages.

Copy link

@wjwwood wjwwood left a comment

Choose a reason for hiding this comment

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

After reading https://stackoverflow.com/questions/23849953/how-to-check-existence-of-the-target-in-a-makefile, I'm wondering if we shouldn't also use --dry-run and maybe use the strategy suggested there where we check the output of the data base with --print-data-base? I'm not certain it provides more benefits, but maybe it would help to avoid unintended (and in some cases expensive time-wise) side effects.

With that suggestion aside, there's just a few small technical questions and requests before this is lgtm.

colcon_cmake/task/cmake/__init__.py Show resolved Hide resolved
colcon_cmake/task/cmake/__init__.py Outdated Show resolved Hide resolved
@wjwwood
Copy link

wjwwood commented Mar 30, 2024

I tested this on macos and I didn't notice or see any issues building the ros2.repos up to rclcpp and a little past that.

@jmachowinski jmachowinski marked this pull request as draft April 13, 2024 10:43
@jmachowinski
Copy link
Author

I had some issues with this patch, it does not seem to work in special situations.
I currently don't have time to look into it, therefore I will convert this PR into a draft.

@cottsay
Copy link
Member

cottsay commented Apr 16, 2024

What sort of behavior does this exhibit if the CMake generator is Visual Studio? Also, what if the system's language is not set to English - is make's output localized?

@jmachowinski
Copy link
Author

What sort of behavior does this exhibit if the CMake generator is Visual Studio?

Unchanged

Also, what if the system's language is not set to English - is make's output localized?

AFAIK make is not localized, at least it is not on my german localized ubuntu

The old implementation took up to 30 seconds for packages,
were a lot of targets existed. This is a common case for
interface packages containing a lot of messages.

Signed-off-by: Janosch Machowinski <[email protected]>
@jmachowinski
Copy link
Author

After reading https://stackoverflow.com/questions/23849953/how-to-check-existence-of-the-target-in-a-makefile, I'm wondering if we shouldn't also use --dry-run and maybe use the strategy suggested there where we check the output of the data base with --print-data-base? I'm not certain it provides more benefits, but maybe it would help to avoid unintended (and in some cases expensive time-wise) side effects.

--dry-run generated a lot of not needed output, which is not done by the question mode. As I don't check on the return code, but parse the std_err instead, we should be fine

@jmachowinski jmachowinski marked this pull request as ready for review June 12, 2024 17:48
@jmachowinski
Copy link
Author

This version is working, and tested. Additional tests would be appreciated though, as I only have a linux machine.

@cottsay
Copy link
Member

cottsay commented Jun 13, 2024

Beyond the linting errors that CI identified, I am also concerned that this change is coupled to GNU Make. The -q flag has a different (and incompatible) meaning on BSD: https://man.freebsd.org/cgi/man.cgi?make(1)

That said, BSD isn't an explicitly supported platform, but it still doesn't feel good to break it just for an optimization. I'll do a little more poking around to see if I can see another solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants