Skip to content

Add bazel-compile-commands#221

Merged
koralowiec merged 2 commits into
devcontainers-extra:mainfrom
sudhanvas:add-bazel-compile-commands
May 17, 2026
Merged

Add bazel-compile-commands#221
koralowiec merged 2 commits into
devcontainers-extra:mainfrom
sudhanvas:add-bazel-compile-commands

Conversation

@sudhanvas
Copy link
Copy Markdown
Contributor

Add bazel-compile-commands feature

Adds a new devcontainer feature that installs bazel-compile-commands, a tool that generates compile_commands.json from Bazel builds to enable accurate code intelligence (go-to-definition, cross-references, diagnostics) in LSP-aware editors.

Install behavior

The feature selects the best available package for the environment automatically:

Environment Package
Ubuntu Noble (24.04) Native .deb via apt-get
Other Linux Generic .zip (amd64 or arm64)
macOS Universal .zip

Testing

Tested locally with just test bazel-compile-commands:

================== TEST REPORT ==================
✅ Passed:      'test'
✅ Passed:      'test_specific_version'
✅ Passed:      'test_debian'

#AI_ASSISTED_CODE: Collaborated with Claude Code in VS Code to create the changes in this PR.

Copy link
Copy Markdown
Member

@koralowiec koralowiec left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for your PR, I left some comments. Generally, to keep the project more maintainable we tend to reuse the installation patters which we have and limit the number of the special cases, therefore I suggest to only install the stuff from GitHub Releases in this case.

Comment thread src/bazel-compile-commands/devcontainer-feature.json Outdated
Comment thread src/bazel-compile-commands/install.sh Outdated
Comment thread src/bazel-compile-commands/install.sh Outdated
Comment thread src/bazel-compile-commands/install.sh Outdated
Comment thread src/bazel-compile-commands/library_scripts.sh
@sudhanvas sudhanvas requested a review from koralowiec May 17, 2026 15:12
@sudhanvas
Copy link
Copy Markdown
Contributor Author

sudhanvas commented May 17, 2026

Thanks for the feedback!

Changes applied

  • library_scripts.sh replaced with the standard template
  • install.sh rewritten to use nanolayer/gh-release, removing the Noble .deb branch, macOS support, and all custom helpers
  • Description in devcontainer-feature.json simplified
  • One thing worth noting: upstream uses a non-standard tag format (bazel-compile-commands-v0.22.4 instead of the conventional v0.22.4). Nanolayer's resolver only tries exact and v-prefixed matches, so a plain "0.22.4" version would silently fall through. I added a small normalisation step in install.sh that converts the user-supplied version to the full tag format before passing it to nanolayer — releaseTagRegex alone wasn't enough to handle this.

Testing

Tested locally with just test bazel-compile-commands:

================== TEST REPORT ==================
✅ Passed:      'test'
✅ Passed:      'test_specific_version'
✅ Passed:      'test_debian'

@koralowiec koralowiec merged commit 7afd88a into devcontainers-extra:main May 17, 2026
5 checks passed
@sudhanvas sudhanvas deleted the add-bazel-compile-commands branch May 17, 2026 20:28
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.

2 participants