How to write a simile gen rule in Bazel

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • #bazel #programming #beginners
    In this tutorial I go through how to create the most simple bazel rule to get started.
    We take two text files and use a simple command to combine the two files into another file

Комментарии • 11

  • @j4watt6er
    @j4watt6er 9 месяцев назад +1

    This is great! From what I’m starting to understand about Bazel, wouldn’t you want to go ac step father and wrap that genrule in a macro so that it looks like a rule when you use it? Like, combine() would be a macro that passes off to the genrule()?

    • @gisli
      @gisli  8 месяцев назад

      Thanks!
      The gen rules are pretty interesting tbh. I just recently figured out how to use them and they are great for small simple things. But I think in most cases once the use case is a little bit more complex (where you start thinking about writing a macro for example) its probably better to write a custom rule that just exactly what you need instead of wrapping the gen rules
      But I might be wrong :), I still haven't really introduced bazel as a critical part of my studios infrastructure so maybe there are considerations that I haven't seen

  • @farzadmf
    @farzadmf 11 месяцев назад +1

    Please do more Bazel videos (pre-beginner to please :) ). In my previous company, we started to use Bazel and I was always like WTH is happening here?!!

    • @gisli
      @gisli  11 месяцев назад +2

      Thanks for your comment, I’m glad it’s helpful, I really like making content about the fundamentals to try and get people to understand rather than just follow along 🙂

    • @farzadmf
      @farzadmf 10 месяцев назад +1

      Yes, I agree. One super useful video/series for me personally would be to add Bazel to an existing project, showing how to create the workspace file, the individual build files etc.

    • @gisli
      @gisli  10 месяцев назад

      That a good idea. I tried to show off setting up a project from scrach in one of my other videos but I think it would be cool to migrate a project over to bazel
      Do you have any suggestions for a project? maybe a (relatively simple) open source project

    • @farzadmf
      @farzadmf 10 месяцев назад

      Hmmm, I didn't expect the question, so I have to think 😆.
      Not sure honestly which open source project is "simple" because most of the repos I visit almost regularly (libraries, etc.) are "big", but I'll definitely keep an eye.
      But that would be SUPER COOL if it's implemented in an existing "real" project

  • @elganzandere
    @elganzandere 11 месяцев назад +1

    What's going on with Arctic Theory & the forthcoming title?

    • @gisli
      @gisli  11 месяцев назад

      Hey 🙂 we are still working hard towards the closed alpha of Pioneers of New Dawn next year. Everything is clicking into place and the core systems are falling into place
      We’ll release some news on the mailing list in the coming weeks
      www.arctictheory.com/pond

  • @gerald5335
    @gerald5335 10 месяцев назад +1

    Labels
    //absolute/path/to:target
    relative/path/from/BUILD/to/subpackage:target

    • @gisli
      @gisli  10 месяцев назад

      Thanks for the clarification, I'm still getting the hang of the finer details