Files
releases/main.go
T
Torin Sandall 031fba9c2f Fix cross-compile issue in go generate step
The WASM changes broke cross-compiling because go generate executes go
run ... which inherits the GOOS and GOARCH environment variables. To
resolve this we just wrap the go rnu ... command in a script that
overwrites the environment variables so that the host GOOS and GOARCH
are used. For some reason go generate does not allow you to specify
environment variables inline, e.g., FOO=BAR go run ...

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2018-10-25 08:40:08 -07:00

23 lines
613 B
Go

// Copyright 2016 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package main
import "fmt"
import "os"
import "github.com/open-policy-agent/opa/cmd"
func main() {
if err := cmd.RootCommand.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
// Rego parser generation:
//
//go:generate pigeon -o ast/parser.go ast/rego.peg
//go:generate goimports -w ast/parser.go
//go:generate build/gen-opa-wasm.sh internal/cmd/genopawasm/main.go -o internal/compiler/wasm/opa/opa.go internal/compiler/wasm/opa/opa.wasm