allow per-jvm-target configuration of fatal warnings

Review Request #3080 - Created Nov. 5, 2015 and submitted

Information
Matt Landis
pants
2504
2456
Reviewers
pants-reviews
benjyw, nhoward_tw, stuhood

Problem

Given a large codebase with many warnings that are ignored in practice, it's very expensive to simply add -Xfatal-warnings (scala) or -Werror (java) to the compiler args, since that'd require actually fixing all the warnings in one go. This means that developers/projects that desire fatal warnings cannot have them, and fatal warnings cannot be made the default for new code.

Solution

Add a compile.zinc option default-fatal-warnings that controls whether fatal warnings are enabled in compilation.
Add a jvm_target option fatal_warnings that trumps --compile-zinc-default-fatal-warnings for that particular target.

Result

Large legacy codebases with warnings can:
set default-fatal-warnings to False and allow individual targets to opt in as appropriate
or
set default-fatal-warnings to True, add fatal_warnings=False to all existing jvm targets in their BUILD files, and work on removing those lines target by target, while new targets get fatal warnings by default.

https://travis-ci.org/pantsbuild/pants/builds/91050661

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Matt Landis
Matt Landis
Matt Landis
Benjy Weinberger
Matt Landis
Matt Landis
Matt Landis
Benjy Weinberger
Stu Hood
Matt Landis
Stu Hood
Matt Landis
Review request changed

Status: Closed (submitted)

Change Summary:

Merged as e7d48dfb5e3d6dab51a02d3701ecc71f5613d774

Loading...