mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
add documentation on Terraform's available build options
This commit is contained in:
parent
11a68eaa40
commit
16ae079c22
36
BUILDING.md
Normal file
36
BUILDING.md
Normal file
@ -0,0 +1,36 @@
|
||||
# Building from Source
|
||||
|
||||
Pre-built binaries are available for download for a variety of supported platforms through the [HashiCorp Releases website](https://releases.hashicorp.com/terraform/).
|
||||
|
||||
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.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
1. Ensure you've installed the Go language version specified in [`.go-version`](https://github.com/hashicorp/terraform/blob/main/.go-version).
|
||||
2. Clone this repository to a location of your choice.
|
||||
|
||||
## Terraform Build Options
|
||||
|
||||
Terraform accepts certain options passed using `ldflags` at build time which control the behavior of the resulting binary.
|
||||
|
||||
### Dev Version Reporting
|
||||
|
||||
Terraform will include a `-dev` flag when reporting its own version (ex: 1.5.0-dev) unless `version.dev` is set to `no`:
|
||||
|
||||
```
|
||||
go build -ldflags "-w -s -X 'github.com/hashicorp/terraform/version.dev=no'" -o bin/ .
|
||||
```
|
||||
|
||||
### Experimental Features
|
||||
|
||||
Experimental features of Terraform will be disabled unless `main.experimentsAllowed` is set to `yes`:
|
||||
|
||||
```
|
||||
go build -ldflags "-w -s -X 'main.experimentsAllowed=yes'" -o bin/ .
|
||||
```
|
||||
|
||||
## Go Options
|
||||
|
||||
The Terraform release process uses the Go toolchain defaults for the current operating system and processor architecture.
|
||||
|
||||
|
@ -1 +1 @@
|
||||
1.6.0-dev
|
||||
1.6.0-alpha1
|
||||
|
@ -1,3 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package version
|
||||
|
||||
import (
|
||||
|
Loading…
Reference in New Issue
Block a user