Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

output failing package before compile errors #440

Closed
davecheney opened this issue Nov 5, 2015 · 2 comments · Fixed by #442
Closed

output failing package before compile errors #440

davecheney opened this issue Nov 5, 2015 · 2 comments · Fixed by #442
Assignees
Labels

Comments

@davecheney
Copy link
Contributor

Moving the output of the package name til the completion of the compilation, #437 now causes gb to not print the name of the package if there was a compilation failure

lucky(~/src/github.com/constabulary/gb) % gb build
gb.go:71: undefined: "github.com/constabulary/gb/log".Fatalf
FATAL command "build" failed: exit status 2

It's not clear which package gb.go belongs to. This is because the compile failure happens in an action below the final action in gb.Compile, so the action is skipped, skipping the logging.

This may be ameliorated if #406 is addressed, but it might need a direct fix.

@davecheney davecheney added the bug label Nov 5, 2015
@davecheney davecheney self-assigned this Nov 5, 2015
@sevein
Copy link

sevein commented Nov 7, 2015

Aye! Same issue here, glad you noticed it.

$ gb build
main.go:26: foo declared and not used
main.go:20: bar declared and not used
FATAL command "build" failed: exit status 2

^ where the two errors come from different packages.

@davecheney
Copy link
Contributor Author

I'm working on a fix right now. I'll do a 0.3.1 bugfix release soon

davecheney added a commit that referenced this issue Nov 8, 2015
Fixes #440

Prior to #437 the name of the package under compile or test would be
printed *before* the operation started. This was a problem, because the
compilation output could occur later, and not line up with the package
name.

After #437, package name output was surpressed until the compile/test
action completed successfully. This helped improve the output for tests
but as the overall action, the print would never occur, only the output
to stdout from the child process.

This PR solves the problem at the source by delegating the responsibility
for printing the name of the package before any child output. If all
actions complete, then the final action in the set will print the name
of the package.

As it is now unused, `context.run` has been removed.

TODO:

- [ ] decide if the output should go to stderr, not stdout
- [ ] decide if we should include a # prefix as the go tool does
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants