Commit Graph

40 Commits

Author SHA1 Message Date
wata_mac f68d94b608 Bump github.com/hashicorp/hcl2 2019-08-11 16:43:12 +09:00
Pam Selle d34103696f Upgrade HCL to include fmt fix, involves #21434 2019-07-25 11:27:51 -04:00
James Bardin f69e4df5c5 update hcl2
Includes fixes for conditionals with unknown values.
2019-07-18 20:26:45 -04:00
James Bardin 8c43bb2b52 update hcl2 2019-07-02 15:10:20 -04:00
Martin Atkins b1e92b3769 vendor: go get github.com/hashicorp/hcl2@0b64543c968c
This includes a fix to make sure that an expression with a static string
index, like foo["bar"], will be parsed as a traversal rather than as a
dynamic index expression.
2019-06-18 17:37:24 -07:00
Martin Atkins 11cf8fd6be vendor: go get github.com/hashicorp/hcl2@master
This fixes a bug where HCL would flag a parse error if a single-line
comment appeared at the end of a file without a terminating newline.
2019-05-16 07:30:50 -07:00
Martin Atkins 63fa1ac418 vendor: go get github.com/hashicorp/hcl2@master
This includes a small fix to ensure the parser doesn't produce an invalid
body for block parsing syntax errors, and instead produces an incomplete
result that calling applications like Terraform can still analyze.

The problem here was affecting our version-constraint-sniffing code, which
intentionally tried to find a core version constraint even if there's a
syntax error so that it can report that a new version of Terraform is a
likely cause of the syntax error. It was working in most cases, unless
it was the "terraform" block itself that contained the error, because then
we'd try to analyze a broken hcl.Block with a nil body.

This includes a new test for "terraform init" that exercises this
recovery codepath.
2019-05-14 15:37:46 -07:00
Martin Atkins d06edb1b62 go get github.com/hashicorp/hcl2@master
This corrects a bug in the HCL 2 scanner where a $ or % symbol would cause
incorrect tokenization if appearing immediately before a " .

