Repository navigation
Conversation
Adds HomebrewFormula/fluent-package.rb, a formula that installs the gem set locked by a fluent-package release tag from local gem archives, on Homebrew's ruby@3.4 with Homebrew's own libraries. The four commands (fluentd, fluent-gem, fluent-cat, td) are wrappers that keep configuration, logs and user-installed plugins outside the Cellar so they survive brew upgrade/uninstall, and Name Status User File emacs none unbound none manages fluentd through a launchd job. homebrew/update_formula.rb regenerates the formula's gem resource blocks from a release tag's fluent-package/Gemfile.lock, choosing arm64-darwin .gem platform builds where published; its --check mode guards against the formula drifting from the newest tag. HomebrewFormula/README.md documents usage and formula maintenance. Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen-3.8-Flash-Next [OpenCode]
Installs on Apple Silicon Macs are documented in the root README and in HomebrewFormula/README.md. The workflow runs brew style/audit/ install/test and a brew services round trip on a macos-14 runner, plus a scheduled check that flags upstream releases whose gem set the formula has not picked up yet; it never writes to the repository. Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen-3.8-Flash-Next [OpenCode]
Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: GPT-6.1 Sol [Codex]
- cmetrics: add a checksummed Homebrew resource for the calyptia/cmetrics C sources and repack the gem (gem unpack + inreplace + gem build) so mini_portile reads the mirrored tarball via file:// instead of hitting GitHub during the build; `gem install --local` is then actually true end to end - user gems live in var/fluent/gems/<ruby ABI>; entries of the old unversioned layout are migrated at install, gems from other ABIs are never loaded, and post_install explains how to recover them - regenerate resources with nokogiri excluded (Windows-only Gemfile entry; nothing on macOS uses it) - update_formula.rb: parse GIT lock entries and verify via the GitHub API (cached) that the locked revision of fluentd is exactly the tag of the gem the formula installs; annotate and abort on mismatch - do not clobber user-edited etc/fluent/fluentd.conf on reinstall (Pathname#install moves over existing files) - formula: sorbet sigil + class doc, service/caveats text, aligned write_env_script arguments (brew audit --strict) - README/CI: match the ABI gem layout, the verified git sourcing and the offline guarantee; drop nokogiri from the native-load check Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen-3.8-Flash-Next [OpenCode]
Formula#etc is extended with Homebrew's InstallRenamed module, and the extension propagates through `+` and `/`; the previous assumption that Pathname#install would clobber an existing config was wrong. A temp-dir reproduction with the real extended paths (Homebrew 7.0.10) shows the standard conffile behaviour: no file -> installed, identical file -> left alone, user-modified file -> kept, with the new default installed as fluentd.conf.default. Reverting to the plain etc.install therefore keeps user edits and follows Homebrew conventions instead of hand-rolling an existence check. Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen-3.8-Flash-Next [OpenCode]
Moving everything found directly in var/fluent/gems into the current ABI directory during install was wrong on several counts: it treated native extensions built for an older Ruby as belonging to the new ABI, it could collide with directories already present in the destination, and the install step moved user data directly. Leave every pre-existing entry where it is instead; GEM_HOME/GEM_PATH point at the ABI-specific directory only, so those gems are kept but never loaded, and the recovery path is a plain `fluent-gem install` (documented in the README, in caveats and in the stale-gem notice, which now also lists the pre-namespacing layout entries). Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen-3.8-Flash-Next [OpenCode]
Corrections found while re-checking the previous round's statements: - fluentd git lock: what update_formula.rb verifies is that the locked revision equals the commit the release tag points at; the published .gem's content is not compared against that revision. README, the generator comments and the update instructions now say so. - rdkafka: the 0.27.0 binary gem the formula installs embeds librdkafka 2.14.0 (the version rdkafka 0.27.0's own version.rb targets), not 2.8.0 as previously written; byte-identity with the .dmg's copy was never checked and is now stated as unverified. - google-protobuf/Ruby: quote the checked gemspec range (required_ruby_version < 3.5.dev for the 4.32.1 arm64-darwin gem) instead of a bare assertion. - offline build: record how it was verified (brew reinstall succeeds with the build-phase network blocked via Homebrew's standard HOMEBREW_FORMULA_BUILD_NETWORK=deny; the unpatched cmetrics gem fails that build with a codeload.github.com connection attempt), note that Homebrew 7 allows build-phase network by default, and list the exact upstream 0.3.3 strings the repack's inreplace calls depend on. - CI: the workflow is defined but has not executed on GitHub; what ran is the local equivalents (listed). Persistence checks are same-version reinstall, not a cross-version upgrade. Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen-3.8-Flash-Next [OpenCode]
Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: GPT-6.1 Sol [Codex]
Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: GPT-6.1 Sol [Codex]
Homebrew's Homebrew/NoFileutilsRmrf cop includes only files under a directory literally named Formula/ (or Casks/), so it did not apply while the formula lived in HomebrewFormula/ but does now. rm_rf is the FileUtils.rm_rf that Formula gets from include FileUtils; the safer rm_r is equivalent here because the paths come from a Dir.glob of paths that exist at that moment. Signed-off-by: Takuro Ashie <ashie@clear-code.com> Assisted-by: Qwen3.8-Flash-Next [OpenCode]
Homebrew discovers tap formulae only under a top-level Formula/ or
HomebrewFormula/ directory (or bare *.rb at the tap root), so after the
move to homebrew/Formula/ a `brew tap` of this repository exposed
nothing and the README's tap install instructions failed. Add the
conventional top-level Formula symlink to homebrew/Formula (the files
themselves stay under homebrew/), and note the constraint in
homebrew/README.md. Verified against a tap clone of this branch: the
formula is discovered ("1 formula") and style/audit inspect it; CI's
copied temp tap keeps working unchanged. Beware that without a
discoverable formula, `brew style`/`audit` of the tap name silently
inspect zero files and exit 0.
Signed-off-by: Takuro Ashie <ashie@clear-code.com>
Assisted-by: Qwen3.8-Flash-Next [OpenCode]
Member
Author
|
My proposal is to target the upcoming 6.1.0 release rather than 6.0.5. After 6.1.0 is released, I plan to rebase this work onto the 6.1.0 branch and update the formula for that release. I’d also like to add Homebrew installation instructions to the download site, so users can install directly from the tap without a separate Homebrew binary package. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Homebrew formula and its supporting files are now in place. Before merging, review the overall implementation for long-term maintainability and compatibility with Homebrew’s tap conventions.
brew tapandbrew installcommands. Homebrew scans the tap root’sFormula/andHomebrewFormula/directories; the current formula is underhomebrew/Formula/, and CI copies it into a temporary tap’sFormula/, so the workflow may not catch a discovery problem.brew servicesbehavior and the launchd configuration.Assisted-by: Qwen3.8-Flash-Next [OpenCode]
Assisted-by: GPT-6.1 Sol [Codex]