Commit Graph

14 Commits

Author SHA1 Message Date
James Bardin 7d3fe3b404 update cty 2020-03-03 15:20:11 -05:00
Martin Atkins b62e9a7227 vendor: go get github.com/hashicorp/hcl/v2@v2.3.0
This brings in the new HCL extension functions "try", "can", and
"convert", along with the underlying HCL and cty infrastructure that allow
them to work.
2020-01-10 15:23:25 -08:00
Martin Atkins 9a17497d3f vendor: go get github.com/hashicorp/hcl/v2@v2.2.0
This also includes an upgrade to cty v1.1.1 because HCL calls for it.

The changes in these two libraries are mainly to codepaths that don't
directly affect Terraform, but including this upgrade will cause some
small improvements to Terraform's error messages for type conversion
problems.
2019-12-12 10:36:23 -08:00
James Bardin 1d134fea69 update go-cty 2019-05-16 16:43:28 -04:00
Martin Atkins 373f94fe89 vendor: go get github.com/zclconf/go-cty/cty@master
This includes a fix to prevent unintentional infinite recursion when
trying to unify multiple object types to a single type for conversion to
list(any).

Sadly I wasn't able to reproduce the problem as reported (in #20728), so
therefore I wasn't able to write a Terraform test for it, but I have
confirmed that the cty behavior here was incorrect anyway (recursively
calling the same function we're already in with the same arguments is
clearly not productive) and so this change will allow whatever situation
that was to terminate with a type conversion error, rather than causing a
stack overflow.

It's likely that there is another bug lurking under this, since the
problematic code here was supposed to be unreachable, but avoiding the
crash is the priority for now. If the problem re-surfaces then it should
at least be an error message with some additional context about what the
goal of the caller was.

This also includes an unrelated fix for the gocty package, which doesn't
affect Terraform because it makes very little use of that package.
2019-03-20 16:34:05 -07:00
Martin Atkins fb0c9714c1 vendor: go get github.com/zclconf/go-cty@master
This fixes some consistency problems with how number strings were parsed
in the msgpack decoder vs other situations.

This commit also includes an upgrade of HCL2 to use this new cty function,
though there's no change in behavior here since the new function is
functionally equivalent to what it replaced.
2019-01-24 16:42:21 -08:00
Martin Atkins 65c0826293 vendor: upgrade github.com/zclconf/go-cty
This includes:
- An additional check in the format stdlib function to fail if there are
  too many arguments given, rather than silently ignoring.
- Refinements for the type unification behavior to allow unification of
  object/tuple types into weaker map/list types when no other unification
  is possible.
- Improvements to the error messages for failed type conversions on
  collection and structural types to talk about mismatching element types
  where possible, rather than the outer value.
2018-12-18 17:29:09 -08:00
James Bardin 55a0a7d2f0 udpate go.mod and vendor 2018-11-29 15:23:38 -05:00
Martin Atkins aa6b55bb17 govendor fetch github.com/zclconf/go-cty/...
This update includes a new conversion from tuple types to set types and
improvements to the error messages returned when conversions fail.
2018-10-16 18:53:51 -07:00
Martin Atkins 93cda6dbd2 govendor fetch github.com/zclconf/go-cty/cty/...
This allows automatic conversions between different object types as long
as the target type is a subset of the given type.
2018-10-16 18:50:29 -07:00
Martin Atkins f8a8f26c0d govendor fetch github.com/zclconf/go-cty/cty/...
This includes upstream fixes, and in particular a converter for going
between map types with different element types.
2018-10-16 18:49:20 -07:00
Martin Atkins 59a49c6b3f vendor: update hcl2 and cty
This is largely minor bugfixes for issues found since we last updated the
vendoring. There are some new features here that Terraform is not yet
using and thus present little risk.

In particular this includes the HCL-JSON spec change where arrays can now
be used at any level in a block label structure, to allow for preserving
the relative order of blocks.
2018-03-08 11:10:34 -08:00
Martin Atkins 26861dd7aa govendor fetch github.com/zclconf/go-cty/...
This new version supports a conversion from object types to map types,
which is important for Terraform because HCL2 { ... } syntax produces
objects but lots of Terraform attributes require maps.
2017-10-16 17:51:37 -07:00
Martin Atkins c202afeca9 govendor fetch github.com/hashicorp/hcl2/... 2017-10-03 17:47:01 -07:00