Skip to content

Fix man pages symlink during brew install#47

Merged
austin-denoble merged 1 commit intomainfrom
adenoble/fix-man-alias-install
Oct 9, 2025
Merged

Fix man pages symlink during brew install#47
austin-denoble merged 1 commit intomainfrom
adenoble/fix-man-alias-install

Conversation

@austin-denoble
Copy link
Collaborator

Problem

Tested the brew -> man pages installation flow (defined in .goreleaser.yaml). The regular man pages for man pc work as expected after upgrading, but man pinecone does not.

Solution

Tweak the brew install code in goreleaser config to properly alias pinecone => pc. Instead of duplicating files, use install_symlink, and iterate over the already installed man pages for pc.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Re-release, upgrade, and see if installation ran.

@claude
Copy link

claude bot commented Oct 9, 2025

Claude finished @austin-denoble's task —— View job


Code Review Complete ✅

I've analyzed the changes in .goreleaser.yaml for the man pages symlink fix. Here's my comprehensive review:

Tasks

  • Analyze the .goreleaser.yaml changes
  • Review code quality and best practices
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Review test coverage implications
  • Provide comprehensive feedback

🔍 Code Quality & Best Practices

✅ Excellent improvements:

  • Proper symlink usage: Switching from man1.install to man1.install_symlink is the correct approach for creating aliases
  • Path optimization: Using Dir[man1/"pc*.1"] instead of Dir["man/man1/*.1"] is more efficient and safer
  • Clean Ruby code: The Homebrew formula syntax is idiomatic and follows Ruby best practices

🐛 Potential Issues Analysis

✅ No bugs identified - The changes are solid:

  1. Path handling: .goreleaser.yaml:98 - The new Dir[man1/"pc*.1"] correctly uses the man1 variable which points to the installed man1 directory, avoiding hardcoded paths
  2. Symlink creation: .goreleaser.yaml:100 - man1.install_symlink src => dest is the proper Homebrew way to create symbolic links
  3. Regex pattern: The sub(/\Apc\b/, "pinecone") regex correctly replaces only the leading "pc" word boundary

⚡ Performance Considerations

✅ Performance improved:

  • Reduced disk usage: Symlinks consume minimal disk space compared to file duplication
  • Faster installation: Creating symlinks is faster than copying files
  • Efficient globbing: The new glob pattern pc*.1 is more specific and faster than *.1

🔒 Security Assessment

✅ No security concerns:

  • Safe path operations: Using Homebrew's built-in man1 variable prevents path traversal issues
  • Proper symlink creation: install_symlink is Homebrew's secure method for creating links
  • No external dependencies: Changes are self-contained within the GoReleaser configuration

🧪 Test Coverage Implications

⚠️ Testing considerations:

  • Manual verification needed: The PR mentions "Re-release, upgrade, and see if installation ran" - this is reasonable for Homebrew formula changes
  • Consider adding: A simple test to verify man pinecone works after brew install (though this would require actual Homebrew testing infrastructure)
  • Current test coverage: The existing system "#{bin}/pc --help" test in .goreleaser.yaml:89 covers the binary but not man pages

📝 Summary

This is a high-quality fix that addresses the root cause effectively:

  • Problem solved: The issue where man pinecone didn't work after brew install is properly addressed
  • Implementation: Clean, efficient, and follows Homebrew best practices
  • Risk: Very low - the changes are minimal and use standard Homebrew patterns

Recommendation: ✅ Approve - This PR is ready to merge. The symlink approach is the correct solution and the implementation is solid.


@austin-denoble austin-denoble merged commit a44fc31 into main Oct 9, 2025
5 checks passed
@austin-denoble austin-denoble deleted the adenoble/fix-man-alias-install branch October 9, 2025 07:00
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