Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

add bzlmod support - #17

Open
marcushultman wants to merge 1 commit into
ericcurtin:mainfrom
marcushultman:bazel
Open

add bzlmod support#17
marcushultman wants to merge 1 commit into
ericcurtin:mainfrom
marcushultman:bazel

Conversation

@marcushultman

@marcushultman marcushultman commented Mar 16, 2025

Copy link
Copy Markdown

Summary by Sourcery

Introduce bzlmod support by adding a MODULE.bazel file and a BUILD file for the linenoise-cpp library.

Build:

  • Add MODULE.bazel file to enable bzlmod support.
  • Add BUILD file for the linenoise-cpp library.

@sourcery-ai

sourcery-ai Bot commented Mar 16, 2025

Copy link
Copy Markdown

Reviewer's Guide by Sourcery

This pull request introduces Bazel module support to the project. It adds a MODULE.bazel file to define the module and its dependencies, and a BUILD file to define the cc_library target for the project.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a Bazel module file to enable the project to be used as a Bazel dependency.
  • Created a MODULE.bazel file.
  • Declared the module name and version.
  • Added a dependency on rules_cc.
MODULE.bazel
Added a Bazel BUILD file to define the cc_library.
  • Created a BUILD file.
  • Defined a cc_library target for linenoise-cpp.
  • Specified the header and source files for the library.
  • Set the visibility to public.
BUILD

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey @marcushultman - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider using exports_includes to avoid exposing the header file's location to users.
  • It's good practice to include a LICENSE file in the repository to clarify the licensing terms.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread MODULE.bazel
@@ -0,0 +1,5 @@
"linenoise"

module(name='linenoise.cpp', version = "0.1.0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Avoid using a file extension in the module name.

Module names typically represent a logical grouping; including '.cpp' may be misleading if the module contains more than just this file.

Suggested change
module(name='linenoise.cpp', version = "0.1.0")
module(name='linenoise', version = "0.1.0")

Comment thread BUILD
@@ -0,0 +1,10 @@
cc_library(
name = "linenoise-cpp",

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

linenoise.cpp cannot be used, since it presumably conflicts with the cpp file.

@ericcurtin

Copy link
Copy Markdown
Owner

I have a feeling the BUILD file is could be causing macOS build to fail, if we change the name of one of the things it might work.

@marcushultman

Copy link
Copy Markdown
Author

@ericcurtin Not sure how I can be affecting cmake builds with this diff. The build log says:
/opt/homebrew/bin/cmake -S/Users/runner/work/linenoise.cpp/linenoise.cpp -B/Users/runner/work/linenoise.cpp/linenoise.cpp, indicating that it's an in-source build, meanwhile meson seem to expect build to be the cmake binary dir. Did that change recently?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants