Skip to content

Conversation

@cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Oct 24, 2025

Snap core18 is based on Ubuntu 18.04 and this version of Ubuntu LTS had already been reached EOL.
So, we need to upgrade from core18 to core20 that is based on Ubuntu 20.04.

This upgraded snapcraft can handle with snapcraft 8.x and succeeded to build with it:

% snapcraft 
Running snapcraft without a command will not be possible in future releases. Use 'snapcraft pack' instead.
Launching a VM.
Launched: snapcraft-fluent-bit
<snip>
Staging fluent-bit 
+ snapcraftctl stage
Priming fluent-bit 
+ snapcraftctl prime
Snapping |                                                                                         
Snapped fluent-bit_4.2.0_amd64.snap

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Summary by CodeRabbit

  • Chores
    • Upgraded snap base to core20 for improved stability, security, and long-term support
    • Updated app icon location and packaging so the UI uses the refreshed icon
    • Updated build tooling and libraries to ensure compatibility with modern environments
    • Refined runtime and installation paths and build configuration for improved system integration and execution safety

Signed-off-by: Hiroshi Hatake <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Oct 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Snap packaging updated: base switched to core20; command paths, config bind and icon path adjusted to new /usr-based layout; build and stage dependencies, cmake parameters, and build attributes were added/modified in snap/snapcraft.yaml.

Changes

Cohort / File(s) Summary
Metadata & base
snap/snapcraft.yaml
base changed from core18 to core20; icon path updated from ./fluent-bit.svg to gui/fluent-bit.svg.
Runtime commands & layout
snap/snapcraft.yaml
apps.service.command and apps.fluent-bit.command updated to use usr/bin/fluent-bit; config path and layout bind moved from $SNAP/etc/fluent-bit to $SNAP/usr/etc/fluent-bit.
Build config & cmake
snap/snapcraft.yaml
Added build-snaps: cmake/latest/stable; added cmake-parameters: -DCMAKE_INSTALL_PREFIX=/usr; added build-attributes: [keep-execstack].
Dependencies
snap/snapcraft.yaml
stage-packages changed: libssl-devlibssl1.1; libyaml-dev added (also added to build-packages).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Points to review:

  • Verify all paths referencing /usr and $SNAP/usr/etc/... are consistent and correct.
  • Confirm -DCMAKE_INSTALL_PREFIX=/usr and keep-execstack are appropriate for the snap's install location and security policy.
  • Validate libssl1.1 availability on core20 and intended runtime compatibility.
  • Check icon path gui/fluent-bit.svg is present in the snap tree.

Suggested reviewers

  • koleini
  • fujimotos

Poem

🐰
We hopped from core18 into core20 light,
Paths realigned, builds dressed up just right.
CMake hums, libs settle in the queue,
A tiny hop, a cleaner snap anew. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "snap: Upgrade snap from core18 to core20" directly corresponds to the primary change in the changeset, which is updating the snap base from core18 to core20. While the changeset includes multiple related updates to the snapcraft configuration (build-snaps, stage-packages, cmake-parameters, paths, and layouts), these are all supportive changes necessary to make the snap compatible with the core20 base and snapcraft 8.x. The title clearly highlights the most important and foundational change that drove this update, which according to the PR objectives is the core18 end-of-life migration. The title is concise, specific, and does not include extraneous information.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cosmo0920-upgrade-snap20

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ea4df4 and 16a6b97.

📒 Files selected for processing (1)
  • snap/snapcraft.yaml (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • snap/snapcraft.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_ARROW=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_COVERAGE=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, gcc, g++)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cosmo0920 cosmo0920 changed the title snap: Upgrade snap core20 snap: Upgrade snap from core18 to core20 Oct 24, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
snap/snapcraft.yaml (1)

14-18: Potential path mismatch between config binding and installation location.

The read-config plug at line 18 reads from $SNAP/etc/fluent-bit, and the layout binding at line 70-71 binds /etc/fluent-bit to $SNAP/etc/fluent-bit. However, the service command at line 22 specifies $SNAP/usr/etc/fluent-bit/fluent-bit.conf. This mismatch means the config file may not be accessible via the expected path.

