Loading tools/rbcrun/host.go +4 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import ( "strings" "go.starlark.net/starlark" "go.starlark.net/starlarkjson" "go.starlark.net/starlarkstruct" ) Loading Loading @@ -60,7 +59,6 @@ var rbcBuiltins starlark.StringDict = starlark.StringDict{ var sclBuiltins starlark.StringDict = starlark.StringDict{ "struct": starlark.NewBuiltin("struct", starlarkstruct.Make), "json": starlarkjson.Module, } func isSymlink(filepath string) (bool, error) { Loading Loading @@ -389,6 +387,10 @@ func Run(filename string, src interface{}, mode ExecutionMode, allowExternalEntr return nil, nil, err } if mode == ExecutionModeScl && !strings.HasSuffix(filename, ".scl") { return nil, nil, fmt.Errorf("filename must end in .scl: %s", filename) } // Add top-level file to cache for cycle detection purposes moduleCache[filename] = nil Loading tools/rbcrun/host_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ func TestBzlLoadsScl(t *testing.T) { if err := os.Chdir(filepath.Dir(dir)); err != nil { t.Fatal(err) } vars, _, err := Run("testdata/bzl_loads_scl.bzl", nil, ExecutionModeScl, false) vars, _, err := Run("testdata/bzl_loads_scl.bzl", nil, ExecutionModeRbc, false) if err != nil { t.Fatal(err) } Loading @@ -160,7 +160,7 @@ func TestNonEntrypointBzlLoadsScl(t *testing.T) { if err := os.Chdir(filepath.Dir(dir)); err != nil { t.Fatal(err) } vars, _, err := Run("testdata/bzl_loads_scl_2.bzl", nil, ExecutionModeScl, false) vars, _, err := Run("testdata/bzl_loads_scl_2.bzl", nil, ExecutionModeRbc, false) if err != nil { t.Fatal(err) } Loading Loading
tools/rbcrun/host.go +4 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ import ( "strings" "go.starlark.net/starlark" "go.starlark.net/starlarkjson" "go.starlark.net/starlarkstruct" ) Loading Loading @@ -60,7 +59,6 @@ var rbcBuiltins starlark.StringDict = starlark.StringDict{ var sclBuiltins starlark.StringDict = starlark.StringDict{ "struct": starlark.NewBuiltin("struct", starlarkstruct.Make), "json": starlarkjson.Module, } func isSymlink(filepath string) (bool, error) { Loading Loading @@ -389,6 +387,10 @@ func Run(filename string, src interface{}, mode ExecutionMode, allowExternalEntr return nil, nil, err } if mode == ExecutionModeScl && !strings.HasSuffix(filename, ".scl") { return nil, nil, fmt.Errorf("filename must end in .scl: %s", filename) } // Add top-level file to cache for cycle detection purposes moduleCache[filename] = nil Loading
tools/rbcrun/host_test.go +2 −2 Original line number Diff line number Diff line Loading @@ -143,7 +143,7 @@ func TestBzlLoadsScl(t *testing.T) { if err := os.Chdir(filepath.Dir(dir)); err != nil { t.Fatal(err) } vars, _, err := Run("testdata/bzl_loads_scl.bzl", nil, ExecutionModeScl, false) vars, _, err := Run("testdata/bzl_loads_scl.bzl", nil, ExecutionModeRbc, false) if err != nil { t.Fatal(err) } Loading @@ -160,7 +160,7 @@ func TestNonEntrypointBzlLoadsScl(t *testing.T) { if err := os.Chdir(filepath.Dir(dir)); err != nil { t.Fatal(err) } vars, _, err := Run("testdata/bzl_loads_scl_2.bzl", nil, ExecutionModeScl, false) vars, _, err := Run("testdata/bzl_loads_scl_2.bzl", nil, ExecutionModeRbc, false) if err != nil { t.Fatal(err) } Loading