diff --git a/devcontainer/devcontainer_test.go b/devcontainer/devcontainer_test.go index 923680b..4a47568 100644 --- a/devcontainer/devcontainer_test.go +++ b/devcontainer/devcontainer_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/require" ) -const magicDir = "/.envbuilder" +const workingDir = "/.envbuilder" func stubLookupEnv(string) (string, bool) { return "", false @@ -98,7 +98,7 @@ func TestCompileWithFeatures(t *testing.T) { featureTwoDir := fmt.Sprintf("/.envbuilder/features/two-%x", featureTwoMD5[:4]) t.Run("WithoutBuildContexts", func(t *testing.T) { - params, err := dc.Compile(fs, "", magicDir, "", "", false, stubLookupEnv) + params, err := dc.Compile(fs, "", workingDir, "", "", false, stubLookupEnv) require.NoError(t, err) require.Equal(t, `FROM localhost:5000/envbuilder-test-codercom-code-server:latest @@ -116,7 +116,7 @@ USER 1000`, params.DockerfileContent) }) t.Run("WithBuildContexts", func(t *testing.T) { - params, err := dc.Compile(fs, "", magicDir, "", "", true, stubLookupEnv) + params, err := dc.Compile(fs, "", workingDir, "", "", true, stubLookupEnv) require.NoError(t, err) registryHost := strings.TrimPrefix(registry, "http://") @@ -155,10 +155,10 @@ func TestCompileDevContainer(t *testing.T) { dc := &devcontainer.Spec{ Image: "localhost:5000/envbuilder-test-ubuntu:latest", } - params, err := dc.Compile(fs, "", magicDir, "", "", false, stubLookupEnv) + params, err := dc.Compile(fs, "", workingDir, "", "", false, stubLookupEnv) require.NoError(t, err) - require.Equal(t, filepath.Join(magicDir, "Dockerfile"), params.DockerfilePath) - require.Equal(t, magicDir, params.BuildContext) + require.Equal(t, filepath.Join(workingDir, "Dockerfile"), params.DockerfilePath) + require.Equal(t, workingDir, params.BuildContext) }) t.Run("WithBuild", func(t *testing.T) { t.Parallel() @@ -181,7 +181,7 @@ func TestCompileDevContainer(t *testing.T) { _, err = io.WriteString(file, "FROM localhost:5000/envbuilder-test-ubuntu:latest") require.NoError(t, err) _ = file.Close() - params, err := dc.Compile(fs, dcDir, magicDir, "", "/var/workspace", false, stubLookupEnv) + params, err := dc.Compile(fs, dcDir, workingDir, "", "/var/workspace", false, stubLookupEnv) require.NoError(t, err) require.Equal(t, "ARG1=value1", params.BuildArgs[0]) require.Equal(t, "ARG2=workspace", params.BuildArgs[1]) diff --git a/envbuilder.go b/envbuilder.go index 47cc228..75829c2 100644 --- a/envbuilder.go +++ b/envbuilder.go @@ -35,7 +35,7 @@ import ( "github.com/GoogleContainerTools/kaniko/pkg/util" "github.com/coder/envbuilder/devcontainer" "github.com/coder/envbuilder/internal/ebutil" - "github.com/coder/envbuilder/internal/magicdir" + "github.com/coder/envbuilder/internal/workingdir" "github.com/coder/envbuilder/log" "github.com/containerd/platforms" "github.com/distribution/distribution/v3/configuration" @@ -120,7 +120,7 @@ func Run(ctx context.Context, opts options.Options, preExec ...func()) error { func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) error { defer options.UnsetEnv() - magicDir := magicdir.At(opts.MagicDirBase) + workingDir := workingdir.At(opts.MagicDirBase) stageNumber := 0 startStage := func(format string, args ...any) func(format string, args ...any) { @@ -154,7 +154,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro opts.Logger(log.LevelInfo, "%s %s - Build development environments from repositories in a container", newColor(color.Bold).Sprintf("envbuilder"), buildinfo.Version()) - cleanupDockerConfigJSON, err := initDockerConfigJSON(opts.Logger, magicDir, opts.DockerConfigBase64) + cleanupDockerConfigJSON, err := initDockerConfigJSON(opts.Logger, workingDir, opts.DockerConfigBase64) if err != nil { return err } @@ -168,8 +168,8 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro ContainerEnv: make(map[string]string), RemoteEnv: make(map[string]string), } - if fileExists(opts.Filesystem, magicDir.Image()) { - if err = parseMagicImageFile(opts.Filesystem, magicDir.Image(), &runtimeData); err != nil { + if fileExists(opts.Filesystem, workingDir.Image()) { + if err = parseMagicImageFile(opts.Filesystem, workingDir.Image(), &runtimeData); err != nil { return fmt.Errorf("parse magic image file: %w", err) } runtimeData.Image = true @@ -186,7 +186,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro opts.ExportEnvFile = "" } } - runtimeData.Built = fileExists(opts.Filesystem, magicDir.Built()) + runtimeData.Built = fileExists(opts.Filesystem, workingDir.Built()) buildTimeWorkspaceFolder := opts.WorkspaceFolder var fallbackErr error @@ -233,7 +233,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro if err != nil { return fmt.Errorf("git clone options: %w", err) } - cloneOpts.Path = magicDir.Join("repo") + cloneOpts.Path = workingDir.Join("repo") endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...", newColor(color.FgCyan).Sprintf(opts.GitURL), @@ -259,7 +259,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro if !runtimeData.Image { defaultBuildParams := func() (*devcontainer.Compiled, error) { - dockerfile := magicDir.Join("Dockerfile") + dockerfile := workingDir.Join("Dockerfile") file, err := opts.Filesystem.OpenFile(dockerfile, os.O_CREATE|os.O_WRONLY, 0o644) if err != nil { return nil, err @@ -281,7 +281,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro return &devcontainer.Compiled{ DockerfilePath: dockerfile, DockerfileContent: content, - BuildContext: magicDir.Path(), + BuildContext: workingDir.Path(), }, nil } @@ -318,7 +318,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro opts.Logger(log.LevelInfo, "No Dockerfile or image specified; falling back to the default image...") fallbackDockerfile = defaultParams.DockerfilePath } - buildParams, err = devContainer.Compile(opts.Filesystem, devcontainerDir, magicDir.Path(), fallbackDockerfile, opts.WorkspaceFolder, false, os.LookupEnv) + buildParams, err = devContainer.Compile(opts.Filesystem, devcontainerDir, workingDir.Path(), fallbackDockerfile, opts.WorkspaceFolder, false, os.LookupEnv) if err != nil { return fmt.Errorf("compile devcontainer.json: %w", err) } @@ -393,7 +393,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro // So we add them to the default ignore list. See: // https://github.com/GoogleContainerTools/kaniko/blob/63be4990ca5a60bdf06ddc4d10aa4eca0c0bc714/cmd/executor/cmd/root.go#L136 ignorePaths := append([]string{ - magicDir.Path(), + workingDir.Path(), opts.WorkspaceFolder, // See: https://github.com/coder/envbuilder/issues/37 "/etc/resolv.conf", @@ -421,18 +421,18 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro if err := util.AddAllowedPathToDefaultIgnoreList(opts.BinaryPath); err != nil { return fmt.Errorf("add envbuilder binary to ignore list: %w", err) } - if err := util.AddAllowedPathToDefaultIgnoreList(magicDir.Image()); err != nil { + if err := util.AddAllowedPathToDefaultIgnoreList(workingDir.Image()); err != nil { return fmt.Errorf("add magic image file to ignore list: %w", err) } - if err := util.AddAllowedPathToDefaultIgnoreList(magicDir.Features()); err != nil { + if err := util.AddAllowedPathToDefaultIgnoreList(workingDir.Features()); err != nil { return fmt.Errorf("add features to ignore list: %w", err) } - magicTempDir := magicdir.At(buildParams.BuildContext, magicdir.TempDir) + magicTempDir := workingdir.At(buildParams.BuildContext, workingdir.TempDir) if err := opts.Filesystem.MkdirAll(magicTempDir.Path(), 0o755); err != nil { return fmt.Errorf("create magic temp dir in build context: %w", err) } // Add the magic directives that embed the binary into the built image. - buildParams.DockerfileContent += magicdir.Directives + buildParams.DockerfileContent += workingdir.Directives envbuilderBinDest := filepath.Join(magicTempDir.Path(), "envbuilder") magicImageDest := magicTempDir.Image() @@ -467,7 +467,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro } // temp move of all ro mounts - tempRemountDest := magicDir.Join("mnt") + tempRemountDest := workingDir.Join("mnt") // ignorePrefixes is a superset of ignorePaths that we pass to kaniko's // IgnoreList. ignorePrefixes := append([]string{"/dev", "/proc", "/sys"}, ignorePaths...) @@ -845,7 +845,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro // Create the magic file to indicate that this build // has already been ran before! if !runtimeData.Built { - file, err := opts.Filesystem.Create(magicDir.Built()) + file, err := opts.Filesystem.Create(workingDir.Built()) if err != nil { return fmt.Errorf("create magic file: %w", err) } @@ -864,7 +864,7 @@ func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) erro opts.Logger(log.LevelInfo, "=== Running the setup command %q as the root user...", opts.SetupScript) envKey := "ENVBUILDER_ENV" - envFile := magicDir.Join("environ") + envFile := workingDir.Join("environ") file, err := opts.Filesystem.Create(envFile) if err != nil { return fmt.Errorf("create environ file: %w", err) @@ -962,7 +962,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) return nil, fmt.Errorf("--cache-repo must be set when using --get-cached-image") } - magicDir := magicdir.At(opts.MagicDirBase) + workingDir := workingdir.At(opts.MagicDirBase) stageNumber := 0 startStage := func(format string, args ...any) func(format string, args ...any) { @@ -978,7 +978,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) opts.Logger(log.LevelInfo, "%s %s - Build development environments from repositories in a container", newColor(color.Bold).Sprintf("envbuilder"), buildinfo.Version()) - cleanupDockerConfigJSON, err := initDockerConfigJSON(opts.Logger, magicDir, opts.DockerConfigBase64) + cleanupDockerConfigJSON, err := initDockerConfigJSON(opts.Logger, workingDir, opts.DockerConfigBase64) if err != nil { return nil, err } @@ -1031,7 +1031,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) if err != nil { return nil, fmt.Errorf("git clone options: %w", err) } - cloneOpts.Path = magicDir.Join("repo") + cloneOpts.Path = workingDir.Join("repo") endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...", newColor(color.FgCyan).Sprintf(opts.GitURL), @@ -1056,7 +1056,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) } defaultBuildParams := func() (*devcontainer.Compiled, error) { - dockerfile := magicDir.Join("Dockerfile") + dockerfile := workingDir.Join("Dockerfile") file, err := opts.Filesystem.OpenFile(dockerfile, os.O_CREATE|os.O_WRONLY, 0o644) if err != nil { return nil, err @@ -1078,7 +1078,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) return &devcontainer.Compiled{ DockerfilePath: dockerfile, DockerfileContent: content, - BuildContext: magicDir.Path(), + BuildContext: workingDir.Path(), }, nil } @@ -1118,7 +1118,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) opts.Logger(log.LevelInfo, "No Dockerfile or image specified; falling back to the default image...") fallbackDockerfile = defaultParams.DockerfilePath } - buildParams, err = devContainer.Compile(opts.Filesystem, devcontainerDir, magicDir.Path(), fallbackDockerfile, opts.WorkspaceFolder, false, os.LookupEnv) + buildParams, err = devContainer.Compile(opts.Filesystem, devcontainerDir, workingDir.Path(), fallbackDockerfile, opts.WorkspaceFolder, false, os.LookupEnv) if err != nil { return nil, fmt.Errorf("compile devcontainer.json: %w", err) } @@ -1184,7 +1184,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) // So we add them to the default ignore list. See: // https://github.com/GoogleContainerTools/kaniko/blob/63be4990ca5a60bdf06ddc4d10aa4eca0c0bc714/cmd/executor/cmd/root.go#L136 ignorePaths := append([]string{ - magicDir.Path(), + workingDir.Path(), opts.WorkspaceFolder, // See: https://github.com/coder/envbuilder/issues/37 "/etc/resolv.conf", @@ -1207,10 +1207,10 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) // build via executor.RunCacheProbe we need to have the *exact* copy of the // envbuilder binary available used to build the image and we also need to // add the magic directives to the Dockerfile content. - // MAGICDIR - buildParams.DockerfileContent += magicdir.Directives + // WORKINGDIR + buildParams.DockerfileContent += workingdir.Directives - magicTempDir := filepath.Join(buildParams.BuildContext, magicdir.TempDir) + magicTempDir := filepath.Join(buildParams.BuildContext, workingdir.TempDir) if err := opts.Filesystem.MkdirAll(magicTempDir, 0o755); err != nil { return nil, fmt.Errorf("create magic temp dir in build context: %w", err) } @@ -1546,11 +1546,11 @@ func maybeDeleteFilesystem(logger log.Func, force bool) error { // We always expect the magic directory to be set to the default, signifying that // the user is running envbuilder in a container. // If this is set to anything else we should bail out to prevent accidental data loss. - // defaultMagicDir := magicdir.MagicDir("") + // defaultWorkingDir := workingdir.WorkingDir("") kanikoDir, ok := os.LookupEnv("KANIKO_DIR") - if !ok || strings.TrimSpace(kanikoDir) != magicdir.Default.Path() { + if !ok || strings.TrimSpace(kanikoDir) != workingdir.Default.Path() { if !force { - logger(log.LevelError, "KANIKO_DIR is not set to %s. Bailing!\n", magicdir.Default.Path()) + logger(log.LevelError, "KANIKO_DIR is not set to %s. Bailing!\n", workingdir.Default.Path()) logger(log.LevelError, "To bypass this check, set FORCE_SAFE=true.") return errors.New("safety check failed") } @@ -1627,13 +1627,13 @@ func parseMagicImageFile(fs billy.Filesystem, path string, v any) error { return nil } -func initDockerConfigJSON(logf log.Func, magicDir magicdir.MagicDir, dockerConfigBase64 string) (func() error, error) { +func initDockerConfigJSON(logf log.Func, workingDir workingdir.WorkingDir, dockerConfigBase64 string) (func() error, error) { var cleanupOnce sync.Once noop := func() error { return nil } if dockerConfigBase64 == "" { return noop, nil } - cfgPath := magicDir.Join("config.json") + cfgPath := workingDir.Join("config.json") decoded, err := base64.StdEncoding.DecodeString(dockerConfigBase64) if err != nil { return noop, fmt.Errorf("decode docker config: %w", err) @@ -1656,7 +1656,7 @@ func initDockerConfigJSON(logf log.Func, magicDir magicdir.MagicDir, dockerConfi } logf(log.LevelInfo, "Wrote Docker config JSON to %s", cfgPath) oldDockerConfig := os.Getenv("DOCKER_CONFIG") - _ = os.Setenv("DOCKER_CONFIG", magicDir.Path()) + _ = os.Setenv("DOCKER_CONFIG", workingDir.Path()) newDockerConfig := os.Getenv("DOCKER_CONFIG") logf(log.LevelInfo, "Set DOCKER_CONFIG to %s", newDockerConfig) cleanup := func() error { diff --git a/integration/integration_test.go b/integration/integration_test.go index 7fd732d..deb21ef 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -27,7 +27,7 @@ import ( "github.com/coder/coder/v2/codersdk/agentsdk" "github.com/coder/envbuilder" "github.com/coder/envbuilder/devcontainer/features" - "github.com/coder/envbuilder/internal/magicdir" + "github.com/coder/envbuilder/internal/workingdir" "github.com/coder/envbuilder/options" "github.com/coder/envbuilder/testutil/gittest" "github.com/coder/envbuilder/testutil/mwtest" @@ -502,7 +502,7 @@ func TestBuildFromDockerfile(t *testing.T) { require.Equal(t, "hello", strings.TrimSpace(output)) // Verify that the Docker configuration secret file is removed - configJSONContainerPath := magicdir.Default.Join("config.json") + configJSONContainerPath := workingdir.Default.Join("config.json") output = execContainer(t, ctr, "stat "+configJSONContainerPath) require.Contains(t, output, "No such file or directory") } diff --git a/internal/magicdir/magicdir_internal_test.go b/internal/magicdir/magicdir_internal_test.go deleted file mode 100644 index 43b66ba..0000000 --- a/internal/magicdir/magicdir_internal_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package magicdir - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func Test_MagicDir(t *testing.T) { - t.Parallel() - - t.Run("Default", func(t *testing.T) { - t.Parallel() - require.Equal(t, defaultMagicDirBase+"/foo", Default.Join("foo")) - require.Equal(t, defaultMagicDirBase, Default.Path()) - require.Equal(t, defaultMagicDirBase+"/built", Default.Built()) - require.Equal(t, defaultMagicDirBase+"/image", Default.Image()) - }) - - t.Run("ZeroValue", func(t *testing.T) { - t.Parallel() - var md MagicDir - require.Equal(t, defaultMagicDirBase+"/foo", md.Join("foo")) - require.Equal(t, defaultMagicDirBase, md.Path()) - require.Equal(t, defaultMagicDirBase+"/built", md.Built()) - require.Equal(t, defaultMagicDirBase+"/image", md.Image()) - }) - - t.Run("At", func(t *testing.T) { - t.Parallel() - tmpDir := t.TempDir() - md := At(tmpDir) - require.Equal(t, tmpDir+"/foo", md.Join("foo")) - require.Equal(t, tmpDir, md.Path()) - require.Equal(t, tmpDir+"/built", md.Built()) - require.Equal(t, tmpDir+"/image", md.Image()) - }) -} diff --git a/internal/magicdir/magicdir.go b/internal/workingdir/workingdir.go similarity index 67% rename from internal/magicdir/magicdir.go rename to internal/workingdir/workingdir.go index 5e06251..5df0523 100644 --- a/internal/magicdir/magicdir.go +++ b/internal/workingdir/workingdir.go @@ -1,4 +1,4 @@ -package magicdir +package workingdir import ( "fmt" @@ -6,10 +6,10 @@ import ( ) const ( - // defaultMagicDirBase is the default working location for envbuilder. + // defaultWorkingDirBase is the default working location for envbuilder. // This is a special directory that must not be modified by the user // or images. This is intentionally unexported. - defaultMagicDirBase = "/.envbuilder" + defaultWorkingDirBase = "/.envbuilder" // TempDir is a directory inside the build context inside which // we place files referenced by MagicDirectives. @@ -20,7 +20,7 @@ var ( // Default is the default working directory for Envbuilder. // This defaults to /.envbuilder. It should only be used when Envbuilder // is known to be running as root inside a container. - Default MagicDir + Default WorkingDir // Directives are directives automatically appended to Dockerfiles // when pushing the image. These directives allow the built image to be // 're-used'. @@ -30,33 +30,33 @@ COPY --chmod=0644 %[1]s/image %[2]s/image USER root WORKDIR / ENTRYPOINT ["%[2]s/bin/envbuilder"] -`, TempDir, defaultMagicDirBase) +`, TempDir, defaultWorkingDirBase) ) -// MagicDir is a working directory for envbuilder. It +// WorkingDir is a working directory for envbuilder. It // will also be present in images built by envbuilder. -type MagicDir struct { +type WorkingDir struct { base string } -// At returns a MagicDir rooted at filepath.Join(paths...) -func At(paths ...string) MagicDir { +// At returns a WorkingDir rooted at filepath.Join(paths...) +func At(paths ...string) WorkingDir { if len(paths) == 0 { - return MagicDir{} + return WorkingDir{} } - return MagicDir{base: filepath.Join(paths...)} + return WorkingDir{base: filepath.Join(paths...)} } // Join returns the result of filepath.Join([m.Path, paths...]). -func (m MagicDir) Join(paths ...string) string { +func (m WorkingDir) Join(paths ...string) string { return filepath.Join(append([]string{m.Path()}, paths...)...) } -// String returns the string representation of the MagicDir. -func (m MagicDir) Path() string { - // Instead of the zero value, use defaultMagicDir. +// String returns the string representation of the WorkingDir. +func (m WorkingDir) Path() string { + // Instead of the zero value, use defaultWorkingDir. if m.base == "" { - return defaultMagicDirBase + return defaultWorkingDirBase } return m.base } @@ -65,7 +65,7 @@ func (m MagicDir) Path() string { // when envbuilder has already been run. This is used // to skip building when a container is restarting. // e.g. docker stop -> docker start -func (m MagicDir) Built() string { +func (m WorkingDir) Built() string { return m.Join("built") } @@ -73,11 +73,11 @@ func (m MagicDir) Built() string { // envbuilder has already been run. This is used to skip // the destructive initial build step when 'resuming' envbuilder // from a previously built image. -func (m MagicDir) Image() string { +func (m WorkingDir) Image() string { return m.Join("image") } // Features is a directory that contains feature files. -func (m MagicDir) Features() string { +func (m WorkingDir) Features() string { return m.Join("features") } diff --git a/internal/workingdir/workingdir_internal_test.go b/internal/workingdir/workingdir_internal_test.go new file mode 100644 index 0000000..5e1dfc0 --- /dev/null +++ b/internal/workingdir/workingdir_internal_test.go @@ -0,0 +1,38 @@ +package workingdir + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_WorkingDir(t *testing.T) { + t.Parallel() + + t.Run("Default", func(t *testing.T) { + t.Parallel() + require.Equal(t, defaultWorkingDirBase+"/foo", Default.Join("foo")) + require.Equal(t, defaultWorkingDirBase, Default.Path()) + require.Equal(t, defaultWorkingDirBase+"/built", Default.Built()) + require.Equal(t, defaultWorkingDirBase+"/image", Default.Image()) + }) + + t.Run("ZeroValue", func(t *testing.T) { + t.Parallel() + var md WorkingDir + require.Equal(t, defaultWorkingDirBase+"/foo", md.Join("foo")) + require.Equal(t, defaultWorkingDirBase, md.Path()) + require.Equal(t, defaultWorkingDirBase+"/built", md.Built()) + require.Equal(t, defaultWorkingDirBase+"/image", md.Image()) + }) + + t.Run("At", func(t *testing.T) { + t.Parallel() + tmpDir := t.TempDir() + md := At(tmpDir) + require.Equal(t, tmpDir+"/foo", md.Join("foo")) + require.Equal(t, tmpDir, md.Path()) + require.Equal(t, tmpDir+"/built", md.Built()) + require.Equal(t, tmpDir+"/image", md.Image()) + }) +} diff --git a/options/defaults.go b/options/defaults.go index 2d6cd52..b9e47a8 100644 --- a/options/defaults.go +++ b/options/defaults.go @@ -9,7 +9,7 @@ import ( giturls "github.com/chainguard-dev/git-urls" "github.com/coder/envbuilder/internal/chmodfs" - "github.com/coder/envbuilder/internal/magicdir" + "github.com/coder/envbuilder/internal/workingdir" ) // EmptyWorkspaceDir is the path to a workspace that has @@ -66,6 +66,6 @@ func (o *Options) SetDefaults() { o.BinaryPath = "/.envbuilder/bin/envbuilder" } if o.MagicDirBase == "" { - o.MagicDirBase = magicdir.Default.Path() + o.MagicDirBase = workingdir.Default.Path() } }