mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.85k stars 552 forks source link

Get distributed builds to work with warnings-as-errors #611

Open theres-waldo opened 4 years ago

theres-waldo commented 4 years ago

I tried an sccache distributed build today, and the build failed with errors like this:

 1:38.92 /home/botond/dev/mozilla/central/js/src/jit/MIR.h:8337:218: error: result of comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-unsigned-enum-zero-compare]
 1:38.92     do { static_assert( mozilla::detail::AssertionConditionType<decltype(arrayType >= 0 && arrayType < Scalar::MaxTypedArrayViewType)>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(arrayType >= 0 && arrayType < Scalar::MaxTypedArrayViewType))), 0))) { MOZ_ReportAssertionFailure("arrayType >= 0 && arrayType < Scalar::MaxTypedArrayViewType", "/home/botond/dev/mozilla/central/js/src/jit/MIR.h", 8337); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arrayType >= 0 && arrayType < Scalar::MaxTypedArrayViewType" ")"); do { *((volatile int*)__null) = 8337; ::abort(); } while (false); } } while (false);
 1:38.92                                                                                                                                                                                                                ~~~~~~~~~ ^  ~

Removing ac_add_options --enable-warnings-as-errors from my .mozconfig, fixed the problem, but I would prefer to keep that, since automation builds do use that, and not using it locally can result in surprise Try / autoland build failures.

froydnj commented 4 years ago

I think this is essentially the same issue as #521 and will therefore be addressed by #545.

sigiesec commented 4 years ago

Yes, it's the same issue. That's exactly the reason I can't really use sccache without #545.

froydnj commented 4 years ago

@theres-waldo Does this now work for you with #545 resolved?

theres-waldo commented 4 years ago

It does not appear to; I still get a bunch of Werrors, such as:

 1:45.38 /home/botond/dev/mozilla/central/mfbt/tests/TestAlgorithm.cpp:34:229: error: code will never be executed [-Werror,-Wunreachable-code]
 1:45.38   do { static_assert( mozilla::detail::AssertionConditionType<decltype(!AllOf(begin(arr3), end(arr3), odd))>::isValid, "invalid assertion condition"); if ((__builtin_expect(!!(!(!!(!AllOf(begin(arr3), end(arr3), odd)))), 0))) { MOZ_ReportAssertionFailure("!AllOf(begin(arr3), end(arr3), odd)", "/home/botond/dev/mozilla/central/mfbt/tests/TestAlgorithm.cpp", 34); do { } while (false); do { *((volatile int*)__null) = 34; ::abort(); } while (false); } } while (false);
 1:45.38                                                                                                                                                                                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
chmanchester commented 4 years ago

I was just able to complete a warnings-as-errors build sucessfully with sccache-dist and #545, but this wont work out of the box until we have rewrite_includes_only turned on by default and deploy a new release.

mstange commented 4 years ago

What's needed to turn on rewrite_includes_only by default? Is it blocked on adding a detection mechanism for #652?