This also includes some updates to Go extension libraries that the HCL
update brings in. Some of these changes update to support Unicode 11, but
only when compiling with Go 1.13, so we won't see the effect of these
changes until we start building Terraform with Go 1.13.
2019-05-03 15:29:40 -07:00
Martin Atkins 95826d6fdd vendor: github.com/hashicorp/hcl2@master
This contains an adjustment to how the dynamic blocks extension expands
a dynamic block whose for_each expression is unknown: it now produces an
block whose leaf attributes are all unknown, which is what Terraform had
previously been expecting but it wasn't actually true in practice.
2019-05-02 14:08:40 -07:00
Martin Atkins 6a156f67ce vendor: go get github.com/hashicorp/hcl2@master
This includes a new specialized error message for when a fractional number
is used to index a sequence.
2019-04-16 10:03:37 -07:00
Kristin Laemmert f8a5e17d3d
command/format: improve "source" of error messages regarding missing arguments (#20907)
* vendor: update hcl2 dependency
* command/format: revert diagnostic format behavior if snippet or highlight range is empty
2019-04-03 14:04:59 -04:00
Martin Atkins b35bc255d2 vendor: go get github.com/hashicorp/hcl2@master
This gives us an extra hook in the dynblock variables analysis that should
allow us to also make it subject also to the lang/blocktoattr fixup, to
ensure we'll find all the references in spite of these various
pre-processing wrappers.
2019-03-28 10:41:01 -07:00
Martin Atkins 838a42d218 vendor: go get github.com/hashicorp/hcl2@master
This includes improved functionality for HCL's "dynamic block extension",
which will allow us (in a subsequent commit) to properly detect
dependencies inside nested "dynamic" blocks, where currently they get
missed.

For this commit though, we just upgrade HCL to a version that includes it
and make a small change to our "lang" package to align with an upstream
renaming.
2019-03-19 10:04:45 -07:00
Martin Atkins ea1d5f8fcb vendor: go get github.com/hashicorp/hcl2@master
This includes two upstream fixes:

- Handle explicit JSON "null" consistently during decode of JSON syntax.
- Properly detect the end of a "heredoc" when formatting to avoid messing
  up indentation of other lines following the heredoc.
2019-03-15 13:55:30 -07:00
Martin Atkins 6fa1ff5de7 vendor: go get github.com/hashicorp/hcl2@master
This includes a fix for the parsing of object for expressions in newline-
sensitive contexts like block bodies.

It also includes a change to the JSON syntax decoder that cause it to
consider an explicit null to be equivalent to a property not being set at
all when interpreting a property value as a nested block. (It was
previously doing tha only when interpreting the property value as an
attribute value.)
2019-02-26 16:08:18 -08:00
Martin Atkins bfbce53911 vendor: go get github.com/hashicorp/hcl2@master
This includes a fix to properly report the position of an errant block
inside a block processed as JustAttributes, which fixes #20248.
2019-02-14 09:49:37 -08:00
Martin Atkins c8d34b55ee vendor: Upgrade both HCL2 and cty
The cty change here fixes a panic situation when cty.Path.Apply is given
a null value, making it now correctly return an error.

However, the HCL2 change includes an alternative to cty.Path.Apply that
uses HCL-level rules rather than cty-level rules, so the result behaves
like an HCL expression would. Most uses of cty.Path.Apply ought to use
hcl.ApplyPath instead, to ensure that the behavior is consistent with what
users expect in the main language.
2019-01-31 11:58:30 -08: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 787c176063 vendor: go get github.com/hashicorp/hcl2@master
This includes a missing feature for the splat syntax (null.* returns an
empty tuple) and also fixes a bug in the source code formatter where it
was inserting spaces between two consecutive interpolation sequences, like
"${foo}${bar}".
2019-01-17 14:21:18 -08:00
Martin Atkins a3f6e67b7d vendor: upgrade github.com/hashicorp/hcl2
This includes a fix to the dynamic block extension so that nested dynamic
blocks can iterate over the temporary variables created by their ancestors.
2018-12-20 14:28:37 -08:00
Martin Atkins d627987e70 vendor: upgrade github.com/hashicorp/hcl2
This includes a change to accept and ignore a UTF-8 BOM at the start of
any given native syntax configuration.

Although a BOM is redundant in UTF-8, we learned in #18618 that several
software products on Windows will produce a BOM whenever they save as
UTF-8, so accepting it avoids friction when using those tools to author
or generate Terraform configuration files.

This fixes #18618.
2018-12-19 16:18:29 -08:00
Martin Atkins 62481963b4 vendor: upgrade github.com/hashicorp/hcl2
This includes a fix to prevent the creation of an invalid block object
when the configuration contains invalid template sequences in block
labels.
2018-12-19 15:54:33 -08:00
Martin Atkins 109f9c607d vendor: update github.com/hashicorp/hcl2
This includes a fix to hcl.RelTraversalForExpr where it would
inadvertantly modify the internals of a traversal AST node as part of
relativizing the traversal in order to return it.
2018-12-17 09:02:25 -08:00
Martin Atkins b7452a1bf8 vendor: upgrade github.com/hashicorp/hcl2
This includes a number of upstream bug fixes, which in turn fix a number
of issues here in Terraform:

- New-style "full splat" operator now working correctly (#19181)
- The weird HCL1-ish single-line block syntax is now supported (#19153)
- Formatting of single-line blocks adds spaces around the braces (#19154)

This also includes a number of other upstream fixes that were not tracked
as issues in the Terraform repository. The highlights of those are:

- A for expression with the "for" keyword wrapped onto a newline after its
  opening bracket now parses correctly.
- In JSON syntax, interpolation sequences in properties of objects that
  are representing expressions now have their variables properly detected.
- The "flush" heredoc variant is now functional again after being broken
  in some (much-)earlier rework of the template parser.
2018-12-14 16:07:50 -08:00
Martin Atkins bf25e12792 vendor: upgrade github.com/hashicorp/hcl2
This includes a change to improve the precision of types returned from
splat expressions when a source value is unknown.
2018-12-07 17:05:36 -08:00
Martin Atkins 038b295ef1 vendor: upgrade github.com/hashicorp/hcl2
This includes a fix to the HCL scanner to properly parse multi-line
comments.
2018-12-04 11:37:39 -08:00
Radek Simko 8f6d525c56
vendor: Upgrade hashicorp/hcl2 to latest
See https://github.com/hashicorp/hcl2/pull/58
2018-11-26 23:38:13 +00:00
Martin Atkins 917a320a3b vendor: Update HCL2 and cty, and other related packages
This brings in a bugfix for analyzing variables inside relative traversal
expressions in HCL, and a cosmetic bugfix in cty for GoString of
cty.NullVal(cty.DynamicPseudoType).

This also updates some other packages, as a result of running "go get -u".
2018-10-16 19:14:11 -07:00
Martin Atkins 1bb79696c6 vendor: update to latest github.com/zclconf/go-cty
This includes a bugfix to the cty/msgpack package to ensure correct
decoding of unknown and null values.

This also includes updates to cty's dependencies.
2018-10-16 19:14:11 -07:00
Martin Atkins 3ea7e145e1 govendor fetch github.com/hashicorp/hcl2/...
This is a general catchup of some developments in the HCL2 codebase, but
in particular includes:

- Recording expression and evalcontext as part of diagnostics, so that
  variable value information can be included alongside diagnostic
  snippets.

- hcldec supports decoding blocks into tuple and object values as well as
  list and map values, which then allows cty.DynamicPseudoType nested
  attributes to work properly.
2018-10-16 19:11:09 -07:00
Martin Atkins 3855b79736 govendor fetch github.com/hashicorp/hcl2/...
This includes updates to various diagnostic messages to improve precision
and consistency of terminology.

It also includes some other changes to portions of HCL API that Terraform
isn't yet using.
2018-10-16 18:53:51 -07:00
Martin Atkins b8df11bc33 govendor fetch github.com/hashicorp/hcl2/...
This includes an upstream fix to the hcldec.Variables function that fixes
its behavior when dealing with specs that contain DefaultSpec, and other
similar wrapper specs.
2018-10-16 18:49:20 -07:00
Martin Atkins d9a26bae26 govendor fetch github.com/hashicorp/hcl2/...
This includes a number of upstream fixes, but in particular fixes a race
on evaluating the same splat expression concurrently for multiple separate
EvalContexts.
2018-10-16 18:49:20 -07:00
Martin Atkins fa11fb70f6 govendor fetch github.com/hashicorp/hcl2/...
This includes fixes to hcldec that should make our configschema.Block
implementation behave better with Optional+Computed attributes.
2018-10-16 18:48:28 -07:00
Martin Atkins f2809854a2 govendor fetch github.com/hashicorp/hcl2/ext/dynblock/... 2018-10-16 18:44:26 -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 b865d62bb8 govendor fetch github.com/hashicorp/hcl2/...
This just catches us up with the latest fixes and improvements in upstream
HCL2.
2018-02-15 15:56:37 -08:00
Martin Atkins 4de052cf01 govendor fetch github.com/hashicorp/hcl2/... 2017-10-04 16:35:11 -07:00
Martin Atkins 21bf786401 govendor fetch github.com/hashicorp/hcl2/hcltest 2017-10-04 16:35:11 -07:00
Martin Atkins c202afeca9 govendor fetch github.com/hashicorp/hcl2/... 2017-10-03 17:47:01 -07:00