Skip to content

Commit

Permalink
unremove gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed May 5, 2018
1 parent 59168e3 commit 948856d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
19 changes: 19 additions & 0 deletions src/python/pants/backend/native/subsystems/gcc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

import os

from pants.binaries.binary_tool import ExecutablePathProvider, NativeTool


class GCC(NativeTool, ExecutablePathProvider):
options_scope = 'gcc'
default_version = '7.3.0'
archive_type = 'tgz'

def path_entries(self):
return [os.path.join(self.select(), 'bin')]
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)

from pants.backend.native.subsystems.llvm import LLVM
from pants.backend.native.subsystems.clang import Clang
from pants.backend.native.subsystems.gcc import GCC
from pants.backend.native.subsystems.platform_specific.darwin.xcode_cli_tools import XCodeCLITools
from pants.backend.native.subsystems.platform_specific.linux.binutils import Binutils
from pants.binaries.binary_tool import ExecutablePathProvider
Expand Down Expand Up @@ -40,7 +41,7 @@ class NativeToolchain(Subsystem, ExecutablePathProvider):

# This is a list of subsystems which implement `ExecutablePathProvider` and
# can be provided for all supported platforms.
_CROSS_PLATFORM_SUBSYSTEMS = [LLVM]
_CROSS_PLATFORM_SUBSYSTEMS = [Clang, GCC]

# This is a map of {<platform> -> [<subsystem_cls>, ...]}; the key is the
# normalized OS name, and the value is a list of subsystem class objects that
Expand Down
3 changes: 2 additions & 1 deletion src/python/pants/backend/python/tasks/setup_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def as_env_dict(self):

@rule(SetupPyInvocationEnvironment, [Select(NativeToolchain)])
def get_setup_py_env(native_toolchain):
joined_path = get_joined_path(native_toolchain.path_entries())
joined_path = get_joined_path(
native_toolchain.path_entries(), os.environ.copy())
return SetupPyInvocationEnvironment(joined_path)


Expand Down

0 comments on commit 948856d

Please sign in to comment.