rules_jvm_external icon indicating copy to clipboard operation
rules_jvm_external copied to clipboard

Add support for use_credentials_from_home_netrc_file parameter with bzlmod

Open dzuff-sfdc opened this issue 2 years ago • 5 comments

Currently the parameter use_credentials_from_home_netrc_file is not supported when using rules_jvm_external with bzlmod.

dzuff-sfdc avatar Feb 07 '23 23:02 dzuff-sfdc

I need to re-read the code to check this, but I'm not sure we still need this attribute. The Bazel downloader will use values from $HOME/.netrc, so pinned deps shouldn't be affected. In the case of the unpinned deps, I think (and this is what I need to check), that we now parse the .netrc and use those credentials with coursier, which we can make the default behaviour (to be consistent with the pinned case)

shs96c avatar Feb 08 '23 18:02 shs96c

Thank you. It looks like that currently for unpinned deps, credentials from .netrc are not passed to coursier by default.

dzuff-sfdc avatar Feb 09 '23 21:02 dzuff-sfdc

Is there a workaround here or a plan to add this functionality back in?

samdis avatar Nov 03 '23 20:11 samdis

Using the netrc file would be good, or using the new bazel auth helper would be nice too; however right now it is definitely broken; putting literal passwords in repository URLs is not viable.

rbtcollins avatar Nov 18 '23 21:11 rbtcollins

Its a fairly straightforward patch, just another attribute on the tag, a logical_or over definitions of the same repo, and finally pass it into the existing coursier_fetch rule.

rbtcollins avatar Nov 18 '23 22:11 rbtcollins

I went ahead and made the patch above. Works as expected in our setup ☝🏼

erikkerber avatar Apr 03 '24 20:04 erikkerber