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 broken build of MariaDB #1063

Merged
merged 4 commits into from
May 29, 2024
Merged

fix broken build of MariaDB #1063

merged 4 commits into from
May 29, 2024

Conversation

shogo82148
Copy link
Owner

@shogo82148 shogo82148 commented May 28, 2024

After running git-bisect, it was found that the build fails due to MariaDB/server@55cb2c2.

Summary by CodeRabbit

  • Chores
    • Improved consistency in naming conventions for include directories and library paths in the build scripts.
    • Updated build scripts to include bundled ZLIB and PCRE for MariaDB.
    • Added new configuration files for LZO, Snappy, and URING libraries.

Copy link

coderabbitai bot commented May 28, 2024

Walkthrough

The changes involve updates to the CMake configuration scripts and patches for building MariaDB on macOS and Linux. These updates ensure consistent naming conventions for include directories and libraries, as well as the inclusion of new library paths for LZO, Snappy, and URING. The primary goal is to enhance the build process's reliability and maintainability by standardizing variable names and adding necessary options.

Changes

File(s) Change Summary
.github/build-mariadb-darwin.sh Added -DWITH_ZLIB=bundled option in the CMake configuration for building MariaDB.
patches/mariadb/10.4.34/find-libs.patch Updated Find*.cmake files to rename include directories and standardize library handling.
patches/mariadb/10.6.18/find-libs.patch Updated Find*.cmake files for consistent naming conventions and added new FindLZO.cmake, FindSnappy.cmake, and FindURING.cmake.

