You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pre-built binaries are available for download for a variety of supported platforms through the [HashiCorp Releases website](https://releases.hashicorp.com/terraform/).
4
+
5
+
However, if you'd like to build Terraform yourself, you can do so using the Go build toolchain and the options specified in this document.
6
+
7
+
## Prerequisites
8
+
9
+
1. Ensure you've installed the Go language version specified in [`.go-version`](https://github.com/hashicorp/terraform/blob/main/.go-version).
10
+
2. Clone this repository to a location of your choice.
11
+
12
+
## Terraform Build Options
13
+
14
+
Terraform accepts certain options passed using `ldflags` at build time which control the behavior of the resulting binary.
15
+
16
+
### Dev Version Reporting
17
+
18
+
Terraform will include a `-dev` flag when reporting its own version (ex: 1.5.0-dev) unless `version.dev` is set to `no`:
19
+
20
+
```
21
+
go build -ldflags "-w -s -X 'github.com/hashicorp/terraform/version.dev=no'" -o bin/ .
22
+
```
23
+
24
+
### Experimental Features
25
+
26
+
Experimental features of Terraform will be disabled unless `main.experimentsAllowed` is set to `yes`:
27
+
28
+
```
29
+
go build -ldflags "-w -s -X 'main.experimentsAllowed=yes'" -o bin/ .
30
+
```
31
+
32
+
## Go Options
33
+
34
+
The Terraform release process uses the Go toolchain defaults for the current operating system and processor architecture.
0 commit comments