Verify that:

  1. Config files are installed to /usr/etc/fluent-bit (due to CMAKE_INSTALL_PREFIX=/usr)
  2. The layout binding and read-config plug are updated to reference the correct path: $SNAP/usr/etc/fluent-bit
#!/bin/bash
# Description: Verify the configuration file location after snap installation
# This script checks where CMakeLists.txt installs fluent-bit config files

# Search for install commands related to fluent-bit config files
rg -n "install.*fluent-bit\.conf|install.*etc.*fluent-bit" --type cmake

Also applies to: 22-22, 69-71

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6345fd1 and 4ea4df4.

⛔ Files ignored due to path filters (1)
  • snap/gui/fluent-bit.svg is excluded by !**/*.svg
📒 Files selected for processing (1)
  • snap/snapcraft.yaml (4 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-31T12:46:11.940Z
Learnt from: ThomasDevoogdt
PR: fluent/fluent-bit#9277
File: .github/workflows/pr-compile-check.yaml:147-151
Timestamp: 2025-08-31T12:46:11.940Z
Learning: In fluent-bit CMakeLists.txt, the system library preference flags are defined as FLB_PREFER_SYSTEM_LIB_ZSTD and FLB_PREFER_SYSTEM_LIB_KAFKA with the FLB_ prefix.

Applied to files:

  • snap/snapcraft.yaml
📚 Learning: 2025-08-31T12:46:11.940Z
Learnt from: ThomasDevoogdt
PR: fluent/fluent-bit#9277
File: .github/workflows/pr-compile-check.yaml:147-151
Timestamp: 2025-08-31T12:46:11.940Z
Learning: In fluent-bit, the correct CMake flag for using system librdkafka is `FLB_PREFER_SYSTEM_LIB_KAFKA=ON`.

Applied to files:

  • snap/snapcraft.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SIMD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_COVERAGE=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_ARROW=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_THREAD=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SANITIZE_MEMORY=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_UNDEFINED=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=Off, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, clang, clang++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_JEMALLOC=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DSANITIZE_ADDRESS=On, 3.31.6, gcc, g++)
  • GitHub Check: run-ubuntu-unit-tests (-DFLB_SMALL=On, 3.31.6, gcc, g++)
🔇 Additional comments (5)
snap/snapcraft.yaml (5)

2-2: Base upgrade to core20 is necessary and appropriate.

The upgrade from core18 (Ubuntu 18.04) to core20 (Ubuntu 20.04) is required as core18 has reached end-of-life. This is a valid change.


67-67: Verify the purpose and necessity of the keep-execstack build attribute.

The keep-execstack build attribute was added but lacks documentation. This attribute instructs snapcraft to preserve the executable stack, which is sometimes required for certain compiled code but can have security implications.

Verify that this attribute is necessary and document why it's needed (e.g., specific library requirements, JIT compilation, etc.).


10-10: Icon path verified—no issues found.

The icon file exists at the expected location. The file ./snap/gui/fluent-bit.svg is correctly referenced by the gui/fluent-bit.svg path in snap/snapcraft.yaml.


42-44: Libssl1.1 compatibility confirmed for Ubuntu 20.04.

libssl1.1 is available in Ubuntu 20.04 (Focal) main repositories (including updates/security). The package configuration is correct: libssl1.1 in stage-packages (runtime library) and libssl-dev in build-packages (development headers). The addition of libyaml-dev for core20 compatibility is appropriate.


22-22: The command paths in snapcraft.yaml are correctly configured and no changes are needed.

The verification confirms that when CMAKE_INSTALL_PREFIX=/usr is set, FLB_INSTALL_BINDIR resolves to ${CMAKE_INSTALL_FULL_BINDIR}, which evaluates to /usr/bin. The binary is therefore installed to /usr/bin/fluent-bit, and the snapcraft.yaml entries at lines 22 and 30 correctly reference this with the relative path usr/bin/fluent-bit (which expands to $SNAP/usr/bin/fluent-bit in the snap environment).

Signed-off-by: Hiroshi Hatake <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant