Skip to content

Commit

Permalink
Fixed missing ARDUINO_USER_AGENT env var
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Jan 15, 2024
1 parent 4db66a8 commit 94b5c50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions commands/compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
paths.NewPathList(req.GetLibrary()...),
outStream, errStream, req.GetVerbose(), req.GetWarnings(),
progressCB,
pme.GetEnvVarsForSpawnedProcess(),
)
if err != nil {
if strings.Contains(err.Error(), "invalid build properties") {
Expand Down
6 changes: 5 additions & 1 deletion internal/arduino/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ type Builder struct {

libsDetector *detector.SketchLibrariesDetector

toolEnv []string

// This is a function used to parse the output of the compiler
// It is used to extract errors and warnings
compilerOutputParser diagnostics.CompilerOutputParserCB
Expand Down Expand Up @@ -133,6 +135,7 @@ func NewBuilder(
libraryDirs paths.PathList,
stdout, stderr io.Writer, verbose bool, warningsLevel string,
progresCB rpc.TaskProgressCB,
toolEnv []string,
) (*Builder, error) {
buildProperties := properties.NewMap()
if boardBuildProperties != nil {
Expand Down Expand Up @@ -216,6 +219,7 @@ func NewBuilder(
buildArtifacts: &buildArtifacts{},
targetPlatform: targetPlatform,
actualPlatform: actualPlatform,
toolEnv: toolEnv,
libsDetector: detector.NewSketchLibrariesDetector(
libsManager, libsResolver,
useCachedLibrariesResolution,
Expand Down Expand Up @@ -521,7 +525,7 @@ func (b *Builder) prepareCommandForRecipe(buildProperties *properties.Map, recip
}
}

command, err := paths.NewProcess(nil, parts...)
command, err := paths.NewProcess(b.toolEnv, parts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 94b5c50

Please sign in to comment.