Code Monkey home page Code Monkey logo

bzlmod's Introduction

bzlmod's People

Contributors

meteorcloudy avatar philwo avatar wyverald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bzlmod's Issues

Dependency analysis

This is about support for the subcommand currently known as bzlmod query. It should be able to print out the dependency graph, show some path from one module to a (transitive) dependency, among other things.

To achieve this, we need to store more information in the lockfile (essentially, the entire dependency graph, even pre-selection).

bazel_compatibility support

We should collect the bazel_compatibility declarations of all modules in the dep graph, compute the intersection, and output that into the WORKSPACE file (or if we're definitely version-locking bzlmod and Bazel, fail outright).

Support for module rules

  • Ability to "call" module rules in MODULE.bazel
  • Loading and executing the module_rule_exports file of any referenced Bazel modules, after bazel_deps are resolved (i.e. post-discovery-and-selection)
  • Running the resolve function with collected tags
  • Implementation of the bfs builtin
  • Implementation of the attr module
  • Implementation of the ModuleRuleContext object (and potentially a shim for repository_ctx)
  • Writing ResolveResults to WORKSPACE and the lock file
  • Being able to fetch repos resulting from module rules, by loading necessary info from the lock file and running the fetch function

No checkboxes here, since all of this need to be done at once for module rules to have any semblance of working.

Support for patching

  • Patches in index registries (source.json)
  • Patches in overrides (archive, git, single_version)
  • Fuzzy matching

The plumbing of patching information is already done (patch files, patch_strip, etc). The work left is to actually do the patching (mainly in the Archive fetcher; after Git support is in, in the Git fetcher too).

compatibility_level support

This entails throwing an error at selection time if different versions of a module were discovered, but they have different compatibility_levels.

subcommands: add, remove

This involves programmatically modifying the MODULE.bazel file, so there could be minor challenges (for example, a user can technically use list comprehensions in MODULE.bazel)

Proper management of concurrent access

Right now bzlmod doesn't deal with concurrent calls very well. All sorts of race conditions could happen if bzlmod resolve and bzlmod fetch are called concurrently, whether inside the same workspace or across different workspaces.

Fix strip_prefix behavior

Right now, for the Archive fetcher, strip_prefix is implemented using strings.TrimPrefix. This has two problems:

  • It strips the prefix "foo/bar" from the path "foo/bar_license", resulting in a file called "_license". Stripping should work on a path segment level.
  • It doesn't do anything when the path doesn't begin with the prefix (ie. if the path is "foo/baz", and strip_prefix is "foo/bar", then the file "foo/baz" remains in the extracted files). The correct behavior is to ignore any such files.

Make sure MODULE.bazel doesn't have `if`s and `for`s

Should be an easy fix; during discovery, instead of using starlark.ExecFile, we should manually parse the file and inspect the AST and throw an error if control flow statements or function definitions exist.

dev_dependency for bazel_dep

Reintroduce dev_dependency to bazel_dep.

We removed it because of potential BUILD breaks in situations like bazelbuild/bazel#12835. However, not having dev dependencies means that the dependency graph could be cluttered in an unbounded manner. For example, most rulesets depend on bazel_skylib, which uses rules_pkg to manage releases. Without dev dependencies, this means that most Bazel projects would depend on bazel_skylib -> rules_pkg -> rules_python -> {insert crapton of deps here}.

Git support

  • git_override
  • single module registries

Both need the Git fetcher to be implemented first.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.