0

I have a recurring problem when trying to fix build errors. It is especially acute when I am trying to learn a new technology, such as Angular 2. In such a situation, I may make a change, attempting to fix some error I've never seen before. The result is a new error.

The problem is that I don't know whether the new error is earlier in the build process than the old one or later. So did my change fix a problem, thereby uncovering the next error? Or did it create a new problem, thereby covering up the old one? I don't know!

I'm wondering if there is a way to determine that? Some kind of numerical measure of how far a build gets would likely do it. For example, if the build system were to count "steps that succeeded", where the definition of a "step" could be just about anything at all, as long as build progress triggers at least one step, that would be good enough.

Lastly, if the answer is that "you can't tell", please don't be afraid to say that. I've noticed a recurring problem on SO where if someone asks how to do something, and the answer is it can't be done, people get mad at the question, rather than just saying "you can't do that."

William Jockusch
  • 26,513
  • 49
  • 182
  • 323
  • I would start using git, because you can push your current version onto an online repository and continue to work on your code. If something breaks, then you can always go to a previous version and check to see the code differences. – C. Lightfoot Jul 31 '17 at 17:28
  • trust me I'm using git, and I commit early and often. – William Jockusch Jul 31 '17 at 17:30
  • Unit testing can test individual functions to see if they fail, but that may take you time (even though unit tests should always be created). Jenkins is a useful for continuous integration, and it has many plugins (e.g. the Build Failure Analyzer) which may help you. I have been using Maven personally as of late for building, instead of MSBuild, if you want to try that out. – C. Lightfoot Jul 31 '17 at 17:36
  • Some more info could help about the structure of your angular solution and the way the build is done. Usually, each build on the front is following some tasks in a declared order. This way you can point to which step is failing and go deeper to fix your errors. – BogdanC Jul 31 '17 at 17:48
  • I'm not sure if I fully understand what you want, but you could use a custom logger which counts number of log lines before an error occurs. I'm not sure if that is an accurate measurement of 'earlier in the build' though, especially not when building multiple projects/source files in parallel. See e.g. https://stackoverflow.com/a/17515854/128384 for how to implement a custom logger. – stijn Jul 31 '17 at 18:33

1 Answers1

1

Based on the comments, my assumption is that what I am looking for doesn't exist, except very crudely. One could look at the elapsed time before the first build error. Obviously that is not reliable.

William Jockusch
  • 26,513
  • 49
  • 182
  • 323