Hi, I'd like to use this terraform provider[0] wit...
# contribute
a
Hi, I'd like to use this terraform provider[0] with pulumi, how do I go about that? [0] https://github.com/andrewchambers/terraform-provider-nix
f
Here’s the repo that documents the current process: https://github.com/pulumi/pulumi-tf-provider-boilerplate/
a
I get
scripts/get-py-version.go:7:2: cannot find module providing package <http://github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil|github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil>: working directory is not part of a module
as part of the output when I run it following the instructions.
Copy code
kalium@nix> make prepare NAME=terraform-provider-nix REPOSITORY=<http://github.com/andrewchambers/terraform-provider-nix|github.com/andrewchambers/terraform-provider-nix>
scripts/get-py-version.go:7:2: cannot find module providing package <http://github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil|github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil>: working directory is not part of a module
mv "provider/cmd/pulumi-tfgen-x""yz" provider/cmd/pulumi-tfgen-terraform-provider-nix
mv "provider/cmd/pulumi-resource-x""yz" provider/cmd/pulumi-resource-terraform-provider-nix
if [[ "Linux" != "Darwin" ]]; then \
	sed -i 's,<http://github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g|github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g>' provider/go.mod; \
	find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/terraform-provider-nix/g' {} \; &> /dev/null; \
fi
# In MacOS the -i parameter needs an empty string to execute in place.
if [[ "Linux" == "Darwin" ]]; then \
	sed -i '' 's,<http://github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g|github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g>' provider/go.mod; \
	find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/terraform-provider-nix/g' {} \; &> /dev/null; \
fi
full command + output ^
@future-barista-68134
f
I’m not very familiar with how this is supposed to work 🙂 @broad-dog-22463 might be able to help here.
b
Hi @alert-restaurant-79151 can you tell me if that command has changed to set the new name? (i.e. has the sed command completed at all)
a
Think so, the sed command was printed though.
running it with the code commented out does not seem to make any difference in the resulting file tree. it seems to just do checks and not effect anything if they pass.
Want me to open an issue on this on GH?
As I cannot fix this, I've opened an issue: https://github.com/pulumi/pulumi-tf-provider-boilerplate/issues/31
b
thanks
we can investigate
b
@alert-restaurant-79151 i replied to that issue, are you using
go 1.14
?
a
@billowy-army-68599 go1.14.1
b
our
get-py-version
script requires
go1.13.x
at the moment, you can patch the Makefile by changing the
PYPI_VERSION
like so
Copy code
PYPI_VERSION    := $(shell (cd scripts && ./get-py-version))
a
Okay sure.
That fixed it, thanks.