Rebuild of Debian using Clang 3.5.0

September 11th, 2014

Clang 3.5.0 has just been released. A new rebuild has been done highlight the progress to get Debian built with clang.

tl;dr: Great progress. We decreased from 9.5% to 5.7% of failures. Full results are available on http://clang.debian.net

At time of the rebuild with 3.4.2, we had 2040 packages failing to build with clang. With 3.5.0, this dropped to 1261 packages.

Fixes

With Arthur Marble and Alexander Ovchinnikov, both GSoC students, we worked on various ways to decrease the number of errors.

Upstream fixes

First, the most obvious way, we fixed programming bugs/mistakes in upstream sources. Basically, we took categories of failure and fixed issues one after the other. We started with simple bugs like 'Wrong main declaration', 'non-void function should return a value' or 'Void function should not return a value'.

They are trivial to fix. We continued with harder fixes like ' Undefined reference' or 'Variable length array for a non POD (plain old data) element'.

So, besides these one, we worked on:


In total, we reported 295 bugs with patches. 85 of them have been fixed (meaning that the Debian maintainer uploaded a new version with the fix).

In parallel, I think that the switch by FreeBSD and Mac OS X to Clang also helped to fix various issues by upstreams.

Hacking in clang

As a parallel approach, we started to implement a suggestion from Linus Torvalds and a few others. Instead of trying to fix all upstream, where we can, we tried to update clang to improve the gcc compatibility.

gcc has many flags to disable or enable optimizations. Some of them are legacy, others have no sense in clang, etc. Instead of failing in clang with an error, we create a new category of warnings (showing optimization flag '%0' is not supported) and moved all relevant flags into it. Some examples, r212805, r213365, r214906 or r214907

We also updated clang to silent some useless arguments like -finput_charset=UTF-8 (r212110), clang being UTF-8 compliant.

Finally, we worked on the forwarding of linker flags. Clang and gcc have a very different behavior: when gcc does not know an argument, it is going to forward the argument to the linker. Clang, in this case, is going to reject the argument and fail with an error. In clang, we have to explicitly declare which arguments are going to be transfer to the linker. Of course, the correct way to pass arguments to the linker is to use -Xlinker or -Wl but the Debian rebuild proved that these shortcuts are used. Two of these arguments are now forwarded:

  • -z keyword - r213198
  • -u Force symbol to be entered in the output file as an undefined symbol - r211756. This one fixed most of the haskell build failures. It fixed the most common issue that we had (701 occurrences but this does not mean that all these packages build fine now, some haskell-based package are failing later in the process)

New errors

Just like in other releases, new warnings are added in clang. With (bad) usage of -Werror by upstream software, this causes new build failures:

I also took the opportunity to add some further categorizations in the list of errors. Some examples:

Next steps

The Debile project being close to ready with Clément Schreiner's GSoC, we will now have an automatic and transparent way to rebuild packages using clang.

Conclusion

As stated, we can see a huge drop in term of number of failures over time:

Hopefully, Clang getting better and better, more and more projects adopting it as the default compiler or as a base for plugin/extension developments, this percentage will continue to decrease.
Having some kind of release goal with clang for Jessie+1 can now be considered as potentially reachable.

Want to help?

There are several things which can be done to help:

  • Point me common error patterns in the Not categorized list of errors to create new categories
  • Report and fix packages
  • As an upstream, integrate clang as part of your continuous integration system
  • Hack on cqa-scanlogs, the error detection tool to detect error patterns (example: Undetected error). This tool is used also for the regular rebuilds of the archive.
  • Improve clang.debian.net website

Acknowledgments

Thanks to David Suarez for the rebuilds of the archive, Arthur Marble and Alexander Ovchinnikov for their GSoC works and Nicolas Sévelin-Radiguet for the few fixes.

clang 3.4, 3.5 and 3.6 are now coinstallable in Debian

Août 11th, 2014

Clang is finally co installable on Debian. 3.4, 3.5 and the current trunk (snapshot) can be installed together.

