We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Project can't be cloned correctly on macOS due to case insensitivity
Under the `tfx` folder there's a folder called `build` and a bazel file called `BUILD`. Because macOS is by default case insensitive, only the folder is cloned when `git clone` is run. This means that when trying to build locally, bazel won't be able to find the `BUILD` file required to compile the protobuf schemas, and will fail.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 # Lint as: python2, python3
2 # Copyright 2019 Google LLC. All Rights Reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 """Package Setup script for TFX."""
16 
17 from __future__ import print_function
18 
19 import os
20 import subprocess
21 
22 import setuptools
23 from setuptools import find_packages
24 from setuptools import setup
25 from setuptools.command import develop
26 # pylint: disable=g-bad-import-order
27 # It is recommended to import setuptools prior to importing distutils to avoid
28 # using legacy behavior from distutils.
29 # https://setuptools.readthedocs.io/en/latest/history.html#v48-0-0
30 from distutils import spawn
31 from distutils.command import build
32 # pylint: enable=g-bad-import-order
33 
34 from tfx import dependencies
35 from tfx import version
36 from tfx.tools import resolve_deps
37 
38 
39 class _BuildCommand(build.build):
40   """Build everything that is needed to install.
41 
42   This overrides the original distutils "build" command to to run gen_proto
43   command before any sub_commands.
44 
45   build command is also invoked from bdist_wheel and install command, therefore
46   this implementation covers the following commands:
47     - pip install . (which invokes bdist_wheel)
48     - python setup.py install (which invokes install command)
49     - python setup.py bdist_wheel (which invokes bdist_wheel command)
50   """
51 
52   def _should_generate_proto(self):
53     """Predicate method for running GenProto command or not."""
54     return True
55 
56   # Add "gen_proto" command as the first sub_command of "build". Each
57   # sub_command of "build" (e.g. "build_py", "build_ext", etc.) is executed
58   # sequentially when running a "build" command, if the second item in the tuple
59   # (predicate method) is evaluated to true.
60   sub_commands = [
61       ('gen_proto', _should_generate_proto),
62   ] + build.build.sub_commands
63 
64 
65 class _DevelopCommand(develop.develop):
66   """Developmental install.
67 
68   https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
69   Unlike normal package installation where distribution is copied to the
70   site-packages folder, developmental install creates a symbolic link to the
71   source code directory, so that your local code change is immediately visible
72   in runtime without re-installation.
73 
74   This is a setuptools-only (i.e. not included in distutils) command that is
75   also used in pip's editable install (pip install -e). Originally it only
76   invokes build_py and install_lib command, but we override it to run gen_proto
77   command in advance.
78 
79   This implementation covers the following commands:
80     - pip install -e . (developmental install)
81     - python setup.py develop (which is invoked from developmental install)
82   """
83 
84   def run(self):
85     self.run_command('gen_proto')
86     # Run super().initialize_options. Command is an old-style class (i.e.
87     # doesn't inherit object) and super() fails in python 2.
88     develop.develop.run(self)
89 
90 
91 class _GenProtoCommand(setuptools.Command):
92   """Generate proto stub files in python.
93 
94   Running this command will populate foo_pb2.py file next to your foo.proto
95   file.
96   """
97 
98   def initialize_options(self):
99     pass
100 
101   def finalize_options(self):
102     self._bazel_cmd = spawn.find_executable('bazel')
103     if not self._bazel_cmd:
104       raise RuntimeError(
105           'Could not find "bazel" binary. Please visit '
106           'https://docs.bazel.build/versions/master/install.html for '
107           'installation instruction.')
108 
109   def run(self):
110     subprocess.check_call(
111         [self._bazel_cmd, 'run', '//tfx/build:gen_proto'],
112         # Bazel should be invoked in a directory containing bazel WORKSPACE
113         # file, which is the root directory.
114         cwd=os.path.dirname(os.path.realpath(__file__)),)
115 
116 
117 # Get the long description from the README file.
118 with open('README.md') as fp:
119   _LONG_DESCRIPTION = fp.read()
120 
121 
122 setup(
123     name='tfx',
124     version=version.__version__,
125     author='Google LLC',
126     author_email='tensorflow-extended-dev@googlegroups.com',
127     license='Apache 2.0',
128     classifiers=[
129         'Development Status :: 4 - Beta',
130         'Intended Audience :: Developers',
131         'Intended Audience :: Education',
132         'Intended Audience :: Science/Research',
133         'License :: OSI Approved :: Apache Software License',
134         'Operating System :: OS Independent',
135         'Programming Language :: Python',
136         'Programming Language :: Python :: 3',
137         'Programming Language :: Python :: 3.5',
138         'Programming Language :: Python :: 3.6',
139         'Programming Language :: Python :: 3.7',
140         'Programming Language :: Python :: 3 :: Only',
141         'Topic :: Scientific/Engineering',
142         'Topic :: Scientific/Engineering :: Artificial Intelligence',
143         'Topic :: Scientific/Engineering :: Mathematics',
144         'Topic :: Software Development',
145         'Topic :: Software Development :: Libraries',
146         'Topic :: Software Development :: Libraries :: Python Modules',
147     ],
148     namespace_packages=[],
149     install_requires=dependencies.make_required_install_packages(),
150     extras_require={
151         # In order to use 'docker-image' or 'all', system libraries specified
152         # under 'tfx/tools/docker/Dockerfile' are required
153         'docker-image': dependencies.make_extra_packages_docker_image(),
154         'tfjs': dependencies.make_extra_packages_tfjs(),
155         'all': dependencies.make_all_dependency_packages(),
156     },
157     # TODO(b/158761800): Move to [build-system] requires in pyproject.toml.
158     setup_requires=[
159         'pytest-runner',
160         'poetry==1.0.9',  # Required for ResolveDeps command.
161                           # Poetry API is not officially documented and subject
162                           # to change in the future. Thus fix the version.
163         'clikit>=0.4.3,<0.5',  # Required for ResolveDeps command.
164     ],
165     cmdclass={
166         'build': _BuildCommand,
167         'develop': _DevelopCommand,
168         'gen_proto': _GenProtoCommand,
169         'resolve_deps': resolve_deps.ResolveDepsCommand,
170     },
171     python_requires='>=3.5,<4',
172     packages=find_packages(),
173     include_package_data=True,
174     description='TensorFlow Extended (TFX) is a TensorFlow-based general-purpose machine learning platform implemented at Google',
175     long_description=_LONG_DESCRIPTION,
176     long_description_content_type='text/markdown',
177     keywords='tensorflow tfx',
178     url='https://www.tensorflow.org/tfx',
179     download_url='https://github.com/tensorflow/tfx/tags',
180     requires=[],
181     # Below console_scripts, each line identifies one console script. The first
182     # part before the equals sign (=) which is 'tfx', is the name of the script
183     # that should be generated, the second part is the import path followed by a
184     # colon (:) with the Click command group. After installation, the user can
185     # invoke the CLI using "tfx <command_group> <sub_command> <flags>"
186     entry_points="""
187         [console_scripts]
188         tfx=tfx.tools.cli.cli_main:cli_group
189     """)
190
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -108,7 +108,7 @@
 
   def run(self):
     subprocess.check_call(
-        [self._bazel_cmd, 'run', '//tfx/build:gen_proto'],
+        [self._bazel_cmd, 'run', '//build:gen_proto'],
         # Bazel should be invoked in a directory containing bazel WORKSPACE
         # file, which is the root directory.
         cwd=os.path.dirname(os.path.realpath(__file__)),)

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -108,7 +108,7 @@\n \n   def run(self):\n     subprocess.check_call(\n-        [self._bazel_cmd, 'run', '//tfx/build:gen_proto'],\n+        [self._bazel_cmd, 'run', '//build:gen_proto'],\n         # Bazel should be invoked in a directory containing bazel WORKSPACE\n         # file, which is the root directory.\n         cwd=os.path.dirname(os.path.realpath(__file__)),)\n", "issue": "Project can't be cloned correctly on macOS due to case insensitivity\nUnder the `tfx` folder there's a folder called `build` and a bazel file called `BUILD`. Because macOS is by default case insensitive, only the folder is cloned when `git clone` is run. This means that when trying to build locally, bazel won't be able to find the `BUILD` file required to compile the protobuf schemas, and will fail.\n", "before_files": [{"content": "# Lint as: python2, python3\n# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Package Setup script for TFX.\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport subprocess\n\nimport setuptools\nfrom setuptools import find_packages\nfrom setuptools import setup\nfrom setuptools.command import develop\n# pylint: disable=g-bad-import-order\n# It is recommended to import setuptools prior to importing distutils to avoid\n# using legacy behavior from distutils.\n# https://setuptools.readthedocs.io/en/latest/history.html#v48-0-0\nfrom distutils import spawn\nfrom distutils.command import build\n# pylint: enable=g-bad-import-order\n\nfrom tfx import dependencies\nfrom tfx import version\nfrom tfx.tools import resolve_deps\n\n\nclass _BuildCommand(build.build):\n  \"\"\"Build everything that is needed to install.\n\n  This overrides the original distutils \"build\" command to to run gen_proto\n  command before any sub_commands.\n\n  build command is also invoked from bdist_wheel and install command, therefore\n  this implementation covers the following commands:\n    - pip install . (which invokes bdist_wheel)\n    - python setup.py install (which invokes install command)\n    - python setup.py bdist_wheel (which invokes bdist_wheel command)\n  \"\"\"\n\n  def _should_generate_proto(self):\n    \"\"\"Predicate method for running GenProto command or not.\"\"\"\n    return True\n\n  # Add \"gen_proto\" command as the first sub_command of \"build\". Each\n  # sub_command of \"build\" (e.g. \"build_py\", \"build_ext\", etc.) is executed\n  # sequentially when running a \"build\" command, if the second item in the tuple\n  # (predicate method) is evaluated to true.\n  sub_commands = [\n      ('gen_proto', _should_generate_proto),\n  ] + build.build.sub_commands\n\n\nclass _DevelopCommand(develop.develop):\n  \"\"\"Developmental install.\n\n  https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode\n  Unlike normal package installation where distribution is copied to the\n  site-packages folder, developmental install creates a symbolic link to the\n  source code directory, so that your local code change is immediately visible\n  in runtime without re-installation.\n\n  This is a setuptools-only (i.e. not included in distutils) command that is\n  also used in pip's editable install (pip install -e). Originally it only\n  invokes build_py and install_lib command, but we override it to run gen_proto\n  command in advance.\n\n  This implementation covers the following commands:\n    - pip install -e . (developmental install)\n    - python setup.py develop (which is invoked from developmental install)\n  \"\"\"\n\n  def run(self):\n    self.run_command('gen_proto')\n    # Run super().initialize_options. Command is an old-style class (i.e.\n    # doesn't inherit object) and super() fails in python 2.\n    develop.develop.run(self)\n\n\nclass _GenProtoCommand(setuptools.Command):\n  \"\"\"Generate proto stub files in python.\n\n  Running this command will populate foo_pb2.py file next to your foo.proto\n  file.\n  \"\"\"\n\n  def initialize_options(self):\n    pass\n\n  def finalize_options(self):\n    self._bazel_cmd = spawn.find_executable('bazel')\n    if not self._bazel_cmd:\n      raise RuntimeError(\n          'Could not find \"bazel\" binary. Please visit '\n          'https://docs.bazel.build/versions/master/install.html for '\n          'installation instruction.')\n\n  def run(self):\n    subprocess.check_call(\n        [self._bazel_cmd, 'run', '//tfx/build:gen_proto'],\n        # Bazel should be invoked in a directory containing bazel WORKSPACE\n        # file, which is the root directory.\n        cwd=os.path.dirname(os.path.realpath(__file__)),)\n\n\n# Get the long description from the README file.\nwith open('README.md') as fp:\n  _LONG_DESCRIPTION = fp.read()\n\n\nsetup(\n    name='tfx',\n    version=version.__version__,\n    author='Google LLC',\n    author_email='tensorflow-extended-dev@googlegroups.com',\n    license='Apache 2.0',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Education',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3 :: Only',\n        'Topic :: Scientific/Engineering',\n        'Topic :: Scientific/Engineering :: Artificial Intelligence',\n        'Topic :: Scientific/Engineering :: Mathematics',\n        'Topic :: Software Development',\n        'Topic :: Software Development :: Libraries',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    namespace_packages=[],\n    install_requires=dependencies.make_required_install_packages(),\n    extras_require={\n        # In order to use 'docker-image' or 'all', system libraries specified\n        # under 'tfx/tools/docker/Dockerfile' are required\n        'docker-image': dependencies.make_extra_packages_docker_image(),\n        'tfjs': dependencies.make_extra_packages_tfjs(),\n        'all': dependencies.make_all_dependency_packages(),\n    },\n    # TODO(b/158761800): Move to [build-system] requires in pyproject.toml.\n    setup_requires=[\n        'pytest-runner',\n        'poetry==1.0.9',  # Required for ResolveDeps command.\n                          # Poetry API is not officially documented and subject\n                          # to change in the future. Thus fix the version.\n        'clikit>=0.4.3,<0.5',  # Required for ResolveDeps command.\n    ],\n    cmdclass={\n        'build': _BuildCommand,\n        'develop': _DevelopCommand,\n        'gen_proto': _GenProtoCommand,\n        'resolve_deps': resolve_deps.ResolveDepsCommand,\n    },\n    python_requires='>=3.5,<4',\n    packages=find_packages(),\n    include_package_data=True,\n    description='TensorFlow Extended (TFX) is a TensorFlow-based general-purpose machine learning platform implemented at Google',\n    long_description=_LONG_DESCRIPTION,\n    long_description_content_type='text/markdown',\n    keywords='tensorflow tfx',\n    url='https://www.tensorflow.org/tfx',\n    download_url='https://github.com/tensorflow/tfx/tags',\n    requires=[],\n    # Below console_scripts, each line identifies one console script. The first\n    # part before the equals sign (=) which is 'tfx', is the name of the script\n    # that should be generated, the second part is the import path followed by a\n    # colon (:) with the Click command group. After installation, the user can\n    # invoke the CLI using \"tfx <command_group> <sub_command> <flags>\"\n    entry_points=\"\"\"\n        [console_scripts]\n        tfx=tfx.tools.cli.cli_main:cli_group\n    \"\"\")\n", "path": "setup.py"}], "after_files": [{"content": "# Lint as: python2, python3\n# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Package Setup script for TFX.\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport subprocess\n\nimport setuptools\nfrom setuptools import find_packages\nfrom setuptools import setup\nfrom setuptools.command import develop\n# pylint: disable=g-bad-import-order\n# It is recommended to import setuptools prior to importing distutils to avoid\n# using legacy behavior from distutils.\n# https://setuptools.readthedocs.io/en/latest/history.html#v48-0-0\nfrom distutils import spawn\nfrom distutils.command import build\n# pylint: enable=g-bad-import-order\n\nfrom tfx import dependencies\nfrom tfx import version\nfrom tfx.tools import resolve_deps\n\n\nclass _BuildCommand(build.build):\n  \"\"\"Build everything that is needed to install.\n\n  This overrides the original distutils \"build\" command to to run gen_proto\n  command before any sub_commands.\n\n  build command is also invoked from bdist_wheel and install command, therefore\n  this implementation covers the following commands:\n    - pip install . (which invokes bdist_wheel)\n    - python setup.py install (which invokes install command)\n    - python setup.py bdist_wheel (which invokes bdist_wheel command)\n  \"\"\"\n\n  def _should_generate_proto(self):\n    \"\"\"Predicate method for running GenProto command or not.\"\"\"\n    return True\n\n  # Add \"gen_proto\" command as the first sub_command of \"build\". Each\n  # sub_command of \"build\" (e.g. \"build_py\", \"build_ext\", etc.) is executed\n  # sequentially when running a \"build\" command, if the second item in the tuple\n  # (predicate method) is evaluated to true.\n  sub_commands = [\n      ('gen_proto', _should_generate_proto),\n  ] + build.build.sub_commands\n\n\nclass _DevelopCommand(develop.develop):\n  \"\"\"Developmental install.\n\n  https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode\n  Unlike normal package installation where distribution is copied to the\n  site-packages folder, developmental install creates a symbolic link to the\n  source code directory, so that your local code change is immediately visible\n  in runtime without re-installation.\n\n  This is a setuptools-only (i.e. not included in distutils) command that is\n  also used in pip's editable install (pip install -e). Originally it only\n  invokes build_py and install_lib command, but we override it to run gen_proto\n  command in advance.\n\n  This implementation covers the following commands:\n    - pip install -e . (developmental install)\n    - python setup.py develop (which is invoked from developmental install)\n  \"\"\"\n\n  def run(self):\n    self.run_command('gen_proto')\n    # Run super().initialize_options. Command is an old-style class (i.e.\n    # doesn't inherit object) and super() fails in python 2.\n    develop.develop.run(self)\n\n\nclass _GenProtoCommand(setuptools.Command):\n  \"\"\"Generate proto stub files in python.\n\n  Running this command will populate foo_pb2.py file next to your foo.proto\n  file.\n  \"\"\"\n\n  def initialize_options(self):\n    pass\n\n  def finalize_options(self):\n    self._bazel_cmd = spawn.find_executable('bazel')\n    if not self._bazel_cmd:\n      raise RuntimeError(\n          'Could not find \"bazel\" binary. Please visit '\n          'https://docs.bazel.build/versions/master/install.html for '\n          'installation instruction.')\n\n  def run(self):\n    subprocess.check_call(\n        [self._bazel_cmd, 'run', '//build:gen_proto'],\n        # Bazel should be invoked in a directory containing bazel WORKSPACE\n        # file, which is the root directory.\n        cwd=os.path.dirname(os.path.realpath(__file__)),)\n\n\n# Get the long description from the README file.\nwith open('README.md') as fp:\n  _LONG_DESCRIPTION = fp.read()\n\n\nsetup(\n    name='tfx',\n    version=version.__version__,\n    author='Google LLC',\n    author_email='tensorflow-extended-dev@googlegroups.com',\n    license='Apache 2.0',\n    classifiers=[\n        'Development Status :: 4 - Beta',\n        'Intended Audience :: Developers',\n        'Intended Audience :: Education',\n        'Intended Audience :: Science/Research',\n        'License :: OSI Approved :: Apache Software License',\n        'Operating System :: OS Independent',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Programming Language :: Python :: 3 :: Only',\n        'Topic :: Scientific/Engineering',\n        'Topic :: Scientific/Engineering :: Artificial Intelligence',\n        'Topic :: Scientific/Engineering :: Mathematics',\n        'Topic :: Software Development',\n        'Topic :: Software Development :: Libraries',\n        'Topic :: Software Development :: Libraries :: Python Modules',\n    ],\n    namespace_packages=[],\n    install_requires=dependencies.make_required_install_packages(),\n    extras_require={\n        # In order to use 'docker-image' or 'all', system libraries specified\n        # under 'tfx/tools/docker/Dockerfile' are required\n        'docker-image': dependencies.make_extra_packages_docker_image(),\n        'tfjs': dependencies.make_extra_packages_tfjs(),\n        'all': dependencies.make_all_dependency_packages(),\n    },\n    # TODO(b/158761800): Move to [build-system] requires in pyproject.toml.\n    setup_requires=[\n        'pytest-runner',\n        'poetry==1.0.9',  # Required for ResolveDeps command.\n                          # Poetry API is not officially documented and subject\n                          # to change in the future. Thus fix the version.\n        'clikit>=0.4.3,<0.5',  # Required for ResolveDeps command.\n    ],\n    cmdclass={\n        'build': _BuildCommand,\n        'develop': _DevelopCommand,\n        'gen_proto': _GenProtoCommand,\n        'resolve_deps': resolve_deps.ResolveDepsCommand,\n    },\n    python_requires='>=3.5,<4',\n    packages=find_packages(),\n    include_package_data=True,\n    description='TensorFlow Extended (TFX) is a TensorFlow-based general-purpose machine learning platform implemented at Google',\n    long_description=_LONG_DESCRIPTION,\n    long_description_content_type='text/markdown',\n    keywords='tensorflow tfx',\n    url='https://www.tensorflow.org/tfx',\n    download_url='https://github.com/tensorflow/tfx/tags',\n    requires=[],\n    # Below console_scripts, each line identifies one console script. The first\n    # part before the equals sign (=) which is 'tfx', is the name of the script\n    # that should be generated, the second part is the import path followed by a\n    # colon (:) with the Click command group. After installation, the user can\n    # invoke the CLI using \"tfx <command_group> <sub_command> <flags>\"\n    entry_points=\"\"\"\n        [console_scripts]\n        tfx=tfx.tools.cli.cli_main:cli_group\n    \"\"\")\n", "path": "setup.py"}]}