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

Update to assimp 5.2.2 #968

Merged
merged 13 commits into from
Jun 30, 2023
Merged

Update to assimp 5.2.2 #968

merged 13 commits into from
Jun 30, 2023

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Apr 7, 2023

This matches the version distributed in Ubuntu Jammy: https://packages.ubuntu.com/jammy/libassimp-dev

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@cottsay cottsay self-assigned this Apr 7, 2023
@cottsay cottsay requested a review from ahcorde as a code owner April 7, 2023 00:04
@Yadunund Yadunund added this to In progress in Iron Irwini via automation Apr 7, 2023
Signed-off-by: Scott K Logan <logans@cottsay.net>
Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

LGTM

@cottsay
Copy link
Member Author

cottsay commented Apr 9, 2023

While this compiles just fine, I'd like to hear from someone on the RViz team about how this package is used in RViz and how we could verify that things still work as expected.

@cottsay
Copy link
Member Author

cottsay commented Apr 11, 2023

I've found one issue with this so far. It appears that if an unacceptable version of assimp is installed, the cmake config for that version might be used and successfully discover the newer version that is being vendored, but may not match the configuration that was built in the vendor package, which will cause the library to be assimp::assimp-NOTFOUND.

Uninstalling the system package resolves the issue, but that's not a solution. Still working on that.

@Yadunund
Copy link
Member

Removed system libassimp5 and built ros2 workspace with -DFORCE_BUILD_VENDOR_PKG=On

Loaded a few models which have a variation of stl, obj and dae meshes for their links and everything looked ok 👍🏼

irb1200
irb4600
truck

@cottsay
Copy link
Member Author

cottsay commented Apr 14, 2023

Alright, this is blocked on #970. Without that change, downstream builds will fail on platforms which have a system assimp package which defines a CMake target but is less than 5.2.0.

@clalancette clalancette removed this from In progress in Iron Irwini Apr 17, 2023
ahcorde
ahcorde previously requested changes May 9, 2023
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

conflicts

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This looks good to me with green CI.

@codebot codebot mentioned this pull request Jun 26, 2023
@clalancette
Copy link
Contributor

clalancette commented Jun 26, 2023

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@cottsay
Copy link
Member Author

cottsay commented Jun 26, 2023

@ros-pull-request-builder retest this please

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

I think there are two remaining issues with this PR:

  1. The patches are failing to apply on Windows. That probably has something to do with line endings or something else fun.
  2. I think we should probably remove all of the ASSIMP_CXX_FLAGS when building on GCC/Clang except for -std=c++14. In my testing locally, all of the warnings there are actually fixed in the code in assimp 5.2.2, so there is no need for us to pass them anymore.

@codebot
Copy link
Member

codebot commented Jun 28, 2023

Looks like line 13 (an empty line) in the patch file has a space, but in the upstream code there is no space on that line. Apparently git apply is not always OK with that in a context line. It's interesting that it applies fine on Linux, but fails on Windows.

For reference, this is the upstream line:
https://github.com/assimp/assimp/blob/v5.2.2/code/Common/ZipArchiveIOSystem.cpp#L197C1-L197C1

I couldn't see the difference until downloading each file and looking in a hex editor to be certain; it seems spaces are sometimes not visible in the GitHub UI.

@clalancette
Copy link
Contributor

Looks like line 13 (an empty line) in the patch file has a space, but in the upstream code there is no space on that line. Apparently git apply is not always OK with that in a context line. It's interesting that it applies fine on Linux, but fails on Windows.

Actually, I don't think that is the issue. At least, in the testing I did locally, removing that space didn't make a difference. I think the problem is more subtle.

In particular, it looks like Git will automatically convert \n to \r\n when it is checking out text files. And the patch files are considered text files. So it means that Git helpfully corrupts the patch when the clone is happening.

The good news is that there seems to be a workaround by adding a .gitattributes file to the repository. That seemed to fix the issue for me locally. I'm going to add that here and see if it makes a difference to CI.

@codebot
Copy link
Member

codebot commented Jun 29, 2023

Yes indeed! Line endings strike again. I just made a PR to this PR that adds the .gitattributes file to ensure that the patch file line endings match up with upstream line endings on Windows checkouts. It turns out that upstream declares eol=lf on all its files, so on Windows they have LF (unix) line endings, whereas our patch file checks out on Windows with CRLF endings. #1004 sets eol=lf to our patch file, so the line endings match on Windows checkouts. This seems to work as expected now in isolated local testing.

codebot and others added 3 commits June 29, 2023 12:41
@clalancette
Copy link
Contributor

All right, with all of those fixes now in, let's try another CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette
Copy link
Contributor

Sigh. There is one more warning on Windows:

CUSTOMBUILD : CMake warning :  [C:\ci\ws\build\rviz_assimp_vendor\assimp_vendor.vcxproj]

I have no idea what that means, but we'll need to fix that as well.

As far as we can tell, this is already the default on
Linux.  Building with and without this line in place
on Linux ended up with the same installation directory
structure.

Also, specifying this causes a warning on Windows where
it isn't used.

Since this is just setting the default anyway, remove it.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
Copy link
Contributor

After (hopefully) figuring out the Windows issue, here is another try for CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@cottsay
Copy link
Member Author

cottsay commented Jun 29, 2023

RPM distros use lib64 - I'd like to see RHEL CI on this change since you removed that line.

@clalancette
Copy link
Contributor

RPM distros use lib64 - I'd like to see RHEL CI on this change since you removed that line.

Yeah, good point. If the previous CI was successful I was going to run more comprehensive CI, but I'll try this locally on RHEL first and see what happens.

It is needed on RHEL.  So make sure to only set it if we are
!WIN32.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette
Copy link
Contributor

RPM distros use lib64 - I'd like to see RHEL CI on this change since you removed that line.

And you were right about this; that line is needed for RHEL. I've added it back conditionally, only on !WIN32. And that now all looks good in my local testing. I'm going to run a bunch of CI here.

@clalancette
Copy link
Contributor

clalancette commented Jun 30, 2023

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status
  • Windows Debug Build Status
  • RHEL Build Status
  • Clang Build Status
  • Linux (FORCE_BUILD_VENDOR_PKG=ON) Build Status

This is an attempt to make Windows Debug work.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
This is failing to work on Windows Debug, and we really
don't need it for a vendored library.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette
Copy link
Contributor

All right, everything here is green. This update was a bit more...delicate than I would have liked, but we seemed to have successfully danced our way around the issues. Going ahead and merging.

@clalancette clalancette merged commit 90a7804 into rolling Jun 30, 2023
2 checks passed
@delete-merged-branch delete-merged-branch bot deleted the cottsay/assimp-5.2.2 branch June 30, 2023 19:17
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.

None yet

5 participants