Commit Graph

20 Commits

Author SHA1 Message Date
rosica ba06942f95 Fix flag parsing
PiperOrigin-RevId: 232470483
2019-02-05 05:57:20 -08:00
Googler f76ab4888a Migrate Apple CROSSTOOL to starlark.
RELNOTES: None.
PiperOrigin-RevId: 231209609
2019-01-28 06:40:54 -08:00
rosica b3a83d701a Add a script for converting CROSSTOOL files to Starlark rules
Progress towards issue #5380

RELNOTES: None
PiperOrigin-RevId: 230795058
2019-01-24 14:54:38 -08:00
hlopko ddf13fe1da Don't require supports_fission to be set in the crosstool
Having a 'per_object_debug_data' feature enabled is giving the same signal as having supports_fission enabled. This is a safe change because all crosstools that have supports_fission: true have per_object_debug_info disabled, and with the legacy crosstool fields migration we will migrate this feature to be enabled by default for these crosstools.

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 230701029
2019-01-24 04:55:15 -08:00
hlopko a9932b3939 Make ctoolchain_compare.bzl more robust by using ctx.label.name as generated files name.
This ensures that the generated files will be unique in the package and therefore there won't be action conflict.

RELNOTES: None.
PiperOrigin-RevId: 230514342
2019-01-23 05:42:09 -08:00
Googler da4639bd1f Actually cause the comparator / test to fail when there is an error reading one
of the toolchains.

Cosmetic spacing fixes for strings that will be concatenated and fixed a typo.

PiperOrigin-RevId: 229961708
2019-01-18 11:20:25 -08:00
Googler dc71ef6ea6 Make it possible to test multiple configs in the same BUILD file.
PiperOrigin-RevId: 229960389
2019-01-18 11:13:22 -08:00
rosica 0627ae379c Create a test rule that compares CToolchains from CROSSTOOL file and from Starlark rule
Work towards issue #5380
RELNOTES: None
PiperOrigin-RevId: 229928313
2019-01-18 07:56:03 -08:00
rosica f64680e017 Make ctoolchain_comparator.py throw exit(1) when CToolchains differ
While here, Also fix _read_crosstool_or_ctoolchain_proto to actually return the CToolchain found in the CROSSTOOL file, and add some missing \n.

RELNOTES: None.
PiperOrigin-RevId: 229926500
2019-01-18 07:37:16 -08:00
hlopko f9cdb36627 Always put linker_flags from linking_mode_flags.DYNAMIC to nodeps-dynamic-library
This cl fixes a bug in the migrator where it didn't pass mentioned flags to c++-nodeps-dynamic-library unconditionally (it only passed them as with feature { feature: 'dynamic_linking_mode' }, which is incorrect, the feature doesn't not apply to nodeps-dynamic-library, only to transitive linking actions.

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 229692958
2019-01-17 00:07:27 -08:00
hlopko 0fd5bb9b75 Rename/remove fields referencing legacy features in legacy_fields_migrator
When renaming legacy_*_flags to default_*_flags, also rename other fields such as requires.

We're intentionally not replacing the implies line, just removing it, because default_*_features are enabled by default, so they don't need to be implied (Implied field is older than enabled field, so there are uses of it where enabled would work just fine. The only semantic difference is that implied features cannot be disabled, whereas enabled can. But since the standard style of writing crosstools seems to prefer enabled, I'm doing the same here.)

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 229518029
2019-01-16 01:41:22 -08:00
hlopko 04195ada17 Fix legacy_fields_migrator
Another round of fixes:

* if the toolchain contains legacy_compile_flags or legacy_link_flags, replace the feature with default_compile_flags or default_link_flags. This is to ensure the location of the flags stays intact.
* it fixes the order of compilation flags, the correct order is:
  1) compiler_flag
  2) compilation_mode_flags.compiler_flag
  3) cxx_flag
  4) compilation_mode_flags.cxx_flag
* We don't add cxx_flags to assemble and preprocess-assemble actions
* We don't add sysroot to assemble action

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 229336027
2019-01-15 02:09:19 -08:00
hlopko c0ac741cbe Improve legacy_fields_migrator to work properly for objc crosstools
https://github.com/bazelbuild/bazel/issues/5883
https://github.com/bazelbuild/bazel/issues/6861

RELNOTES: None.
PiperOrigin-RevId: 228839863
2019-01-11 00:11:34 -08:00
rosica 175f81c847 Add a script for comparing CToolchian built from different CROSSTOOL/Ctoolchain proto text files
Progress towards #5380

RELNOTES: None.
PiperOrigin-RevId: 228312688
2019-01-09 08:59:20 +01:00
hlopko 63003094c9 Make cc_embed_data.bzl forward compatible with removal of legacy crosstool fields
RELNOTES: None
PiperOrigin-RevId: 228301880
2019-01-09 08:58:59 +01:00
hlopko f835b8bea2 Fix legacy_fields_migrator
This cl fixes:

* clears 'supports_embedded_runtimes'
* adds user_compile_flags and sysroot feature
  * these are needed to appear before unfiltered_compile_flags

Progress towards:
https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 228299172
2019-01-09 08:58:48 +01:00
hlopko 30e32836fa Add --inline option to legacy_fields_migrator
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 227827560
2019-01-09 08:58:04 +01:00
hlopko b809b1312f Fix edge cases of legacy crosstool migrator
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 227688115
2019-01-09 08:57:53 +01:00
hlopko 46dc52e008 Add crosstool_query
A quick hack of a tool that will be used for removing runtime filegroups

Issue for the --incompatible_disable_runtimes_filegroups incompatible flag
(which this cl is a step towards to): #6942
Tracking issue for legacy crosstool fields removal: #5883

RELNOTES: None.
PiperOrigin-RevId: 225995150
2019-01-09 08:56:21 +01:00
hlopko e1d74cbe59 Move legacy_fields_migrator to rules_cc
Needed for --incompatible_disable_legacy_crosstool_fields migration: https://github.com/bazelbuild/bazel/issues/6861
Tracking issue: https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 225956311
2019-01-09 08:56:10 +01:00