Skip to content

Suppress compile summary stats if --quiet flag is set on compile. #2820

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 10 commits into from
Jan 24, 2025
Prev Previous commit
Next Next commit
Output 'ctags' command line to stdout instead of stderr
  • Loading branch information
cmaglie committed Jan 23, 2025
commit a596028dd3b0affafc26e2494ffd650a63716035
15 changes: 7 additions & 8 deletions internal/arduino/builder/internal/preprocessor/ctags.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ func PreprocessSketchWithCtags(
}

// Run CTags on gcc-preprocessed source
ctagsOutput, ctagsStdErr, err := RunCTags(ctx, ctagsTarget, buildProperties)
ctagsOutput, ctagsStdErr, ctagsCmdLine, err := RunCTags(ctx, ctagsTarget, buildProperties)
if verbose {
stdout.Write([]byte(ctagsCmdLine + "\n"))
stderr.Write(ctagsStdErr)
}
if err != nil {
Expand Down Expand Up @@ -178,7 +179,7 @@ func isFirstFunctionOutsideOfSource(firstFunctionLine int, sourceRows []string)
}

// RunCTags performs a run of ctags on the given source file. Returns the ctags output and the stderr contents.
func RunCTags(ctx context.Context, sourceFile *paths.Path, buildProperties *properties.Map) ([]byte, []byte, error) {
func RunCTags(ctx context.Context, sourceFile *paths.Path, buildProperties *properties.Map) ([]byte, []byte, string, error) {
ctagsBuildProperties := properties.NewMap()
ctagsBuildProperties.Set("tools.ctags.path", "{runtime.tools.ctags.path}")
ctagsBuildProperties.Set("tools.ctags.cmd.path", "{path}/ctags")
Expand All @@ -189,24 +190,22 @@ func RunCTags(ctx context.Context, sourceFile *paths.Path, buildProperties *prop

pattern := ctagsBuildProperties.Get("pattern")
if pattern == "" {
return nil, nil, errors.New(i18n.Tr("%s pattern is missing", "ctags"))
return nil, nil, "", errors.New(i18n.Tr("%s pattern is missing", "ctags"))
}

commandLine := ctagsBuildProperties.ExpandPropsInString(pattern)
parts, err := properties.SplitQuotedString(commandLine, `"'`, false)
if err != nil {
return nil, nil, err
return nil, nil, "", err
}
proc, err := paths.NewProcess(nil, parts...)
if err != nil {
return nil, nil, err
return nil, nil, "", err
}
stdout, stderr, err := proc.RunAndCaptureOutput(ctx)

// Append ctags arguments to stderr
args := fmt.Sprintln(strings.Join(parts, " "))
stderr = append([]byte(args), stderr...)
return stdout, stderr, err
return stdout, stderr, args, err
}

func filterSketchSource(sketch *sketch.Sketch, source io.Reader, removeLineMarkers bool) string {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy