Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refined the definition of build_cache.path and the --build-path behaviour #2673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use default user's cache dir instead of tmp for build cache
  • Loading branch information
cmaglie committed Sep 18, 2024
commit d2ffeb06ca6360a211d5aa7ddd11505212ffb1b9
2 changes: 1 addition & 1 deletion 2 commands/service_compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
)

func TestGenBuildPath(t *testing.T) {
want := paths.TempDir().Join("arduino", "sketches", "ACBD18DB4CC2F85CEDEF654FCCC4A4D8")
srv := NewArduinoCoreServer().(*arduinoCoreServerImpl)
want := srv.settings.GetBuildCachePath().Join("sketches", "ACBD18DB4CC2F85CEDEF654FCCC4A4D8")
act := srv.getDefaultSketchBuildPath(&sketch.Sketch{FullPath: paths.New("foo")}, nil)
assert.True(t, act.EquivalentTo(want))
assert.Equal(t, "ACBD18DB4CC2F85CEDEF654FCCC4A4D8", (&sketch.Sketch{FullPath: paths.New("foo")}).Hash())
Expand Down
9 changes: 8 additions & 1 deletion 9 internal/cli/configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,14 @@ func getDefaultUserDir() string {

// getDefaultBuildCacheDir returns the full path to the default build cache folder
func getDefaultBuildCacheDir() string {
return paths.TempDir().Join("arduino").String()
var cacheDir *paths.Path
if p, err := os.UserCacheDir(); err == nil {
cacheDir = paths.New(p)
} else {
// fallback to /tmp
cacheDir = paths.TempDir()
}
return cacheDir.Join("arduino").String()
}

// FindConfigFlagsInArgsOrFallbackOnEnv returns the config file path using the
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.