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

Updated zstd to 1.5.5 #1617

Merged
merged 7 commits into from
Apr 24, 2024
Merged

Updated zstd to 1.5.5 #1617

merged 7 commits into from
Apr 24, 2024

Conversation

ahcorde
Copy link
Contributor

@ahcorde ahcorde commented Apr 18, 2024

Removed this warning

/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/lib/compress/zstd_compress_superblock.c:412:12: warning: variable 'litLengthSum' set but not used [-Wunused-but-set-variable]
  412 |     size_t litLengthSum = 0;

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde ahcorde self-assigned this Apr 18, 2024
@ahcorde ahcorde requested a review from a team as a code owner April 18, 2024 11:42
@ahcorde ahcorde requested review from emersonknapp and jhdcs and removed request for a team April 18, 2024 11:42
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.

Looks good to me with green CI.

Let's put this on the queue to merge after the freeze is lifted.

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

I would prefer to suppress such warnings via compiler flags for vendor package rather than patching third-party library.

@clalancette
Copy link
Contributor

I would prefer to suppress such warnings via compiler flags for vendor package rather than patching third-party library.

I will point out that this is essentially a backport of facebook/zstd#2838 . That said, I really don't feel strongly either way, so we can go with a change to the compiler flags rather than this patch if you prefer.

@MichaelOrlov
Copy link
Contributor

@clalancette @ahcorde Please go with a change to the compiler flags rather than this patch.
Also, I would appreciate it if you would add a short comment for the compiler flag that it settled because variable 'litLengthSum' set but not used. This way we will try to remove this flag in the next version bump.

@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 19, 2024

@clalancette With this patch 51924ed the warning is still there, do you know what I'm doing wrong?

@clalancette
Copy link
Contributor

@clalancette With this patch 51924ed the warning is still there, do you know what I'm doing wrong?

This is just a guess, but I believe that the zstd code is C, not C++. So you probably need to set CMAKE_C_FLAGS.

@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 23, 2024

I setted "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}" but the error is still there. I included this flag too -DCMAKE_VERBOSE_MAKEFILE=True to debug the commands.

cd /root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor-build/lib && /usr/bin/clang -DXXH_NAMESPACE=ZSTD_ -DZSTD_LEGACY_SUPPORT=0 -DZSTD_MULTITHREAD -Dlibzstd_shared_EXPORTS -I/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor-build/lib -I/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/build/cmake/lib -I/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/build/cmake/../../lib -I/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/build/cmake/../../lib/common -Wno-unused-but-set-variable -std=c99 -Wall -Wextra -Wundef -Wshadow -Wcast-align -Wcast-qual -Wstrict-prototypes -O3 -DNDEBUG -fPIC -MD -MT lib/CMakeFiles/libzstd_shared.dir/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/lib/decompress/huf_decompress.c.o -MF CMakeFiles/libzstd_shared.dir/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/lib/decompress/huf_decompress.c.o.d -o CMakeFiles/libzstd_shared.dir/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/lib/decompress/huf_decompress.c.o -c /root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/lib/decompress/huf_decompress.c
/root/ros2_ws/build/zstd_vendor/zstd_vendor-prefix/src/zstd_vendor/lib/compress/zstd_compress_superblock.c:412:12: warning: variable 'litLengthSum' set but not used [-Wunused-but-set-variable]
  412 |     size_t litLengthSum = 0;
      |            ^

and the -Wno-unused-but-set-variable is there but it's not working. any other thoughts @clalancette ?

@clalancette
Copy link
Contributor

So I poked at this a bit. The problem is the way in which zstd constructs the command-line arguments in its CMake code. In particular, it puts -Wall -Wextra after any command-line arguments that the user provides via CMAKE_C_FLAGS, and thus even though we disable the warning with -Wno-unused-but-set-variable, it gets re-enabled by -Wall -Wextra.

I discussed this with @MichaelOrlov and @ahcorde , and we came to agreement to go back to patching the source code, which is the most reliable thing to do here. That is, we can change this PR back to 772aaaa , and go from there. @ahcorde I'll leave this to you to do.

@ahcorde ahcorde force-pushed the ahcorde/rolling/zstd_vendor_warning branch from d7ae34b to 772aaaa Compare April 23, 2024 16:30
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.

Looks good to me with green CI.

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

@ahcorde @clalancette I've just realized that instead of patching an old version of the zstd library we need to bump its version to the 1.5.5 which is going to be on noble https://packages.ubuntu.com/noble/zstd. And there this warning should already been fixed.

@MichaelOrlov
Copy link
Contributor

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde ahcorde changed the title Removed zstd_vendor warning Updated zstd to 1.5.5 Apr 23, 2024
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 23, 2024

@MichaelOrlov I updated to version 1.5.5 but there are two new warnings...

Copy link
Contributor

@MichaelOrlov MichaelOrlov left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaelOrlov
Copy link
Contributor

@ros-pull-request-builder retest this please

@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

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

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

  • Windows Build Status

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

  • Windows Build Status

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

  • Windows Build Status

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

  • Windows Build Status

Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

  • Windows Build Status

@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

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

@ahcorde ahcorde merged commit cb90408 into rolling Apr 24, 2024
13 of 14 checks passed
@ahcorde
Copy link
Contributor Author

ahcorde commented Apr 24, 2024

https://github.com/Mergifyio backport jazzy

Copy link

mergify bot commented Apr 24, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 24, 2024
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit cb90408)
@delete-merged-branch delete-merged-branch bot deleted the ahcorde/rolling/zstd_vendor_warning branch April 24, 2024 12:51
ahcorde added a commit that referenced this pull request Apr 24, 2024
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
(cherry picked from commit cb90408)

Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
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