| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
|
Review request for pants-reviews, Benjy Weinberger, Ity Kaul, Mateo Rodriguez, Nick Howard (Twitter), Stu Hood, Yi Cheng, and Eric Ayers.
By Peiyu Wang.
Bugs:
4052
Repository:
pants
Description
Testing
Diffs
|
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
| src/python/pants/backend/jvm/subsystems/zinc_language_mixin.py (Diff revision 1) | |||
|---|---|---|---|
| 27 | removal_hint='Please use --compile-zinc-default-extra-compile-options.') |
||
It remains important to be able to specify different defaults for these settings based on which language is in play... so I think that the
extra-compile-optionsshould likely be on thezinc_language_mixinrather than on zinc itself.
| src/python/pants/backend/jvm/targets/jvm_target.py (Diff revision 1) | |||
|---|---|---|---|
| 78 | :param extra_compile_options: List of zinc options that reference to compile option settings |
||
| 79 | by their names. |
||
| 80 | :type extra_compile_options: list |
||
This will be the public documentation string for this option, so it deserves a lot more attention... in particular, this should make it clear where the option sets are configured (under
--${lang}-extra-compile-options, etc), and that this is not the literal options themselves.
| src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py (Diff revision 1) | |||
|---|---|---|---|
| 205 | "Optionally prefix '+' to enable, and '-' to disable") |
||
This is already natively supported by list options? Might be good to just refer to the documentation for list options, or refer to this technique by name: http://www.pantsbuild.org/options.html#list-options
| src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py (Diff revision 1) | |||
|---|---|---|---|
| 434 | for option_name in option_names: |
||
| 435 | modifier, option_name_configured = extract_modifier(option_name) |
||
Aha, I see what you were doing with the modifiers. This makes sense, but it's going to be very, very important to ensure that the behaviour is consistent with the command line behaviour of
list_option.I also wonder whether it wouldn't be a good idea to delay adding support for
+/-modifiers for now, since we're not expecting huge lists of options to exist anytime soon.
- Stu Hood
On November 14th, 2016, 7:30 p.m. UTC, Peiyu Wang wrote:
|
Review request for pants-reviews, Benjy Weinberger, Ity Kaul, Mateo Rodriguez, Nick Howard (Twitter), Stu Hood, Yi Cheng, and Eric Ayers.
By Peiyu Wang.
|
Updated Nov. 14, 2016, 7:30 p.m. |
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/targets/jvm_target.py (Diff revision 1) 78 :param extra_compile_options: List of zinc options that reference to compile option settings79 by their names.80 :type extra_compile_options: listThis will be the public documentation string for this option, so it deserves a lot more attention... in particular, this should make it clear where the option sets are configured (under
--${lang}-extra-compile-options, etc), and that this is not the literal options themselves.
To be clear, where
fatal-warningslives now is on--scala-platform-fatal-warningsor--java-fatal-warnings, and that's a good thing.
Also, to take back one thing I said earlier: I think that we might not want to move
strict_depsto this system. In particular, strict_deps is not an extra argument to the compiler... rather, it affects pants' behaviour. And we want it to affect pants' behaviour even more by affecting invalidation.
- Stu
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/subsystems/zinc_language_mixin.py (Diff revision 1) 27 removal_hint='Please use --compile-zinc-default-extra-compile-options.')It remains important to be able to specify different defaults for these settings based on which language is in play... so I think that the
extra-compile-optionsshould likely be on thezinc_language_mixinrather than on zinc itself.
will move
extra_compile_optionsinto language mixin.
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/targets/jvm_target.py (Diff revision 1) 78 :param extra_compile_options: List of zinc options that reference to compile option settings79 by their names.80 :type extra_compile_options: listThis will be the public documentation string for this option, so it deserves a lot more attention... in particular, this should make it clear where the option sets are configured (under
--${lang}-extra-compile-options, etc), and that this is not the literal options themselves.
On November 14th, 2016, 8:53 p.m. UTC, Stu Hood wrote:
To be clear, where
fatal-warningslives now is on--scala-platform-fatal-warningsor--java-fatal-warnings, and that's a good thing.
Also, to take back one thing I said earlier: I think that we might not want to move
strict_depsto this system. In particular, strict_deps is not an extra argument to the compiler... rather, it affects pants' behaviour. And we want it to affect pants' behaviour even more by affecting invalidation.
will improve comment
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py (Diff revision 1) 434 for option_name in option_names:435 modifier, option_name_configured = extract_modifier(option_name)Aha, I see what you were doing with the modifiers. This makes sense, but it's going to be very, very important to ensure that the behaviour is consistent with the command line behaviour of
list_option.I also wonder whether it wouldn't be a good idea to delay adding support for
+/-modifiers for now, since we're not expecting huge lists of options to exist anytime soon.
+/-orenable/disableis needed because there are three states:enable,disable,not present. If it's just two, being present and not present is sufficient.from twitter repo:
fatal_warnings_enabled_args: [ '-S-deprecation:false', '-C-Xlint:-deprecation', '-S-Xfatal-warnings', '-C-Werror', ] fatal_warnings_disabled_args: [ '-S-deprecation', ]to be clear,
+/-here is a little arbitrary, I just need a more concise representation for negation,!would also work, i guess, if that helps with confusion.
- Peiyu
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py (Diff revision 1) 434 for option_name in option_names:435 modifier, option_name_configured = extract_modifier(option_name)Aha, I see what you were doing with the modifiers. This makes sense, but it's going to be very, very important to ensure that the behaviour is consistent with the command line behaviour of
list_option.I also wonder whether it wouldn't be a good idea to delay adding support for
+/-modifiers for now, since we're not expecting huge lists of options to exist anytime soon.
On November 15th, 2016, 1:15 a.m. UTC, Peiyu Wang wrote:
+/-orenable/disableis needed because there are three states:enable,disable,not present. If it's just two, being present and not present is sufficient.from twitter repo:
fatal_warnings_enabled_args: [ '-S-deprecation:false', '-C-Xlint:-deprecation', '-S-Xfatal-warnings', '-C-Werror', ] fatal_warnings_disabled_args: [ '-S-deprecation', ]to be clear,
+/-here is a little arbitrary, I just need a more concise representation for negation,!would also work, i guess, if that helps with confusion.
should have mentioned, the alternative is not using modifier but just add
fatal_warning_disabled,zinc_file_manager_disabledas separate config entries, which is fine too.
- Peiyu
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py (Diff revision 1) 434 for option_name in option_names:435 modifier, option_name_configured = extract_modifier(option_name)Aha, I see what you were doing with the modifiers. This makes sense, but it's going to be very, very important to ensure that the behaviour is consistent with the command line behaviour of
list_option.I also wonder whether it wouldn't be a good idea to delay adding support for
+/-modifiers for now, since we're not expecting huge lists of options to exist anytime soon.
On November 15th, 2016, 1:15 a.m. UTC, Peiyu Wang wrote:
+/-orenable/disableis needed because there are three states:enable,disable,not present. If it's just two, being present and not present is sufficient.from twitter repo:
fatal_warnings_enabled_args: [ '-S-deprecation:false', '-C-Xlint:-deprecation', '-S-Xfatal-warnings', '-C-Werror', ] fatal_warnings_disabled_args: [ '-S-deprecation', ]to be clear,
+/-here is a little arbitrary, I just need a more concise representation for negation,!would also work, i guess, if that helps with confusion.
On November 15th, 2016, 1:18 a.m. UTC, Peiyu Wang wrote:
should have mentioned, the alternative is not using modifier but just add
fatal_warning_disabled,zinc_file_manager_disabledas separate config entries, which is fine too.
IMO: "not present" == "disable", but it would be good to check with Matt Landis about this. I think the case of "disabled options" and "enabled options" like that could potentially be better modeled as just independent sets (perhaps via a
no-prefix, similar to command line arguments).In particular, I think the
fatal_warnings_enabled_argsandfatal_warnings_disabled_argssets are more a symptom of not having enough flexibility in how options are specified.
- Stu
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
On November 14th, 2016, 8:50 p.m. UTC, Stu Hood wrote:
src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py (Diff revision 1) 434 for option_name in option_names:435 modifier, option_name_configured = extract_modifier(option_name)Aha, I see what you were doing with the modifiers. This makes sense, but it's going to be very, very important to ensure that the behaviour is consistent with the command line behaviour of
list_option.I also wonder whether it wouldn't be a good idea to delay adding support for
+/-modifiers for now, since we're not expecting huge lists of options to exist anytime soon.
On November 15th, 2016, 1:15 a.m. UTC, Peiyu Wang wrote:
+/-orenable/disableis needed because there are three states:enable,disable,not present. If it's just two, being present and not present is sufficient.from twitter repo:
fatal_warnings_enabled_args: [ '-S-deprecation:false', '-C-Xlint:-deprecation', '-S-Xfatal-warnings', '-C-Werror', ] fatal_warnings_disabled_args: [ '-S-deprecation', ]to be clear,
+/-here is a little arbitrary, I just need a more concise representation for negation,!would also work, i guess, if that helps with confusion.On November 15th, 2016, 1:18 a.m. UTC, Peiyu Wang wrote:
should have mentioned, the alternative is not using modifier but just add
fatal_warning_disabled,zinc_file_manager_disabledas separate config entries, which is fine too.
On November 15th, 2016, 1:48 a.m. UTC, Stu Hood wrote:
IMO: "not present" == "disable", but it would be good to check with Matt Landis about this. I think the case of "disabled options" and "enabled options" like that could potentially be better modeled as just independent sets (perhaps via a
no-prefix, similar to command line arguments).In particular, I think the
fatal_warnings_enabled_argsandfatal_warnings_disabled_argssets are more a symptom of not having enough flexibility in how options are specified.
Another example:
--warning-argsalso has 3 states:compile.zinc.no_warning_args = ['-S-nowarn'] (from CONFIG) compile.zinc.warning_args = ['-S-deprecation', '-S-unchecked', '-S-feature'] (from CONFIG)This looks pretty reasonable:
no_warningneeds to set-S-nowarn
- Peiyu
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
I like it in general, but it might make sense for fatal_warnings should remain separate, because it can be thought of as a language-level setting, not a compiler implementation detail setting.
- Benjy Weinberger
On November 14th, 2016, 7:30 p.m. UTC, Peiyu Wang wrote:
|
Review request for pants-reviews, Benjy Weinberger, Ity Kaul, Mateo Rodriguez, Nick Howard (Twitter), Stu Hood, Yi Cheng, and Eric Ayers.
By Peiyu Wang.
|
Updated Nov. 14, 2016, 7:30 p.m.
Bugs:
4052
|
| This is an automatically generated e-mail. To reply, visit: https://rbcommons.com/s/twitter/r/4374/ |
So I am all for moving to a generic way of passing options to zinc. But how to interact with the new system is not very clear - sometimes the hints just say use extra_compile_options and other times it recommends
default_extra_options. I eventually saw more info in the tests, but that would not have been clear to me if I had just hit the deprecation warning.Can you add an example to the docs or at least inlined in the code?
- Mateo Rodriguez
On November 14th, 2016, 1:30 p.m. CST, Peiyu Wang wrote:
|
Review request for pants-reviews, Benjy Weinberger, Ity Kaul, Mateo Rodriguez, Nick Howard (Twitter), Stu Hood, Yi Cheng, and Eric Ayers.
By Peiyu Wang.
|
Updated Nov. 14, 2016, 1:30 p.m. |