Thanks Ryan.
On Sun, Nov 26, 2017 at 10:29 AM, Ryan Gonzalez <rym...@gmail.com> wrote:
> Dazel basically takes in a pubspec and outputs Bazel rules.
Makes sense. This matches my understanding.
> The underlying rules don't need to be stable, because they're autogenerated.
Assuming one is using dazel, this also makes sense. However, if one
plans to hand write BUILD files the inconsistency is potentially still
worth clarifying.
> I'd highly advise getting used to pub anyway
I respectfully disagree here. One of the major wins of a tool like
bazel is that it supports "multiple languages with one tool". Having a
company-wide monorepo which uses a single tool for all compiles,
tests, deployments, etc regardless of language allows developers to
move about the code base while minimizing cognitive load.
Based on the wording in the README, I would guess that Google
internally prefers the use of bazel over pub.
> although its future as a build tool is somewhat hazy (IIRC the build package is a replacement for pub transformers), it's still the current dependency management tool.
Thanks! Do you happen to have a reference regarding the build package
replacing pub (so that I can learn more about the road map for the
tooling)?
Best,
Andy
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
Thanks for the detailed reply and added context Matan.
I agree that bazel shouldn't be the only way to build dart code. Potentially, the build tooling could consider two use cases:
- Smaller repositories (possibly only containing dart code) which prefer minimal setup & configuration. These users will likely prefer a dart specific tool set (such as pub or build_runner).
- Larger existing projects containing code written in a wide variety of languages. These users will likely be willing to undertake additional configuration steps.
On Sun, Nov 26, 2017 at 11:31 AM, Matan Lurey <ma...@lurey.org> wrote:
> Externally, we considered offering full Bazel support, but shied away:
>
> * Bazel at the time barely supported Windows, which is important to us.
> * Even today, lots of our Bazel integration is Unix-specific. It would take
> a lot of time, resources, and debugging to get this to work great
> out-of-the-box to Windows users, and even then Bazel is pretty heavyweight
> for some projects.In the "two build systems" model suggested above, windows support need not be a requirement here. It would be acceptable to have windows only supported by the dart tooling (pub, build_runner) while macOS and linux were also supported by bazel.
Further, as bazel windows support has significantly improved, should adequate interest appear in using dart with bazel on windows it would be possible to fix those issues.
> So, we took build_runner, and tried building on it. And it turned out to
> work quite well. Basically, there is one user-level set of interfaces,
> package:build, with a set of contracts that if you follow work for pub
> transformers, bazel/blaze, and build_runner.Can you say more here? Specifically, does any documentation exist on using these with bazel?
>> On Sun, Nov 26, 2017 at 10:29 AM, Ryan Gonzalez <rym...@gmail.com> wrote:
>> > Dazel basically takes in a pubspec and outputs Bazel rules.
>>
>> Makes sense. This matches my understanding.
>
> Dazel was based on the idea that we could infer a build system configuration
> based on your package configuration and a bit of extra metadata. We've
> actually kept this model as "build_config" for build_runner. The idea here
> is that users that consume generators would have to do little or no work.
>
> https://github.com/dart-lang/build/tree/master/build_configInteresting. Are you sating that build_config can be used to generate bazel BUILD files?
The rules_go repo has a tool called gazelle which functions in a similar manner to dazel (walks a directory tree, parses *.go files, generates BUILD.bazel files). My dislike for dazel (and maybe build_config?) is that it depends on pubspec.yaml files which are "pub specific" files (vs simply dart source code). In the gazelle case only go source files are required.
tl;dr, at one point we had no build system. Dart 1.0 was predicated around having a JIT (just-in-time) source-code VM, so similar to the JS ecosystem in ~2011/2012, there wasn't an apparent need to have a platform-level build system (remember, Dart->JS was just going to be for legacy browsers, and you did most browser development in Dartium).Once pub, as a package manager, was built and shipped, there were various opinions on whether it or another tool should play a build/asset system role, and the current implementation of pub does via "pub serve", "pub build", and asset transformers (commonly called "transformers").
This worked well enough for small/medium-ish size projects, but broke down quite a bit once your project(s) got larger - designed to be an in-memory monolithic transformation system, not a scaleable, modular build system.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/d52e7898-fdbd-4d24-8a2a-2436b27be1e4%40dartlang.org.