We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ESMF sanity check
Hi, There is a newer release version of EMSF available 8.1.1.
The current `sanity_check_step`  in `/easybuild/easyblocks/e/esmf.py`  (line 120 or so) will not work since the filenames for the binaries have been changed in 8.1.1 (the current `esmf.py` checks for `ESMF_Info` but since the 8.1.0 it's acutally `EMSF_PrintInfo`, same with `ESMF_InfoC` and `ESMF_PrintInfoC`). 

Also, it seems that the `ESMF-6.1.1_libopts.patch` is no longer needed in the `easyconfig`

And source url + the naming scheme have changed:
```
source_urls = ['https://github.com/esmf-org/esmf/archive/refs/tags/']
sources = ['%%(name)s_%s.tar.gz' % '_'.join(version.split('.'))]
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `easybuild/easyblocks/e/esmf.py`
Content:
```
1 ##
2 # Copyright 2013-2021 Ghent University
3 #
4 # This file is part of EasyBuild,
5 # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
6 # with support of Ghent University (http://ugent.be/hpc),
7 # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
8 # Flemish Research Foundation (FWO) (http://www.fwo.be/en)
9 # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
10 #
11 # https://github.com/easybuilders/easybuild
12 #
13 # EasyBuild is free software: you can redistribute it and/or modify
14 # it under the terms of the GNU General Public License as published by
15 # the Free Software Foundation v2.
16 #
17 # EasyBuild is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.
24 ##
25 """
26 EasyBuild support for building and installing ESMF, implemented as an easyblock
27 
28 @author: Kenneth Hoste (Ghent University)
29 @author: Damian Alvarez (Forschungszentrum Juelich GmbH)
30 """
31 import os
32 from distutils.version import LooseVersion
33 
34 import easybuild.tools.environment as env
35 import easybuild.tools.toolchain as toolchain
36 from easybuild.easyblocks.generic.configuremake import ConfigureMake
37 from easybuild.tools.build_log import EasyBuildError
38 from easybuild.tools.modules import get_software_root
39 from easybuild.tools.run import run_cmd
40 from easybuild.tools.systemtools import get_shared_lib_ext
41 
42 
43 class EB_ESMF(ConfigureMake):
44     """Support for building/installing ESMF."""
45 
46     def configure_step(self):
47         """Custom configuration procedure for ESMF through environment variables."""
48 
49         env.setvar('ESMF_DIR', self.cfg['start_dir'])
50         env.setvar('ESMF_INSTALL_PREFIX', self.installdir)
51         env.setvar('ESMF_INSTALL_BINDIR', 'bin')
52         env.setvar('ESMF_INSTALL_LIBDIR', 'lib')
53         env.setvar('ESMF_INSTALL_MODDIR', 'mod')
54 
55         # specify compiler
56         comp_family = self.toolchain.comp_family()
57         if comp_family in [toolchain.GCC]:
58             compiler = 'gfortran'
59         else:
60             compiler = comp_family.lower()
61         env.setvar('ESMF_COMPILER', compiler)
62 
63         env.setvar('ESMF_F90COMPILEOPTS', os.getenv('F90FLAGS'))
64         env.setvar('ESMF_CXXCOMPILEOPTS', os.getenv('CXXFLAGS'))
65 
66         # specify MPI communications library
67         comm = None
68         mpi_family = self.toolchain.mpi_family()
69         if mpi_family in [toolchain.MPICH, toolchain.QLOGICMPI]:
70             # MPICH family for MPICH v3.x, which is MPICH2 compatible
71             comm = 'mpich2'
72         else:
73             comm = mpi_family.lower()
74         env.setvar('ESMF_COMM', comm)
75 
76         # specify decent LAPACK lib
77         env.setvar('ESMF_LAPACK', 'user')
78         ldflags = os.getenv('LDFLAGS')
79         liblapack = os.getenv('LIBLAPACK_MT') or os.getenv('LIBLAPACK')
80         if liblapack is None:
81             raise EasyBuildError("$LIBLAPACK(_MT) not defined, no BLAS/LAPACK in %s toolchain?", self.toolchain.name)
82         else:
83             env.setvar('ESMF_LAPACK_LIBS', ldflags + ' ' + liblapack)
84 
85         # specify netCDF
86         netcdf = get_software_root('netCDF')
87         if netcdf:
88             if LooseVersion(self.version) >= LooseVersion('7.1.0'):
89                 env.setvar('ESMF_NETCDF', 'nc-config')
90             else:
91                 env.setvar('ESMF_NETCDF', 'user')
92                 netcdf_libs = ['-L%s/lib' % netcdf, '-lnetcdf']
93 
94                 # Fortran
95                 netcdff = get_software_root('netCDF-Fortran')
96                 if netcdff:
97                     netcdf_libs = ["-L%s/lib" % netcdff] + netcdf_libs + ["-lnetcdff"]
98                 else:
99                     netcdf_libs.append('-lnetcdff')
100 
101                 # C++
102                 netcdfcxx = get_software_root('netCDF-C++')
103                 if netcdfcxx:
104                     netcdf_libs = ["-L%s/lib" % netcdfcxx] + netcdf_libs + ["-lnetcdf_c++"]
105                 else:
106                     netcdfcxx = get_software_root('netCDF-C++4')
107                     if netcdfcxx:
108                         netcdf_libs = ["-L%s/lib" % netcdfcxx] + netcdf_libs + ["-lnetcdf_c++4"]
109                     else:
110                         netcdf_libs.append('-lnetcdf_c++')
111                 env.setvar('ESMF_NETCDF_LIBS', ' '.join(netcdf_libs))
112 
113         # 'make info' provides useful debug info
114         cmd = "make info"
115         run_cmd(cmd, log_all=True, simple=True, log_ok=True)
116 
117     def sanity_check_step(self):
118         """Custom sanity check for ESMF."""
119 
120         binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_RegridWeightGen', 'ESMF_WebServController']
121         libs = ['libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]
122         custom_paths = {
123             'files': [os.path.join('bin', x) for x in binaries] + [os.path.join('lib', x) for x in libs],
124             'dirs': ['include', 'mod'],
125         }
126 
127         super(EB_ESMF, self).sanity_check_step(custom_paths=custom_paths)
128
```
--- 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/easybuild/easyblocks/e/esmf.py b/easybuild/easyblocks/e/esmf.py
--- a/easybuild/easyblocks/e/esmf.py
+++ b/easybuild/easyblocks/e/esmf.py
@@ -117,7 +117,13 @@
     def sanity_check_step(self):
         """Custom sanity check for ESMF."""
 
-        binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_RegridWeightGen', 'ESMF_WebServController']
+        if LooseVersion(self.version) < LooseVersion('8.1.0'):
+            binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',
+                        'ESMF_Scrip2Unstruct', 'ESMF_WebServController']
+        else:
+            binaries = ['ESMF_PrintInfo', 'ESMF_PrintInfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',
+                        'ESMF_Scrip2Unstruct', 'ESMF_WebServController']
+
         libs = ['libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]
         custom_paths = {
             'files': [os.path.join('bin', x) for x in binaries] + [os.path.join('lib', x) for x in libs],

{"golden_diff": "diff --git a/easybuild/easyblocks/e/esmf.py b/easybuild/easyblocks/e/esmf.py\n--- a/easybuild/easyblocks/e/esmf.py\n+++ b/easybuild/easyblocks/e/esmf.py\n@@ -117,7 +117,13 @@\n     def sanity_check_step(self):\n         \"\"\"Custom sanity check for ESMF.\"\"\"\n \n-        binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_RegridWeightGen', 'ESMF_WebServController']\n+        if LooseVersion(self.version) < LooseVersion('8.1.0'):\n+            binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',\n+                        'ESMF_Scrip2Unstruct', 'ESMF_WebServController']\n+        else:\n+            binaries = ['ESMF_PrintInfo', 'ESMF_PrintInfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',\n+                        'ESMF_Scrip2Unstruct', 'ESMF_WebServController']\n+\n         libs = ['libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]\n         custom_paths = {\n             'files': [os.path.join('bin', x) for x in binaries] + [os.path.join('lib', x) for x in libs],\n", "issue": "ESMF sanity check\nHi, There is a newer release version of EMSF available 8.1.1.\r\nThe current `sanity_check_step`  in `/easybuild/easyblocks/e/esmf.py`  (line 120 or so) will not work since the filenames for the binaries have been changed in 8.1.1 (the current `esmf.py` checks for `ESMF_Info` but since the 8.1.0 it's acutally `EMSF_PrintInfo`, same with `ESMF_InfoC` and `ESMF_PrintInfoC`). \r\n\r\nAlso, it seems that the `ESMF-6.1.1_libopts.patch` is no longer needed in the `easyconfig`\r\n\r\nAnd source url + the naming scheme have changed:\r\n```\r\nsource_urls = ['https://github.com/esmf-org/esmf/archive/refs/tags/']\r\nsources = ['%%(name)s_%s.tar.gz' % '_'.join(version.split('.'))]\r\n```\r\n\n", "before_files": [{"content": "##\n# Copyright 2013-2021 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),\n# with support of Ghent University (http://ugent.be/hpc),\n# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),\n# Flemish Research Foundation (FWO) (http://www.fwo.be/en)\n# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).\n#\n# https://github.com/easybuilders/easybuild\n#\n# EasyBuild is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation v2.\n#\n# EasyBuild is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.\n##\n\"\"\"\nEasyBuild support for building and installing ESMF, implemented as an easyblock\n\n@author: Kenneth Hoste (Ghent University)\n@author: Damian Alvarez (Forschungszentrum Juelich GmbH)\n\"\"\"\nimport os\nfrom distutils.version import LooseVersion\n\nimport easybuild.tools.environment as env\nimport easybuild.tools.toolchain as toolchain\nfrom easybuild.easyblocks.generic.configuremake import ConfigureMake\nfrom easybuild.tools.build_log import EasyBuildError\nfrom easybuild.tools.modules import get_software_root\nfrom easybuild.tools.run import run_cmd\nfrom easybuild.tools.systemtools import get_shared_lib_ext\n\n\nclass EB_ESMF(ConfigureMake):\n    \"\"\"Support for building/installing ESMF.\"\"\"\n\n    def configure_step(self):\n        \"\"\"Custom configuration procedure for ESMF through environment variables.\"\"\"\n\n        env.setvar('ESMF_DIR', self.cfg['start_dir'])\n        env.setvar('ESMF_INSTALL_PREFIX', self.installdir)\n        env.setvar('ESMF_INSTALL_BINDIR', 'bin')\n        env.setvar('ESMF_INSTALL_LIBDIR', 'lib')\n        env.setvar('ESMF_INSTALL_MODDIR', 'mod')\n\n        # specify compiler\n        comp_family = self.toolchain.comp_family()\n        if comp_family in [toolchain.GCC]:\n            compiler = 'gfortran'\n        else:\n            compiler = comp_family.lower()\n        env.setvar('ESMF_COMPILER', compiler)\n\n        env.setvar('ESMF_F90COMPILEOPTS', os.getenv('F90FLAGS'))\n        env.setvar('ESMF_CXXCOMPILEOPTS', os.getenv('CXXFLAGS'))\n\n        # specify MPI communications library\n        comm = None\n        mpi_family = self.toolchain.mpi_family()\n        if mpi_family in [toolchain.MPICH, toolchain.QLOGICMPI]:\n            # MPICH family for MPICH v3.x, which is MPICH2 compatible\n            comm = 'mpich2'\n        else:\n            comm = mpi_family.lower()\n        env.setvar('ESMF_COMM', comm)\n\n        # specify decent LAPACK lib\n        env.setvar('ESMF_LAPACK', 'user')\n        ldflags = os.getenv('LDFLAGS')\n        liblapack = os.getenv('LIBLAPACK_MT') or os.getenv('LIBLAPACK')\n        if liblapack is None:\n            raise EasyBuildError(\"$LIBLAPACK(_MT) not defined, no BLAS/LAPACK in %s toolchain?\", self.toolchain.name)\n        else:\n            env.setvar('ESMF_LAPACK_LIBS', ldflags + ' ' + liblapack)\n\n        # specify netCDF\n        netcdf = get_software_root('netCDF')\n        if netcdf:\n            if LooseVersion(self.version) >= LooseVersion('7.1.0'):\n                env.setvar('ESMF_NETCDF', 'nc-config')\n            else:\n                env.setvar('ESMF_NETCDF', 'user')\n                netcdf_libs = ['-L%s/lib' % netcdf, '-lnetcdf']\n\n                # Fortran\n                netcdff = get_software_root('netCDF-Fortran')\n                if netcdff:\n                    netcdf_libs = [\"-L%s/lib\" % netcdff] + netcdf_libs + [\"-lnetcdff\"]\n                else:\n                    netcdf_libs.append('-lnetcdff')\n\n                # C++\n                netcdfcxx = get_software_root('netCDF-C++')\n                if netcdfcxx:\n                    netcdf_libs = [\"-L%s/lib\" % netcdfcxx] + netcdf_libs + [\"-lnetcdf_c++\"]\n                else:\n                    netcdfcxx = get_software_root('netCDF-C++4')\n                    if netcdfcxx:\n                        netcdf_libs = [\"-L%s/lib\" % netcdfcxx] + netcdf_libs + [\"-lnetcdf_c++4\"]\n                    else:\n                        netcdf_libs.append('-lnetcdf_c++')\n                env.setvar('ESMF_NETCDF_LIBS', ' '.join(netcdf_libs))\n\n        # 'make info' provides useful debug info\n        cmd = \"make info\"\n        run_cmd(cmd, log_all=True, simple=True, log_ok=True)\n\n    def sanity_check_step(self):\n        \"\"\"Custom sanity check for ESMF.\"\"\"\n\n        binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_RegridWeightGen', 'ESMF_WebServController']\n        libs = ['libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]\n        custom_paths = {\n            'files': [os.path.join('bin', x) for x in binaries] + [os.path.join('lib', x) for x in libs],\n            'dirs': ['include', 'mod'],\n        }\n\n        super(EB_ESMF, self).sanity_check_step(custom_paths=custom_paths)\n", "path": "easybuild/easyblocks/e/esmf.py"}], "after_files": [{"content": "##\n# Copyright 2013-2021 Ghent University\n#\n# This file is part of EasyBuild,\n# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),\n# with support of Ghent University (http://ugent.be/hpc),\n# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),\n# Flemish Research Foundation (FWO) (http://www.fwo.be/en)\n# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).\n#\n# https://github.com/easybuilders/easybuild\n#\n# EasyBuild is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation v2.\n#\n# EasyBuild is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with EasyBuild.  If not, see <http://www.gnu.org/licenses/>.\n##\n\"\"\"\nEasyBuild support for building and installing ESMF, implemented as an easyblock\n\n@author: Kenneth Hoste (Ghent University)\n@author: Damian Alvarez (Forschungszentrum Juelich GmbH)\n\"\"\"\nimport os\nfrom distutils.version import LooseVersion\n\nimport easybuild.tools.environment as env\nimport easybuild.tools.toolchain as toolchain\nfrom easybuild.easyblocks.generic.configuremake import ConfigureMake\nfrom easybuild.tools.build_log import EasyBuildError\nfrom easybuild.tools.modules import get_software_root\nfrom easybuild.tools.run import run_cmd\nfrom easybuild.tools.systemtools import get_shared_lib_ext\n\n\nclass EB_ESMF(ConfigureMake):\n    \"\"\"Support for building/installing ESMF.\"\"\"\n\n    def configure_step(self):\n        \"\"\"Custom configuration procedure for ESMF through environment variables.\"\"\"\n\n        env.setvar('ESMF_DIR', self.cfg['start_dir'])\n        env.setvar('ESMF_INSTALL_PREFIX', self.installdir)\n        env.setvar('ESMF_INSTALL_BINDIR', 'bin')\n        env.setvar('ESMF_INSTALL_LIBDIR', 'lib')\n        env.setvar('ESMF_INSTALL_MODDIR', 'mod')\n\n        # specify compiler\n        comp_family = self.toolchain.comp_family()\n        if comp_family in [toolchain.GCC]:\n            compiler = 'gfortran'\n        else:\n            compiler = comp_family.lower()\n        env.setvar('ESMF_COMPILER', compiler)\n\n        env.setvar('ESMF_F90COMPILEOPTS', os.getenv('F90FLAGS'))\n        env.setvar('ESMF_CXXCOMPILEOPTS', os.getenv('CXXFLAGS'))\n\n        # specify MPI communications library\n        comm = None\n        mpi_family = self.toolchain.mpi_family()\n        if mpi_family in [toolchain.MPICH, toolchain.QLOGICMPI]:\n            # MPICH family for MPICH v3.x, which is MPICH2 compatible\n            comm = 'mpich2'\n        else:\n            comm = mpi_family.lower()\n        env.setvar('ESMF_COMM', comm)\n\n        # specify decent LAPACK lib\n        env.setvar('ESMF_LAPACK', 'user')\n        ldflags = os.getenv('LDFLAGS')\n        liblapack = os.getenv('LIBLAPACK_MT') or os.getenv('LIBLAPACK')\n        if liblapack is None:\n            raise EasyBuildError(\"$LIBLAPACK(_MT) not defined, no BLAS/LAPACK in %s toolchain?\", self.toolchain.name)\n        else:\n            env.setvar('ESMF_LAPACK_LIBS', ldflags + ' ' + liblapack)\n\n        # specify netCDF\n        netcdf = get_software_root('netCDF')\n        if netcdf:\n            if LooseVersion(self.version) >= LooseVersion('7.1.0'):\n                env.setvar('ESMF_NETCDF', 'nc-config')\n            else:\n                env.setvar('ESMF_NETCDF', 'user')\n                netcdf_libs = ['-L%s/lib' % netcdf, '-lnetcdf']\n\n                # Fortran\n                netcdff = get_software_root('netCDF-Fortran')\n                if netcdff:\n                    netcdf_libs = [\"-L%s/lib\" % netcdff] + netcdf_libs + [\"-lnetcdff\"]\n                else:\n                    netcdf_libs.append('-lnetcdff')\n\n                # C++\n                netcdfcxx = get_software_root('netCDF-C++')\n                if netcdfcxx:\n                    netcdf_libs = [\"-L%s/lib\" % netcdfcxx] + netcdf_libs + [\"-lnetcdf_c++\"]\n                else:\n                    netcdfcxx = get_software_root('netCDF-C++4')\n                    if netcdfcxx:\n                        netcdf_libs = [\"-L%s/lib\" % netcdfcxx] + netcdf_libs + [\"-lnetcdf_c++4\"]\n                    else:\n                        netcdf_libs.append('-lnetcdf_c++')\n                env.setvar('ESMF_NETCDF_LIBS', ' '.join(netcdf_libs))\n\n        # 'make info' provides useful debug info\n        cmd = \"make info\"\n        run_cmd(cmd, log_all=True, simple=True, log_ok=True)\n\n    def sanity_check_step(self):\n        \"\"\"Custom sanity check for ESMF.\"\"\"\n\n        if LooseVersion(self.version) < LooseVersion('8.1.0'):\n            binaries = ['ESMF_Info', 'ESMF_InfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',\n                        'ESMF_Scrip2Unstruct', 'ESMF_WebServController']\n        else:\n            binaries = ['ESMF_PrintInfo', 'ESMF_PrintInfoC', 'ESMF_Regrid', 'ESMF_RegridWeightGen',\n                        'ESMF_Scrip2Unstruct', 'ESMF_WebServController']\n\n        libs = ['libesmf.a', 'libesmf.%s' % get_shared_lib_ext()]\n        custom_paths = {\n            'files': [os.path.join('bin', x) for x in binaries] + [os.path.join('lib', x) for x in libs],\n            'dirs': ['include', 'mod'],\n        }\n\n        super(EB_ESMF, self).sanity_check_step(custom_paths=custom_paths)\n", "path": "easybuild/easyblocks/e/esmf.py"}]}