Skip to content

Buck2 not respecting config file #1269

@achint-trc

Description

@achint-trc

Context
A monorepo setup with Buck2 build. I have a .buckconfig holding all the config details including [buck2_re_client] for remote builds.

Issue
In my .buckconfg the remote build section looks like:

[buck2_re_client]
action_cache_address = <my_rbe.com>
engine_address = <my_rbe.com>
cas_address = <my_rbe.com>
instance_name = default

Since I want to do remote builds via CI as well, I was planning to create another file like .buckconfig.ci which shall hold the certs

[buck2_re_client]
tls_ca_certs = <path/to/ca/cert/in/ci>
tls_client_cert = <path/to/client/cert/in/ci>

and build like :

buck2 build --prefer-remote --config-file .buckconfig.ci <targets>

Expected
The Buck2 client merges the configs (as it does when users have a .buckconfig and .buckconfig.local on their dev setup locally) and does the build.

Actual
It fails with Unable to verify certificate or transport error: invalid peer certificate. If I copy paste the key-value pairs mentioned in .buckconfig.ci to .buckconfig itself and run, it works smoothly.

What changed?
We were earlier using http_headers to pass JWT token for auth with our RBE. In .buckconfig we kept the token as an environment variable (which would be exposed via CI) and for developers, they could simply override via .buckconfig.local

Constraints
I can't put these certs in .buckconfig as we want developers to use the JWT token method only.

Note
I also tried using --config as mentioned in https://buck2.build/docs/concepts/buckconfig/#precedence-of-buck2-configuration-specifications but didn't help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions