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

Removing external libusb usage #12340

Closed

Conversation

Tamir91
Copy link
Contributor

@Tamir91 Tamir91 commented Oct 31, 2023

Tracked on [LRS-784]

@Tamir91 Tamir91 marked this pull request as draft October 31, 2023 14:36
@Tamir91 Tamir91 force-pushed the removing-external-libusb branch from 10eded3 to 8671506 Compare November 2, 2023 08:21
@Tamir91 Tamir91 marked this pull request as ready for review November 2, 2023 11:47
@Tamir91 Tamir91 requested a review from Nir-Az November 2, 2023 11:47
@Nir-Az
Copy link
Collaborator

Nir-Az commented Nov 2, 2023

@maloel looks like windows rsusb compiled w/o internal libusb
Does it mean it is not used?

@maloel
Copy link
Collaborator

maloel commented Nov 3, 2023

looks like windows rsusb compiled w/o internal libusb Does it mean it is not used?

It could be that's it's not used -- like I said, pybackend should not be dependent on it. Maybe other places, too.
Hard to say without investigation.

@Nir-Az
Copy link
Collaborator

Nir-Az commented Nov 3, 2023

looks like windows rsusb compiled w/o internal libusb Does it mean it is not used?

It could be that's it's not used -- like I said, pybackend should not be dependent on it. Maybe other places, too. Hard to say without investigation.

Tamir, please try adding the pybackend cmake flag to windows gha to check and try to see when we build it

@Nir-Az
Copy link
Collaborator

Nir-Az commented Nov 5, 2023

should be
-DFORCE_RSUSB_BACKEND=ON
instead of
-DFORSE_RSUSB_BACKEND=ON

@Tamir91
Copy link
Contributor Author

Tamir91 commented Nov 5, 2023

I checked number builds on Windows with -DFORCE_RSUSB_BACKEND=ON CMake flag.
All GHA tested passed. Perform addition tests?

find_package_handle_standard_args(usb LIBUSB_LIB LIBUSB_INC)

add_library(usb INTERFACE)
if (USB_FOUND)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Who turn this flag on?
When will it be off?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I not found place where we create or change this flag, only 1 usage.
Is this unnecessary flag?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Read online..

I think find_package_handle_standard_args(usb set it

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please make sure what happened when it is not found.
Maybe we need an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Read online..

I think find_package_handle_standard_args(usb set it

Oh, I Already read about it. USB_FOUND will true if LIBUSB_LIB LIBUSB_INC will be found.

USB_FOUND is false if libusb-1-dev not installed and installation crashing on install(TARGETS usb EXPORT realsense2Targets) line

We can add:
message(FATAL_ERROR "decription") - stop processing and generation.
or
message(SEND_ERROR "decription") - continue processing, but skip generation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So are you saying windows has libusb installed?
And on windows USB_FOUND = true?

Copy link
Contributor Author

@Tamir91 Tamir91 Nov 6, 2023

Choose a reason for hiding this comment

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

I see in a logs LIBUSB_LIB (missing: LIBUSB_INC) and the code in if not executing (USB_FOUND = false).
But the viewer run after building.
Are you think it may cause error in some places?

Copy link
Collaborator

Choose a reason for hiding this comment

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

So it does not get into the if and the install does not complain??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it does not get into the if. But the viewer run correctly.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Show me the output logs tomorrow please

windows -DFORSE_RSUSB_BACKEND=ON

external libusb removed
@Tamir91 Tamir91 force-pushed the removing-external-libusb branch from c41cdc1 to de586da Compare November 5, 2023 18:38
@Tamir91 Tamir91 requested a review from Nir-Az November 6, 2023 07:31
@Tamir91 Tamir91 force-pushed the removing-external-libusb branch from b83ea9f to e6f7cec Compare November 7, 2023 10:11
@Tamir91
Copy link
Contributor Author

Tamir91 commented Nov 14, 2023

We can't remove libusb usage. A libusb will be updated with latest tag.

@Tamir91 Tamir91 closed this Nov 14, 2023
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.

3 participants