Skip to content

Commit

Permalink
fix: need to draw in the influxdb-specific standard library in fluxinit
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-thurston committed Nov 3, 2020
1 parent bcb33ae commit f67009c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/influxd/launcher/launcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"time"

"github.com/influxdata/flux"
"github.com/influxdata/flux/fluxinit"
"github.com/influxdata/influxdb/v2/fluxinit"
platform "github.com/influxdata/influxdb/v2"
"github.com/influxdata/influxdb/v2/authorization"
"github.com/influxdata/influxdb/v2/authorizer"
Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"path/filepath"
"runtime"

"github.com/influxdata/flux/fluxinit"
"github.com/influxdata/influxdb/v2/fluxinit"
"github.com/influxdata/influxdb/v2"
"github.com/influxdata/influxdb/v2/bolt"
"github.com/influxdata/influxdb/v2/dbrp"
Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/upgrade/v1_dump_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"
"text/tabwriter"

"github.com/influxdata/flux/fluxinit"
"github.com/influxdata/influxdb/v2/fluxinit"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/influxd/upgrade/v2_dump_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"text/tabwriter"

"github.com/influxdata/flux/fluxinit"
"github.com/influxdata/influxdb/v2/fluxinit"
"github.com/influxdata/influxdb/v2"
"github.com/influxdata/influxdb/v2/internal/fs"
"github.com/spf13/cobra"
Expand Down
20 changes: 20 additions & 0 deletions fluxinit/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package fluxinit

import (
"github.com/influxdata/flux/runtime"

_ "github.com/influxdata/flux/stdlib"
_ "github.com/influxdata/influxdb/v2/query/stdlib" // Import the stdlib
)

// FluxInit() prepares the runtime for compilation and execution of flux. This
// is a costly step and should only be performed if the intention is to compile
// and execute flux code.
//
// Importing this package and calling FluxInit is equivalent to importing the
// "builtin" package. It draws in the standard library functions, which
// register themselves in init() functions, then performs the final steps
// necessary to prepare for executing flux.
func FluxInit() {
runtime.FinalizeBuiltIns()
}

0 comments on commit f67009c

Please sign in to comment.