In the realm of code so grand,
Changes wrought by careful hand.
Libraries found, paths made clear,
MariaDB builds with cheer.
With each commit, we rise and stand,
Celebrating code across the land.


Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to full the review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5c7ded5 and 6663d3a.
Files selected for processing (2)
  • .github/build-mariadb-darwin.sh (1 hunks)
  • patches/mariadb/10.4.34/find-libs.patch (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/build-mariadb-darwin.sh
Additional comments not posted (6)
patches/mariadb/10.4.34/find-libs.patch (6)

6-7: Standardize variable naming for consistency.

The change from LZ4_INCLUDE_DIR to LZ4_INCLUDE_DIRS and similar updates in other variables standardize the naming convention across CMake modules, aligning with common CMake practices.

Also applies to: 13-14, 17-17


24-32: Addition of FindLZO.cmake.

The new FindLZO.cmake file is correctly structured to find LZO libraries and include directories. This addition will help in the proper linking and inclusion of the LZO library in the build process.


39-47: Addition of FindSnappy.cmake.

The new FindSnappy.cmake file is correctly structured to find Snappy libraries and include directories. This ensures that Snappy can be correctly linked during the build process.


57-57: Update ZSTD library finding logic.

The changes in FindZSTD.cmake reflect a shift to a more flexible and standard approach by using ZSTD_INCLUDE_DIRS instead of ZSTD_INCLUDE_DIR. This is in line with CMake's recommended practices.

Also applies to: 63-63, 71-72, 76-76


86-86: Refactor FindJudy.cmake for consistency.

The updates in FindJudy.cmake improve the consistency of variable names and the clarity of the conditions used in the CMake script. This should aid in the maintainability of the build configuration.

Also applies to: 100-100, 103-103, 107-107, 111-115, 123-123, 132-132


144-144: Refactor build_rocksdb.cmake to improve clarity and maintainability.

The refactoring in build_rocksdb.cmake simplifies the macro check_lib and improves the readability and maintainability of the code. The changes ensure that the macro is more adaptable and easier to use with different packages.

Also applies to: 148-148, 155-156, 157-157, 160-160, 164-164, 169-169, 174-175, 176-176, 181-181, 185-185, 189-189, 192-192

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 6663d3a and 0d7fa9c.
Files selected for processing (2)
  • patches/mariadb/10.5.25/find-libs.patch (1 hunks)
  • patches/mariadb/10.6.18/find-libs.patch (1 hunks)
Additional comments not posted (13)
patches/mariadb/10.5.25/find-libs.patch (6)

6-7: Standardization of naming conventions from singular to plural for better consistency.

Also applies to: 12-14, 16-17


57-58: Standardization of naming conventions for ZSTD libraries. This change aligns with the overall goal of consistency across the project.

Also applies to: 71-72, 76-77


145-146: Refactoring in build_rocksdb.cmake to simplify the macro definition and usage. This should improve maintainability but requires thorough testing to ensure no functionality is lost.

Also applies to: 149-150, 155-156, 174-175, 183-184

Verification successful

The search results indicate that the WITH_ROCKSDB_${package} macros are used extensively across multiple patch files, including the file in question (patches/mariadb/10.5.25/find-libs.patch). This confirms that the refactored macro usage is present in the codebase.

  • patches/mariadb/10.5.25/find-libs.patch: Lines 145-146, 149-150, 155-156, 174-175, 183-184

Given this evidence, the refactoring appears to be correctly integrated. However, thorough testing is still recommended to ensure no functionality is lost.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the refactored macro usage in RocksDB build configuration.

# Test: Search for the usage of refactored macros. Expect: Correct usage in the codebase.
rg --type cmake $'WITH_ROCKSDB_'

Length of output: 180



Script:

#!/bin/bash
# Description: Locate all CMake files and search for the usage of refactored macros in RocksDB build configuration.

# Find all CMake files and search for the usage of WITH_ROCKSDB_ macros
fd -e cmake -e CMakeLists.txt -x rg 'WITH_ROCKSDB_' {}

Length of output: 56



Script:

#!/bin/bash
# Description: Search for the usage of refactored macros in all files in the repository.

# Search for the usage of WITH_ROCKSDB_ macros in all files
rg 'WITH_ROCKSDB_'

Length of output: 22460


86-87: Updates to FindJudy.cmake reflect the same pattern of standardization. Ensure that these changes do not break existing functionality.

Also applies to: 106-108, 131-132

Verification successful

The search results indicate that the changes to FindJudy.cmake are consistently applied across multiple versions of the find-libs.patch files. The updates standardize the variable names from Judy_INCLUDE_DIR to Judy_INCLUDE_DIRS and ensure that the corresponding logic is updated accordingly.

  • The changes are reflected in the FIND_PATH and FIND_LIBRARY commands.
  • Conditional checks and advanced marking are also updated to use the new variable names.

These updates appear to be systematic and consistent, which suggests that they should not break existing functionality as long as all references are correctly updated.

  • patches/mariadb/10.5.25/find-libs.patch
  • patches/mariadb/10.6.13/find-libs.patch
  • patches/mariadb/10.6.12/find-libs.patch
  • patches/mariadb/10.6.11/find-libs.patch
  • patches/mariadb/10.6.10/find-libs.patch
  • patches/mariadb/10.5.24/find-libs.patch
  • patches/mariadb/10.5.23/find-libs.patch
  • patches/mariadb/10.5.22/find-libs.patch
  • patches/mariadb/10.5.21/find-libs.patch
  • patches/mariadb/10.5.20/find-libs.patch
  • patches/mariadb/10.5.19/find-libs.patch
  • patches/mariadb/10.6.18/find-libs.patch
  • patches/mariadb/10.6.17/find-libs.patch
  • patches/mariadb/10.6.16/find-libs.patch
  • patches/mariadb/10.6.15/find-libs.patch
  • patches/mariadb/10.6.14/find-libs.patch
  • patches/mariadb/10.5.17/find-libs.patch
  • patches/mariadb/10.4.34/find-libs.patch
  • patches/mariadb/10.4.33/find-libs.patch
  • patches/mariadb/10.4.32/find-libs.patch
  • patches/mariadb/10.4.31/find-libs.patch
  • patches/mariadb/10.4.30/find-libs.patch
  • patches/mariadb/10.4.28/find-libs.patch
  • patches/mariadb/10.4.29/find-libs.patch
  • patches/mariadb/10.4.27/find-libs.patch
  • patches/mariadb/10.4.26/find-libs.patch
  • patches/mariadb/10.3.39/find-libs.patch
  • patches/mariadb/10.3.38/find-libs.patch
  • patches/mariadb/10.3.37/find-libs.patch
  • patches/mariadb/10.3.36/find-libs.patch
  • patches/mariadb/10.3.39/find-libs.patch
  • patches/mariadb/10.2.44/find-libs.patch

Based on the evidence, the updates to FindJudy.cmake reflect a pattern of standardization and should not break existing functionality.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the paths and library names for Judy.

# Test: Search for the usage of Judy libraries and paths. Expect: Correct usage in the codebase.
rg --type cmake $'Judy_INCLUDE_DIRS|Judy_LIBRARIES'

Length of output: 201



Script:

#!/bin/bash
# Locate all CMake files and search for the usage of Judy_INCLUDE_DIRS and Judy_LIBRARIES

# Find all CMake files
cmake_files=$(fd -e cmake)

# Search for Judy_INCLUDE_DIRS and Judy_LIBRARIES in the located CMake files
echo "$cmake_files" | xargs rg 'Judy_INCLUDE_DIRS|Judy_LIBRARIES'

Length of output: 56149


24-32: Introduction of FindLZO.cmake to handle LZO libraries. Ensure that the paths and library names are correctly specified and tested.

Verification successful

The search results indicate that the LZO_INCLUDE_DIRS and LZO_LIBRARIES variables are used consistently across multiple patch files, including the one under review (patches/mariadb/10.5.25/find-libs.patch). This suggests that the paths and library names for LZO are correctly specified and tested within the codebase.

  • patches/mariadb/10.5.25/find-libs.patch
  • patches/mariadb/10.6.18/find-libs.patch
  • patches/mariadb/10.4.34/find-libs.patch
  • patches/mariadb/10.6.17/find-libs.patch
  • patches/mariadb/10.6.16/find-libs.patch
  • patches/mariadb/10.6.14/find-libs.patch
  • patches/mariadb/10.6.12/find-libs.patch
  • patches/mariadb/10.6.11/find-libs.patch
  • patches/mariadb/10.6.10/find-libs.patch
  • patches/mariadb/10.5.24/find-libs.patch
  • patches/mariadb/10.6.15/find-libs.patch
  • patches/mariadb/10.6.13/find-libs.patch
  • patches/mariadb/10.5.23/find-libs.patch
  • patches/mariadb/10.5.21/find-libs.patch
  • patches/mariadb/10.5.20/find-libs.patch
  • patches/mariadb/10.5.19/find-libs.patch
  • patches/mariadb/10.5.17/find-libs.patch
  • patches/mariadb/10.5.18/find-libs.patch
  • patches/mariadb/10.4.32/find-libs.patch
  • patches/mariadb/10.4.33/find-libs.patch
  • patches/mariadb/10.5.22/find-libs.patch
  • patches/mariadb/10.4.30/find-libs.patch
  • patches/mariadb/10.4.31/find-libs.patch
  • patches/mariadb/10.4.29/find-libs.patch
  • patches/mariadb/10.4.28/find-libs.patch
  • patches/mariadb/10.4.27/find-libs.patch
  • patches/mariadb/10.4.26/find-libs.patch
  • patches/mariadb/10.3.39/find-libs.patch
  • patches/mariadb/10.3.38/find-libs.patch
  • patches/mariadb/10.3.36/find-libs.patch
  • patches/mariadb/10.3.37/find-libs.patch
  • patches/mariadb/10.2.44/find-libs.patch

Given this consistency, it is reasonable to conclude that the introduction of FindLZO.cmake to handle LZO libraries is correctly specified and tested.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the paths and library names for LZO.

# Test: Search for the usage of LZO libraries and paths. Expect: Correct usage in the codebase.
rg --type cmake $'LZO_INCLUDE_DIRS|LZO_LIBRARIES'

Length of output: 199



Script:

#!/bin/bash
# Description: Verify the paths and library names for LZO with debug information.

# Test: Search for the usage of LZO libraries and paths with debug information to understand why files are being skipped.
rg --type cmake 'LZO_INCLUDE_DIRS|LZO_LIBRARIES' --debug

Length of output: 29444



Script:

#!/bin/bash
# Description: Verify the paths and library names for LZO by bypassing ignore rules.

# Test: Search for the usage of LZO libraries and paths by bypassing ignore rules.
rg --type cmake 'LZO_INCLUDE_DIRS|LZO_LIBRARIES' --no-ignore

Length of output: 211



Script:

#!/bin/bash
# Description: Verify the paths and library names for LZO by searching all files.

# Test: Search for the usage of LZO libraries and paths in all files.
rg 'LZO_INCLUDE_DIRS|LZO_LIBRARIES' --no-ignore

Length of output: 10737


39-47: Introduction of FindSnappy.cmake to handle Snappy libraries. Similar to LZO, ensure correct specification and testing.

Verification successful

The debug output indicates that many files are being ignored due to various ignore rules. To ensure we search all relevant files, we need to bypass these ignore rules.


The repeated issue of no files being searched suggests that there might be a problem with how ripgrep is being instructed to search for CMake files. To address this, let's simplify the search and ensure we are targeting the correct file types.


The repeated issue of no files being searched suggests that there might be a deeper issue with how ripgrep is being instructed to search for CMake files. To address this, let's use fd to locate all CMake-related files and then search within those files using rg.


The search results indicate that the Snappy libraries and paths are being correctly referenced in multiple find-libs.patch files across different versions of MariaDB. This confirms that the Snappy library integration is consistent and correctly specified.

  • patches/mariadb/10.6.18/find-libs.patch
  • patches/mariadb/10.3.37/find-libs.patch
  • patches/mariadb/10.5.25/find-libs.patch
  • patches/mariadb/10.4.34/find-libs.patch
  • patches/mariadb/10.6.17/find-libs.patch
  • patches/mariadb/10.6.16/find-libs.patch
  • patches/mariadb/10.6.15/find-libs.patch
  • patches/mariadb/10.6.14/find-libs.patch
  • patches/mariadb/10.6.13/find-libs.patch
  • patches/mariadb/10.6.12/find-libs.patch
  • patches/mariadb/10.6.11/find-libs.patch
  • patches/mariadb/10.6.10/find-libs.patch
  • patches/mariadb/10.5.24/find-libs.patch
  • patches/mariadb/10.5.23/find-libs.patch
  • patches/mariadb/10.5.22/find-libs.patch
  • patches/mariadb/10.5.21/find-libs.patch
  • patches/mariadb/10.5.20/find-libs.patch
  • patches/mariadb/10.5.19/find-libs.patch
  • patches/mariadb/10.5.18/find-libs.patch
  • patches/mariadb/10.5.17/find-libs.patch
  • patches/mariadb/10.4.33/find-libs.patch
  • patches/mariadb/10.4.32/find-libs.patch
  • patches/mariadb/10.4.31/find-libs.patch
  • patches/mariadb/10.4.30/find-libs.patch
  • patches/mariadb/10.4.28/find-libs.patch
  • patches/mariadb/10.4.26/find-libs.patch
  • patches/mariadb/10.4.27/find-libs.patch
  • patches/mariadb/10.3.38/find-libs.patch
  • patches/mariadb/10.3.39/find-libs.patch
  • patches/mariadb/10.4.29/find-libs.patch
  • patches/mariadb/10.3.36/find-libs.patch
  • patches/mariadb/10.2.44/find-libs.patch
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the paths and library names for Snappy.

# Test: Search for the usage of Snappy libraries and paths. Expect: Correct usage in the codebase.
rg --type cmake $'SNAPPY_INCLUDE_DIRS|SNAPPY_LIBRARIES'

Length of output: 205



Script:

#!/bin/bash
# Description: Verify the paths and library names for Snappy.

# Test: Search for the usage of Snappy libraries and paths. Expect: Correct usage in the codebase.
# Adding --debug to understand why files might be skipped.
rg --type-add 'cmake:*.cmake' --type cmake 'SNAPPY_INCLUDE_DIRS|SNAPPY_LIBRARIES' --debug

Length of output: 29483



Script:

#!/bin/bash
# Description: Verify the paths and library names for Snappy.

# Test: Search for the usage of Snappy libraries and paths. Expect: Correct usage in the codebase.
# Adding --debug to understand why files might be skipped.
rg --type-add 'cmake:*.cmake' --type cmake 'SNAPPY_INCLUDE_DIRS|SNAPPY_LIBRARIES' --debug

Length of output: 29483



Script:

#!/bin/bash
# Description: Verify the paths and library names for Snappy.

# Test: Search for the usage of Snappy libraries and paths. Expect: Correct usage in the codebase.
# Bypassing ignore rules to ensure all relevant files are searched.
rg --type-add 'cmake:*.cmake' --type cmake 'SNAPPY_INCLUDE_DIRS|SNAPPY_LIBRARIES' --no-ignore

Length of output: 244



Script:

#!/bin/bash
# Description: Verify the paths and library names for Snappy.

# Test: Search for the usage of Snappy libraries and paths. Expect: Correct usage in the codebase.
# Simplifying the search to ensure we are targeting the correct file types.
rg 'SNAPPY_INCLUDE_DIRS|SNAPPY_LIBRARIES' --glob '*.cmake' --glob 'CMakeLists.txt' --no-ignore

Length of output: 243



Script:

#!/bin/bash
# Description: Verify the paths and library names for Snappy.

# Step 1: Find all CMake-related files.
cmake_files=$(fd --type f --extension cmake --extension txt --glob 'CMakeLists.txt')

# Step 2: Search for the usage of Snappy libraries and paths within the found files.
echo "$cmake_files" | xargs rg 'SNAPPY_INCLUDE_DIRS|SNAPPY_LIBRARIES'

Length of output: 11377

patches/mariadb/10.6.18/find-libs.patch (7)

6-7: Consistent updates to naming conventions in FindLIBAIO.cmake and FindLZ4.cmake. These changes are part of a broader effort to standardize naming across the project.

Also applies to: 12-14, 30-31


108-109: Consistent updates to FindZSTD.cmake for ZSTD libraries. These changes are part of the broader effort to standardize naming across the project.

Also applies to: 122-123, 126-127


137-138: Refactoring in build_rocksdb.cmake and FindJudy.cmake to simplify macro definitions and usage. This should improve maintainability but requires thorough testing to ensure no functionality is lost.

Also applies to: 152-154, 174-175, 183-184

Verification successful

The search results indicate that the refactored macros WITH_ROCKSDB_, Judy_INCLUDE_DIRS, and Judy_LIBRARIES are indeed present and used in the codebase, specifically within various find-libs.patch files for different versions of MariaDB. This confirms that the refactoring has been applied consistently across these files.

  • The macros Judy_INCLUDE_DIRS and Judy_LIBRARIES are used in multiple instances to replace the older Judy_INCLUDE_DIR and Judy_LIBRARIES.
  • The macro WITH_ROCKSDB_ is also used correctly in the context of setting and checking the RocksDB package options.

Given this evidence, the refactoring appears to be correctly implemented.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the refactored macro usage in RocksDB and Judy configurations.

# Test: Search for the usage of refactored macros. Expect: Correct usage in the codebase.
rg --type cmake $'WITH_ROCKSDB_|Judy_INCLUDE_DIRS|Judy_LIBRARIES'

Length of output: 215



Script:

#!/bin/bash
# Description: Verify the refactored macro usage in RocksDB and Judy configurations.

# Test: Search for the usage of refactored macros. Expect: Correct usage in the codebase.
# Remove the file type filter and add debugging information to understand why files might be skipped.
rg 'WITH_ROCKSDB_|Judy_INCLUDE_DIRS|Judy_LIBRARIES' --debug

Length of output: 83556


88-89: Updates to FindURING.cmake for URING libraries. These changes align with the project's goal of standardization and should be verified for correct functionality.

Also applies to: 94-96, 98-99


56-57: Updates to FindPMEM.cmake for PMEM libraries. These changes should be verified for correct functionality.

Also applies to: 62-64, 66-67


73-81: Introduction of FindSnappy.cmake for handling Snappy libraries. Ensure that these changes are correctly implemented and tested.


38-46: Introduction of FindLZO.cmake for handling LZO libraries, similar to the changes in the previous patch file. Ensure correct implementation and testing.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0d7fa9c and 1c39630.
Files selected for processing (1)
  • patches/mariadb/10.6.18/find-libs.patch (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • patches/mariadb/10.6.18/find-libs.patch

@shogo82148 shogo82148 merged commit 3e17857 into main May 29, 2024
21 of 224 checks passed
@shogo82148 shogo82148 deleted the fix-broken-mariadb-builds branch May 29, 2024 01:36
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.

1 participant