Skip to content

Commit

Permalink
Prepare for 1.11.0.dev0 release (pantsbuild#6503)
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion authored and Stu Hood committed Sep 19, 2018
1 parent 0614842 commit 2de82e5
Show file tree
Hide file tree
Showing 15 changed files with 200 additions and 199 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,4 @@ def _resolved_export_info(self):

@property
def _copy_target_attributes(self):
return ['provides', 'strict_deps', 'fatal_warnings']
return ['provides', 'strict_deps']
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def _test_create_build_str(self, language, compiler_args):
language='{language}',
compiler_args={compiler_args},
strict_deps=True,
fatal_warnings=False,
)
'''.format(language=language, compiler_args=compiler_args_str))

Expand Down Expand Up @@ -134,7 +133,6 @@ def _test_help(self, language, library_type, compiler_args, sources):
self.assertEqual(call_kwargs['provides'], None)
self.assertEqual(call_kwargs['derived_from'], target)
self.assertEqual(call_kwargs['strict_deps'], True)
self.assertEqual(call_kwargs['fatal_warnings'], False)

sources = call_kwargs['sources']
self.assertEqual(sources.files, ())
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.0rc0
1.11.0.dev0
21 changes: 1 addition & 20 deletions src/python/pants/backend/jvm/subsystems/zinc_language_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

from builtins import object

from pants.base.deprecated import deprecated


class ZincLanguageMixin(object):
"""A mixin for subsystems for languages compiled with Zinc."""
Expand All @@ -21,12 +19,6 @@ def register_options(cls, register):
register('--strict-deps', advanced=True, default=False, fingerprint=True, type=bool,
help='The default for the "strict_deps" argument for targets of this language.')

register('--fatal-warnings', advanced=True, type=bool,
fingerprint=True,
removal_version='1.11.0.dev0',
removal_hint='Use --compiler-option-sets=fatal_warnings instead of fatal_warnings',
help='The default for the "fatal_warnings" argument for targets of this language.')

register('--compiler-option-sets', advanced=True, default=[], type=list,
fingerprint=True,
help='The default for the "compiler_option_sets" argument '
Expand All @@ -43,24 +35,13 @@ def strict_deps(self):
"""
return self.get_options().strict_deps

@property
@deprecated('1.11.0.dev0', 'Consume fatal_warnings from compiler_option_sets instead.')
def fatal_warnings(self):
"""If true, make warnings fatal for targets that do not specify fatal_warnings.
:rtype: bool
"""
return self.get_options().fatal_warnings

@property
def compiler_option_sets(self):
"""For every element in this list, enable the corresponding flags on compilation
of targets.
:rtype: list
"""
option_sets = self.get_options().compiler_option_sets
if 'fatal_warnings' not in option_sets and self.get_options().fatal_warnings:
option_sets.append('fatal_warnings')
return option_sets
return self.get_options().compiler_option_sets

@property
def zinc_file_manager(self):
Expand Down
31 changes: 0 additions & 31 deletions src/python/pants/backend/jvm/targets/jvm_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from pants.backend.jvm.subsystems.jvm_platform import JvmPlatform
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.targets.jarable import Jarable
from pants.base.deprecated import deprecated_conditional
from pants.base.payload import Payload
from pants.base.payload_field import ExcludesField, PrimitiveField, PrimitivesSetField
from pants.build_graph.resources import Resources
Expand Down Expand Up @@ -39,7 +38,6 @@ def __init__(self,
platform=None,
strict_deps=None,
exports=None,
fatal_warnings=None,
compiler_option_sets=None,
zinc_file_manager=None,
# Some subclasses can have both .java and .scala sources
Expand Down Expand Up @@ -83,8 +81,6 @@ def __init__(self,
dependents have access to the closure of exports. An example will be that
if A exports B, and B exports C, then any targets that depends on A will
have access to both B and C.
:param bool fatal_warnings: Whether to turn warnings into errors for this target. If present,
takes priority over the language's fatal-warnings option. Deprecated.
:param bool zinc_file_manager: Whether to use zinc provided file manager that allows
transactional rollbacks, but in certain cases may conflict with
user libraries.
Expand All @@ -97,21 +93,6 @@ def __init__(self,
self.address = address # Set in case a TargetDefinitionException is thrown early
payload = payload or Payload()
excludes = ExcludesField(self.assert_list(excludes, expected_type=Exclude, key_arg='excludes'))
deprecated_conditional(
lambda: fatal_warnings is not None,
removal_version='1.11.0dev0',
entity_description='fatal_warnings',
hint_message="fatal_warnings should be defined as part of the target compiler_option_sets"
)
if fatal_warnings is not None:
compiler_option_sets = [] if compiler_option_sets is None else compiler_option_sets
if fatal_warnings:
compiler_option_sets.append('fatal_warnings')
else:
try:
compiler_option_sets.remove('fatal_warnings')
except ValueError:
pass
payload.add_fields({
'sources': self.create_sources_field(sources, address.spec_path, key_arg='sources'),
'provides': provides,
Expand Down Expand Up @@ -146,18 +127,6 @@ def strict_deps(self):
def export_specs(self):
return self.payload.exports

@property
def fatal_warnings(self):
"""If set, overrides the platform's default fatal_warnings setting.
:return: See constructor.
:rtype: bool or None
"""
if self.payload.compiler_option_sets is not None:
return 'fatal_warnings' in self.payload.compiler_option_sets
else:
return False

@memoized_property
def compiler_option_sets(self):
"""For every element in this list, enable the corresponding flags on compilation
Expand Down
38 changes: 4 additions & 34 deletions src/python/pants/build_graph/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from pants.build_graph.target_scopes import Scope
from pants.fs.fs import safe_filename
from pants.source.payload_fields import SourcesField
from pants.source.wrapped_globs import EagerFilesetWithSpec, Files, FilesetWithSpec, Globs
from pants.source.wrapped_globs import EagerFilesetWithSpec, FilesetWithSpec, Globs
from pants.subsystem.subsystem import Subsystem
from pants.util.memo import memoized_property

Expand Down Expand Up @@ -864,46 +864,16 @@ def create_sources_field(self, sources, sources_rel_path, key_arg=None):
:return: a payload field object representing the sources parameter
:rtype: SourcesField
"""
if sources is None:
# Make sure we don't apply the defaulting to uses of this method other than for
# creating a sources= field (e.g., we also use this for creating resources= fields).
# Note that the check for supports_default_sources() precedes the subsystem check.
# This is so that tests don't need to set up the subsystem when creating targets that
# legitimately do not require sources.
if (key_arg is None or key_arg == 'sources') and self.supports_default_sources():
deprecated_conditional(
lambda: True,
'1.11.0.dev0',
'Default sources should always be parsed through the engine not by create_sources_field. '
'This code should be unreachable, and this message should never be displayed. '
'If you see this message, please contact pants-dev. '
'Class which caused this message: {}'.format(self.__class__.__name__)
)
sources = self.default_sources(sources_rel_path)
else:
sources = FilesetWithSpec.empty(sources_rel_path)
elif isinstance(sources, (set, list, tuple)):
if sources:
# Received a literal sources list: convert to a FilesetWithSpec via Files.
deprecated_conditional(
lambda: True,
'1.11.0.dev0',
('Passing collections as the value of the sources argument to create_sources_field is '
'deprecated, and now takes a slow path. Instead, class {} should have its sources '
'argument populated by the engine, either by using the standard parsing pipeline, or by '
'requesting a SourcesField product from the v2 engine.').format(self.__class__.__name__)
)
sources = Files.create_fileset_with_spec(sources_rel_path, *sources)
else:
sources = FilesetWithSpec.empty(sources_rel_path)
if not sources:
sources = FilesetWithSpec.empty(sources_rel_path)
elif not isinstance(sources, FilesetWithSpec):
key_arg_section = "'{}' to be ".format(key_arg) if key_arg else ""
raise TargetDefinitionException(self, "Expected {}a glob, an address or a list, but was {}"
.format(key_arg_section, type(sources)))
elif not isinstance(sources, EagerFilesetWithSpec):
deprecated_conditional(
lambda: True,
'1.11.0.dev0',
'1.12.0.dev0',
('FilesetWithSpec sources values are deprecated except for EagerFilesetWithSpec values. '
'Saw value of type {}').format(type(sources))
)
Expand Down
63 changes: 63 additions & 0 deletions src/python/pants/notes/master.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,69 @@ Master Pre-Releases
This document describes ``dev`` releases which occur weekly from master, and which do
not undergo the vetting associated with ``stable`` releases.

1.11.0.dev0 (09/14/2018)
------------------------

API Changes
~~~~~~~~~~~

* Upgrade Node.js to 8.11.3 and Yarn to 1.6.0 (#6512)
`PR #6512 <https://github.com/pantsbuild/pants/pull/6512>`_

New features
~~~~~~~~~~~~

* Add extra_jvm_options to jvm_binary targets (#6310)
`PR #6310 <https://github.com/pantsbuild/pants/pull/6310>`_

* [compile.rsc] Add strategy for compiling with Rsc and Zinc (#6408)
`PR #6408 <https://github.com/pantsbuild/pants/pull/6408>`_

* Add support for HTTP basic auth. (#6495)
`PR #6495 <https://github.com/pantsbuild/pants/pull/6495>`_

* gRPC support for golang protobufs. (#6507)
`PR #6507 <https://github.com/pantsbuild/pants/pull/6507>`_

Bugfixes
~~~~~~~~

* make fatal_warnings_enabled_args a tuple instead of just parens (#6497)
`PR #6497 <https://github.com/pantsbuild/pants/pull/6497>`_

* pass through `compatibility` to synthetic python thrift targets (#6499)
`PR #6499 <https://github.com/pantsbuild/pants/pull/6499>`_

* Apply workaround similer to #6409 to bootstrapper (#6498)
`PR #6498 <https://github.com/pantsbuild/pants/pull/6498>`_

* Fix encoding of workunits under pantsd (#6505)
`PR #6505 <https://github.com/pantsbuild/pants/pull/6505>`_

* refactor command line target spec resolution and check that all target roots exist (#6480)
`PR #6480 <https://github.com/pantsbuild/pants/pull/6480>`_

Refactoring, Improvements, and Tooling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* delete unnecessary testproject and broken test (#6494)
`PR #6494 <https://github.com/pantsbuild/pants/pull/6494>`_

* skip integration test with pants_requirement() (#6493)
`PR #6493 <https://github.com/pantsbuild/pants/pull/6493>`_

* Add bootstrapper jar to compile the compile-bridge. (#6462)
`PR #6462 <https://github.com/pantsbuild/pants/pull/6462>`_

* [Hermetic zinc compile] Memoize scalac classpath snapshots (#6491)
`PR #6491 <https://github.com/pantsbuild/pants/pull/6491>`_

* remove FIXME and (cosmicexplorer) comments (#6479)
`PR #6479 <https://github.com/pantsbuild/pants/pull/6479>`_

* Consume the bootstrapper and modify zinc to allow remote exec (#6463)
`PR #6463 <https://github.com/pantsbuild/pants/pull/6463>`_

1.10.0rc0 (09/10/2018)
----------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
java_library(
name='fatal',
fatal_warnings=True,
compiler_option_sets={'fatal_warnings'},
sources=['Warning.java'],
)

java_library(
name='nonfatal',
fatal_warnings=False,
sources=['Warning.java'],
)

java_library(
name='defaultfatal',
compiler_option_sets={},
sources=['Warning.java'],
)
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
scala_library(
name='fatal',
fatal_warnings=True,
compiler_option_sets={'fatal_warnings'},
sources=['Warning.scala'],
)

scala_library(
name='nonfatal',
fatal_warnings=False,
sources=['Warning.scala'],
)

scala_library(
name='defaultfatal',
compiler_option_sets={},
sources=['Warning.scala'],
)
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,21 @@ def test_stale_apt_with_deps(self):
clean_all=False))

def test_fatal_warning(self):
def test_combination(target, default_fatal_warnings, expect_success):
def test_combination(target, expect_success):
with self.temporary_workdir() as workdir:
with self.temporary_cachedir() as cachedir:
if default_fatal_warnings:
arg = '--java-fatal-warnings'
else:
arg = '--no-java-fatal-warnings'
pants_run = self.run_test_compile(
workdir,
cachedir,
'testprojects/src/java/org/pantsbuild/testproject/compilation_warnings:{}'.format(target),
extra_args=[arg, '--compile-zinc-warning-args=-C-Xlint:all'])
extra_args=['--compile-zinc-warning-args=-C-Xlint:all'])

if expect_success:
self.assert_success(pants_run)
else:
self.assert_failure(pants_run)
test_combination('defaultfatal', default_fatal_warnings=True, expect_success=False)
test_combination('defaultfatal', default_fatal_warnings=False, expect_success=True)
test_combination('fatal', default_fatal_warnings=True, expect_success=False)
test_combination('fatal', default_fatal_warnings=False, expect_success=False)
test_combination('nonfatal', default_fatal_warnings=True, expect_success=True)
test_combination('nonfatal', default_fatal_warnings=False, expect_success=True)
test_combination('fatal', expect_success=False)
test_combination('nonfatal', expect_success=True)

def test_classpath_does_not_include_extra_classes_dirs(self):
target_rel_spec = 'testprojects/src/java/org/pantsbuild/testproject/phrases:'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,34 +125,26 @@ def test_zinc_unsupported_option(self):
self.assertIn('is not supported, and is subject to change/removal', pants_run.stdout_data)

def test_zinc_fatal_warning(self):
def test_combination(target, default_fatal_warnings, expect_success, extra_args=[]):
def test_combination(target, expect_success, extra_args=[]):
with self.temporary_workdir() as workdir:
with self.temporary_cachedir() as cachedir:
if default_fatal_warnings:
arg = '--scala-fatal-warnings'
else:
arg = '--no-scala-fatal-warnings'
pants_run = self.run_test_compile(
workdir,
cachedir,
'testprojects/src/scala/org/pantsbuild/testproject/compilation_warnings:{}'.format(
target),
extra_args=[arg] + extra_args)
extra_args=extra_args)

if expect_success:
self.assert_success(pants_run)
else:
self.assert_failure(pants_run)
test_combination('defaultfatal', default_fatal_warnings=True, expect_success=False)
test_combination('defaultfatal', default_fatal_warnings=False, expect_success=True)
test_combination('fatal', default_fatal_warnings=True, expect_success=False)
test_combination('fatal', default_fatal_warnings=False, expect_success=False)
test_combination('nonfatal', default_fatal_warnings=True, expect_success=True)
test_combination('nonfatal', default_fatal_warnings=False, expect_success=True)

test_combination('fatal', default_fatal_warnings=True, expect_success=True,
test_combination('fatal', expect_success=False)
test_combination('nonfatal', expect_success=True)

test_combination('fatal', expect_success=True,
extra_args=['--compile-zinc-fatal-warnings-enabled-args=[\'-C-Werror\']'])
test_combination('fatal', default_fatal_warnings=False, expect_success=False,
test_combination('fatal', expect_success=False,
extra_args=['--compile-zinc-fatal-warnings-disabled-args=[\'-S-Xfatal-warnings\']'])

@unittest.expectedFailure
Expand Down
Loading

0 comments on commit 2de82e5

Please sign in to comment.