So, just like gcc, the different version can be called with clang-3.4, clang-3.5 or clang-3.6.

/usr/bin/clang, /usr/bin/clang++, /usr/bin/scan-build and /usr/bin/scan-view are now handled through the llvm-defaults package.

llvm-defaults is also now managing clang-check, clang-tblgen, c-index-test, clang-apply-replacements, clang-tidy, pp-trace and clang-query.

Changes are also available on llvm.org/apt/.
The next step will be to manage also llvm-defaults on llvm.org/apt to simplify the transition for people using these packages.

So, with:

# /etc/apt/sources.list
deb http://llvm.org/apt/unstable/ llvm-toolchain main
deb http://llvm.org/apt/unstable/ llvm-toolchain-3.4 main
deb http://llvm.org/apt/unstable/ llvm-toolchain-3.5 main
$ apt-get install clang-3.4 clang-3.5 clang-3.6

$ clang-3.4 --version
Debian clang version 3.4.2 (branches/release_34) (based on LLVM 3.4.2)
Target: x86_64-pc-linux-gnu
Thread model: posix


$ clang-3.5 --version
Debian clang version 3.5.0-+rc2-1~exp1 (tags/RELEASE_350/rc2) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix


$ clang-3.6 --version
Debian clang version 3.6.0-svn214990-1~exp1 (trunk) (based on LLVM 3.6.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

Debian Twitter accounts are back

August 7th, 2014

After some downtime due to the identi.ca changes, the Debian Twitter accounts are now back.

New Twitter feed ideas are welcome.

Auto-comment on the Release Management flags

Juillet 23rd, 2014

Implemented in bug 853108 by the bmo team, using the tracking flags will automatically updated the comment field with some templates.
The goal is to reduce back and forth in Bugzilla on bug tracking. We also hope that is going to improve our response time.

For example, for the tracking requests (tracking-firefoxNN, tracking-firefox-esrNN or blocking-b2g), the user will see the text added into the Bugzilla comment field:

[Tracking Requested - why for this release]:

With this change, we hope to simplify the decision process for the release team.

For the relnotes-* flags:

Release Note Request (optional, but appreciated)
[Why is this notable]:
[Suggested wording]:
[Links (documentation, blog post, etc)]:

This change aims to simplify the process of release notes writing. In some cases, it can be hard for release manager to translate a bug into a new feature description.

Flags on which this option is enabled are:

  • relnote-firefox
  • relnote-b2g
  • tracking-firefoxNN
  • tracking-firefox-esrNN
  • blocking-b2g

Finally, we reported bug 1041964 to discuss about a potential auto-focus on the comment area.

Changes Firefox 30 beta6 to beta7

Mai 27th, 2014
  • 31 changesets
  • 49 files changed
  • 435 insertions
  • 305 deletions

ExtensionOccurrences
js10
jsm7
java7
cpp7
html6
h4
xml3
ini2
sh1
json1
css1

ModuleOccurrences
dom11
toolkit10
mobile10
layout5
browser4
js3
content2
services1
hal1
build1

List of changesets:

Ben TurnerBug 1003766, StopSyncLoopRunnable::Cancel should call base class Cancel. r=mrbkap, a=lsblakk. - 7d980d9af355
Boris ZbarskyBug 976920 - Mostly back out Bug 932322 for now; only define the unforgeable properties on the window object itself. r=jst, a=lsblakk - 1c26f6798184
Drew WillcoxonBug 998303 - browser/base/content/test/general/browser_urlbar_search_healthreport.js attempts to connect to www.google.com. r=mak, a=test-only - 2b437d292f56
Nathan FroydBug 1010322 - Change toolkit/mozapps/extensions/test/browser/ tests to point at actual http servers. r=jmaher, a=test-only - 8438a548150d
Ben TurnerBug 999274 - Wait for the last runnable before calling ShutdownScriptLoader. r=sicking, a=abillings - 50428e91f0bc
Daniel HolbertBug 1000185 - Part 1: Perform synchronous SMIL sample after registering with refresh driver, not before, for consistency. r=birtles, a=abillings - 542f83ec6345
Daniel HolbertBug 1000185 - Part 2: Add a bool to keep track of whether nsSMILAnimationController instances are registered with a refresh driver. r=birtles, a=abillings - cb78c3777143
Marco BonardoBug 992901 - Not all bookmarks are saved in the backup JSON or HTML. r=mano a=sylvestre - 3fb029a11c05
Jim ChenBug 993261 - Remove legacy code for redirecting key events to URL bar. r=lucasr, a=sledru - 869aefb78e22
Alexandre LissyBug 1000337 - Make NotificationStorage cache origin-aware. r=mhenretty, a=abillings - d520b0344613
Dão GottwaldBug 987859 - TabsToolbar margin needs to be dropped when entering fullscreen mode rather than when the sizemode attribute changes, which is too late. r=gijs, a=sledru - 2925e9a0a33d
Benjamin SmedbergBug 959356 - Fix the spelling and type of the isWow64 measurement. r=rnewman, a=sledru - ff1925aa6f85
Marco BonardoBug 997030 - Don't encodeURI twice in bookmarks.html. r=mano a=sylvestre - 05baa07365d9
Lukas Blakkupdating EARLY_BETA_OR_EARLIER a=release-mgmt - 77795a696555
Matteo FerrettiBug 980714 - Remove blinking caret in panel text. r=gozala, a=lsblakk - 4363817b56ca
Randell JesupBug 921622 - AudioStream rework. r=padenot, a=lsblakk - eaa2b716ce89
Ryan VanderMeulenBacked out changeset eaa2b716ce89 (Bug 921622) for mochitest-1 asserts. - b7913b826440
Blair McBrideBug 1012526 - UITour.jsm only registers with UITelemetry when it's lazily imported on-demand. r=mconley a=lsblakk - b19932497b46
Randell JesupBug 921622 - AudioStream rework. r=padenot, a=lsblakk - 3090db8c413f
Mats PalmgrenBug 1007065 - Don't apply the special -moz-hidden-unscrollable clipping on nsTextControlFrame since it always has an anonymous scroll frame that deals with overflow. r=roc, a=lsblakk - 36df173cb6a2
Margaret LeibovicBug 1009473 - Remove padding around list item images. r=lucasr, a=lsblakk - 841a1b085b5b
Margaret LeibovicBug 1009473 - Use lighter gray for item descriptions. r=lucasr, a=lsblakk - 82c33d14844a
Asaf RomanoBug 1003839 - Live bookmark is still created despite cancelling the subscription. r=mak, a=lsblakk - 9b9c4281ccb2
Nicolas B. PierronBug 1013922 - Avoid flattenning strings after each concatenation. r=jorendorff, a=lsblakk - af6bb6bacb0e
Myk MelezBug 991394 - Actually rename profiles.ini sections when removing profile. r=mfinkle, a=lsblakk - eac674ed7cfe
Ted MielczarekBug 1011859 - Order gamepad axes properly. r=jimm, a=sledru - 0bcc74404878
Benjamin BouvierBug 1010747 - Part 1: Cleanups and factor out float32 specialization for unary instructions returning int32. r=jandem, a=sledru - 586ed41fa2d1
Benjamin BouvierBug 1010747 - Part 2: Implement Ceil (floating-point) -> int32 in Ion. r=sunfish, r=mjrosenb, a=sledru - 80950d72bd71
Benjamin BouvierBug 1010747 - Part 3: Factor out floating-point conversion to int32 and bailout code. r=sunfish, a=sledru - 0db12290df12
Ryan VanderMeulenBacked out changesets 0db12290df12, 80950d72bd71, and 586ed41fa2d1 (Bug 1010747) for landing without approval. - a89aa1e3e367
Benjamin BouvierBug 1010747 - Don't inline Ceil when input is a FP value and output is an Int32. r=jandem, a=sledru - d3f2e54cf39c

Previous changelogs: