theoremlp / rules_multitool

Bazel rules for ergonomic tool definitions
Apache License 2.0
24 stars 5 forks source link

Handle lockfile merge with starlark idiosyncrasies #42

Closed Geethree closed 5 months ago

Geethree commented 5 months ago

In Starlark, when you merge dictionaries using the | operator, the keys from the left-hand side (LHS) dictionary take precedence over the keys from the right-hand side (RHS) dictionary. This behavior might not be what you expect if you want the RHS keys to override the LHS keys.

In this approach, tools.update(lock_dict) will update the tools dictionary with the key-value pairs from lock_dict, and if any keys are already present in tools, their values will be overwritten by the corresponding values from lock_dict.

Geethree commented 5 months ago

In response to #41