{"id":310,"date":"2008-12-03T16:40:15","date_gmt":"2008-12-03T20:40:15","guid":{"rendered":"http:\/\/benjamin.smedbergs.us\/blog\/?p=310"},"modified":"2008-12-03T16:40:15","modified_gmt":"2008-12-03T20:40:15","slug":"parsing-compiler-errors","status":"publish","type":"post","link":"https:\/\/benjamin.smedbergs.us\/blog\/2008-12-03\/parsing-compiler-errors\/","title":{"rendered":"Parsing Compiler Errors"},"content":{"rendered":"<p>Long ago, Mozilla had a tinderbox which would collate every warning produced by the Mozilla build and generate statistics and reports about them. I&#8217;m trying to re-create this tool.<\/p>\n<p>When building Mozilla or most other large software projects that use GNU make, compiler warnings get sent to stdout (and sometimes stderr). The messages usually look something like this:<\/p>\n<pre>..\/..\/..\/dist\/include\/dom\/nsIDOMXULSelectCntrlEl.h:33: warning: \u00e2\u20ac\u02dcvirtual nsresult nsIDOMXULSelectControlElement::GetSelectedItem(nsIDOMXULSelectControlItemElement**)\u00e2\u20ac\u2122 was hidden\r\n..\/..\/..\/dist\/include\/dom\/nsIDOMXULMultSelectCntrlEl.h:73: warning:   by \u00e2\u20ac\u02dcvirtual nsresult nsIDOMXULMultiSelectControlElement::GetSelectedItem(PRInt32, nsIDOMXULSelectControlItemElement**)\u00e2\u20ac\u2122<\/pre>\n<p>All of the file paths in the warning (or set of warnings in this case) are relative to the current working directory. Because the working directory changes during the build as make recurses through subdirectories, automatic parsers need some way to know what the working directory is at any point in the build log. Make provides the -w option which will print the following output every time it recurses into or leaves a directory:<\/p>\n<pre>make[1]: Entering directory \u00e2\u20ac\u02dc\/builds\/static-analysis-buildbot\/slave\/full\/build\u00e2\u20ac\u2122\r\nmake[1]: Leaving directory \u00e2\u20ac\u02dc\/builds\/static-analysis-buildbot\/slave\/full\/build\u00e2\u20ac\u2122<\/pre>\n<p>This is fine if you are only building in one directory at a time. But with the -j option, it is likely that make will be building in multiple directories at once. This will interleave output from multiple jobs in the same log, making it difficult for an automated parser to make any sense of them.<\/p>\n<p>What I&#8217;d like is a tool or technique which will save the build log for each makefile command separately and combine them all at the end of a build.<\/p>\n<p>Pre-emptive snarky comment: &#8220;switch Mozilla to use {scons,waf,cmake,ant,&#8230;}&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Long ago, Mozilla had a tinderbox which would collate every warning produced by the Mozilla build and generate statistics and reports about them. I&#8217;m trying to re-create this tool. When building Mozilla or most other large software projects that use GNU make, compiler warnings get sent to stdout (and sometimes stderr). The messages usually look [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,6],"tags":[30,182],"class_list":["post-310","post","type-post","status-publish","format-standard","hentry","category-mozilla","category-untagged","tag-build-system","tag-make"],"_links":{"self":[{"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/310","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":1,"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/310\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}