prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [bug] Conan build command does not support conanfile.txt as described
  ### Description
  
  The documentation about [build](https://docs.conan.io/2/reference/commands/build.html) command says:
  
  ```
  usage: conan build [-h] [-v [V]] [--logger] [--name NAME] [--version VERSION] [--user USER] [--channel CHANNEL] [-of OUTPUT_FOLDER] [-b BUILD] [-r REMOTE | -nr] [-u] [-o OPTIONS_HOST] [-o:b OPTIONS_BUILD] [-o:h OPTIONS_HOST] [-pr PROFILE_HOST] [-pr:b PROFILE_BUILD]
                     [-pr:h PROFILE_HOST] [-s SETTINGS_HOST] [-s:b SETTINGS_BUILD] [-s:h SETTINGS_HOST] [-c CONF_HOST] [-c:b CONF_BUILD] [-c:h CONF_HOST] [-l LOCKFILE] [--lockfile-partial] [--lockfile-out LOCKFILE_OUT] [--lockfile-packages] [--lockfile-clean]
                     [path]
  
  Install dependencies and call the build() method.
  
  positional arguments:
    path                  Path to a folder containing a recipe (conanfile.py or conanfile.txt) or to a recipe file. e.g., ./my_project/conanfile.txt.
  ```
  
  However, `conanfile.txt` is not acceptable by build command.
  
  As the documentation is extracted from the command output, it should be fixed on Conan client first.
  
  
  ### Environment details
  
  * Operating System+version: OSX 13
  * Compiler+version: Apple-Clang 14
  * Conan version: 2.0.0
  * Python version: 3.10
  
  
  ### Steps to reproduce
  
  1. mkdir /tmp/foo && cd /tmp/foo
  2. echo "[requires]\nzlib/1.2.13" > conanfile.txt
  3. conan build .
  4. Or, conan build ./conanfile.txt
  
  ### Logs
  
  ```
  % conan build .
  ERROR: Conanfile not found at /private/tmp/foo/conanfile.py
  
  % conan build ./conanfile.txt   
  ERROR: A conanfile.py is needed, /private/tmp/conantxt/conanfile.txt is not acceptable
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `conan/cli/commands/build.py`
  Content:
  ```
  1 import os
  2 
  3 from conan.api.output import ConanOutput
  4 from conan.cli.command import conan_command
  5 from conan.cli.commands import make_abs_path
  6 from conan.cli.args import add_lockfile_args, add_common_install_arguments, add_reference_args
  7 from conan.internal.conan_app import ConanApp
  8 from conan.cli.printers.graph import print_graph_packages, print_graph_basic
  9 from conans.client.conanfile.build import run_build_method
  10 
  11 
  12 @conan_command(group='Creator')
  13 def build(conan_api, parser, *args):
  14     """
  15     Install dependencies and call the build() method.
  16     """
  17     parser.add_argument("path", nargs="?",
  18                         help="Path to a folder containing a recipe (conanfile.py "
  19                              "or conanfile.txt) or to a recipe file. e.g., "
  20                              "./my_project/conanfile.txt.")
  21     add_reference_args(parser)
  22     # TODO: Missing --build-require argument and management
  23     parser.add_argument("-of", "--output-folder",
  24                         help='The root output folder for generated and build files')
  25     add_common_install_arguments(parser)
  26     add_lockfile_args(parser)
  27     args = parser.parse_args(*args)
  28 
  29     cwd = os.getcwd()
  30     path = conan_api.local.get_conanfile_path(args.path, cwd, py=True)
  31     folder = os.path.dirname(path)
  32     remotes = conan_api.remotes.list(args.remote) if not args.no_remote else []
  33 
  34     lockfile = conan_api.lockfile.get_lockfile(lockfile=args.lockfile,
  35                                                conanfile_path=path,
  36                                                cwd=cwd,
  37                                                partial=args.lockfile_partial)
  38     profile_host, profile_build = conan_api.profiles.get_profiles_from_args(args)
  39 
  40     deps_graph = conan_api.graph.load_graph_consumer(path, args.name, args.version,
  41                                                      args.user, args.channel,
  42                                                      profile_host, profile_build, lockfile, remotes,
  43                                                      args.update)
  44     print_graph_basic(deps_graph)
  45     deps_graph.report_graph_error()
  46     conan_api.graph.analyze_binaries(deps_graph, args.build, remotes=remotes, update=args.update,
  47                                      lockfile=lockfile)
  48     print_graph_packages(deps_graph)
  49 
  50     out = ConanOutput()
  51     out.title("Installing packages")
  52     conan_api.install.install_binaries(deps_graph=deps_graph, remotes=remotes)
  53 
  54     source_folder = folder
  55     output_folder = make_abs_path(args.output_folder, cwd) if args.output_folder else None
  56     out.title("Finalizing install (deploy, generators)")
  57     conan_api.install.install_consumer(deps_graph=deps_graph, source_folder=source_folder,
  58                                        output_folder=output_folder)
  59 
  60     # TODO: Decide API to put this
  61     app = ConanApp(conan_api.cache_folder)
  62     conanfile = deps_graph.root.conanfile
  63     conanfile.folders.set_base_package(conanfile.folders.base_build)
  64     run_build_method(conanfile, app.hook_manager)
  65 
  66     lockfile = conan_api.lockfile.update_lockfile(lockfile, deps_graph, args.lockfile_packages,
  67                                                   clean=args.lockfile_clean)
  68     conan_api.lockfile.save_lockfile(lockfile, args.lockfile_out, source_folder)
  69     return deps_graph
  70
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/conan/cli/commands/build.py b/conan/cli/commands/build.py
  --- a/conan/cli/commands/build.py
  +++ b/conan/cli/commands/build.py
  @@ -15,9 +15,9 @@
       Install dependencies and call the build() method.
       """
       parser.add_argument("path", nargs="?",
  -                        help="Path to a folder containing a recipe (conanfile.py "
  -                             "or conanfile.txt) or to a recipe file. e.g., "
  -                             "./my_project/conanfile.txt.")
  +                        help='Path to a python-based recipe file or a folder '
  +                             'containing a conanfile.py recipe. conanfile.txt '
  +                             'cannot be used with conan build.')
       add_reference_args(parser)
       # TODO: Missing --build-require argument and management
       parser.add_argument("-of", "--output-folder",
  
verification_info: {"golden_diff": "diff --git a/conan/cli/commands/build.py b/conan/cli/commands/build.py\n--- a/conan/cli/commands/build.py\n+++ b/conan/cli/commands/build.py\n@@ -15,9 +15,9 @@\n     Install dependencies and call the build() method.\n     \"\"\"\n     parser.add_argument(\"path\", nargs=\"?\",\n-                        help=\"Path to a folder containing a recipe (conanfile.py \"\n-                             \"or conanfile.txt) or to a recipe file. e.g., \"\n-                             \"./my_project/conanfile.txt.\")\n+                        help='Path to a python-based recipe file or a folder '\n+                             'containing a conanfile.py recipe. conanfile.txt '\n+                             'cannot be used with conan build.')\n     add_reference_args(parser)\n     # TODO: Missing --build-require argument and management\n     parser.add_argument(\"-of\", \"--output-folder\",\n", "issue": "[bug] Conan build command does not support conanfile.txt as described\n### Description\r\n\r\nThe documentation about [build](https://docs.conan.io/2/reference/commands/build.html) command says:\r\n\r\n```\r\nusage: conan build [-h] [-v [V]] [--logger] [--name NAME] [--version VERSION] [--user USER] [--channel CHANNEL] [-of OUTPUT_FOLDER] [-b BUILD] [-r REMOTE | -nr] [-u] [-o OPTIONS_HOST] [-o:b OPTIONS_BUILD] [-o:h OPTIONS_HOST] [-pr PROFILE_HOST] [-pr:b PROFILE_BUILD]\r\n                   [-pr:h PROFILE_HOST] [-s SETTINGS_HOST] [-s:b SETTINGS_BUILD] [-s:h SETTINGS_HOST] [-c CONF_HOST] [-c:b CONF_BUILD] [-c:h CONF_HOST] [-l LOCKFILE] [--lockfile-partial] [--lockfile-out LOCKFILE_OUT] [--lockfile-packages] [--lockfile-clean]\r\n                   [path]\r\n\r\nInstall dependencies and call the build() method.\r\n\r\npositional arguments:\r\n  path                  Path to a folder containing a recipe (conanfile.py or conanfile.txt) or to a recipe file. e.g., ./my_project/conanfile.txt.\r\n```\r\n\r\nHowever, `conanfile.txt` is not acceptable by build command.\r\n\r\nAs the documentation is extracted from the command output, it should be fixed on Conan client first.\r\n\r\n\r\n### Environment details\r\n\r\n* Operating System+version: OSX 13\r\n* Compiler+version: Apple-Clang 14\r\n* Conan version: 2.0.0\r\n* Python version: 3.10\r\n\r\n\r\n### Steps to reproduce\r\n\r\n1. mkdir /tmp/foo && cd /tmp/foo\r\n2. echo \"[requires]\\nzlib/1.2.13\" > conanfile.txt\r\n3. conan build .\r\n4. Or, conan build ./conanfile.txt\r\n\r\n### Logs\r\n\r\n```\r\n% conan build .\r\nERROR: Conanfile not found at /private/tmp/foo/conanfile.py\r\n\r\n% conan build ./conanfile.txt   \r\nERROR: A conanfile.py is needed, /private/tmp/conantxt/conanfile.txt is not acceptable\r\n```\n", "before_files": [{"content": "import os\n\nfrom conan.api.output import ConanOutput\nfrom conan.cli.command import conan_command\nfrom conan.cli.commands import make_abs_path\nfrom conan.cli.args import add_lockfile_args, add_common_install_arguments, add_reference_args\nfrom conan.internal.conan_app import ConanApp\nfrom conan.cli.printers.graph import print_graph_packages, print_graph_basic\nfrom conans.client.conanfile.build import run_build_method\n\n\n@conan_command(group='Creator')\ndef build(conan_api, parser, *args):\n    \"\"\"\n    Install dependencies and call the build() method.\n    \"\"\"\n    parser.add_argument(\"path\", nargs=\"?\",\n                        help=\"Path to a folder containing a recipe (conanfile.py \"\n                             \"or conanfile.txt) or to a recipe file. e.g., \"\n                             \"./my_project/conanfile.txt.\")\n    add_reference_args(parser)\n    # TODO: Missing --build-require argument and management\n    parser.add_argument(\"-of\", \"--output-folder\",\n                        help='The root output folder for generated and build files')\n    add_common_install_arguments(parser)\n    add_lockfile_args(parser)\n    args = parser.parse_args(*args)\n\n    cwd = os.getcwd()\n    path = conan_api.local.get_conanfile_path(args.path, cwd, py=True)\n    folder = os.path.dirname(path)\n    remotes = conan_api.remotes.list(args.remote) if not args.no_remote else []\n\n    lockfile = conan_api.lockfile.get_lockfile(lockfile=args.lockfile,\n                                               conanfile_path=path,\n                                               cwd=cwd,\n                                               partial=args.lockfile_partial)\n    profile_host, profile_build = conan_api.profiles.get_profiles_from_args(args)\n\n    deps_graph = conan_api.graph.load_graph_consumer(path, args.name, args.version,\n                                                     args.user, args.channel,\n                                                     profile_host, profile_build, lockfile, remotes,\n                                                     args.update)\n    print_graph_basic(deps_graph)\n    deps_graph.report_graph_error()\n    conan_api.graph.analyze_binaries(deps_graph, args.build, remotes=remotes, update=args.update,\n                                     lockfile=lockfile)\n    print_graph_packages(deps_graph)\n\n    out = ConanOutput()\n    out.title(\"Installing packages\")\n    conan_api.install.install_binaries(deps_graph=deps_graph, remotes=remotes)\n\n    source_folder = folder\n    output_folder = make_abs_path(args.output_folder, cwd) if args.output_folder else None\n    out.title(\"Finalizing install (deploy, generators)\")\n    conan_api.install.install_consumer(deps_graph=deps_graph, source_folder=source_folder,\n                                       output_folder=output_folder)\n\n    # TODO: Decide API to put this\n    app = ConanApp(conan_api.cache_folder)\n    conanfile = deps_graph.root.conanfile\n    conanfile.folders.set_base_package(conanfile.folders.base_build)\n    run_build_method(conanfile, app.hook_manager)\n\n    lockfile = conan_api.lockfile.update_lockfile(lockfile, deps_graph, args.lockfile_packages,\n                                                  clean=args.lockfile_clean)\n    conan_api.lockfile.save_lockfile(lockfile, args.lockfile_out, source_folder)\n    return deps_graph\n", "path": "conan/cli/commands/build.py"}], "after_files": [{"content": "import os\n\nfrom conan.api.output import ConanOutput\nfrom conan.cli.command import conan_command\nfrom conan.cli.commands import make_abs_path\nfrom conan.cli.args import add_lockfile_args, add_common_install_arguments, add_reference_args\nfrom conan.internal.conan_app import ConanApp\nfrom conan.cli.printers.graph import print_graph_packages, print_graph_basic\nfrom conans.client.conanfile.build import run_build_method\n\n\n@conan_command(group='Creator')\ndef build(conan_api, parser, *args):\n    \"\"\"\n    Install dependencies and call the build() method.\n    \"\"\"\n    parser.add_argument(\"path\", nargs=\"?\",\n                        help='Path to a python-based recipe file or a folder '\n                             'containing a conanfile.py recipe. conanfile.txt '\n                             'cannot be used with conan build.')\n    add_reference_args(parser)\n    # TODO: Missing --build-require argument and management\n    parser.add_argument(\"-of\", \"--output-folder\",\n                        help='The root output folder for generated and build files')\n    add_common_install_arguments(parser)\n    add_lockfile_args(parser)\n    args = parser.parse_args(*args)\n\n    cwd = os.getcwd()\n    path = conan_api.local.get_conanfile_path(args.path, cwd, py=True)\n    folder = os.path.dirname(path)\n    remotes = conan_api.remotes.list(args.remote) if not args.no_remote else []\n\n    lockfile = conan_api.lockfile.get_lockfile(lockfile=args.lockfile,\n                                               conanfile_path=path,\n                                               cwd=cwd,\n                                               partial=args.lockfile_partial)\n    profile_host, profile_build = conan_api.profiles.get_profiles_from_args(args)\n\n    deps_graph = conan_api.graph.load_graph_consumer(path, args.name, args.version,\n                                                     args.user, args.channel,\n                                                     profile_host, profile_build, lockfile, remotes,\n                                                     args.update)\n    print_graph_basic(deps_graph)\n    deps_graph.report_graph_error()\n    conan_api.graph.analyze_binaries(deps_graph, args.build, remotes=remotes, update=args.update,\n                                     lockfile=lockfile)\n    print_graph_packages(deps_graph)\n\n    out = ConanOutput()\n    out.title(\"Installing packages\")\n    conan_api.install.install_binaries(deps_graph=deps_graph, remotes=remotes)\n\n    source_folder = folder\n    output_folder = make_abs_path(args.output_folder, cwd) if args.output_folder else None\n    out.title(\"Finalizing install (deploy, generators)\")\n    conan_api.install.install_consumer(deps_graph=deps_graph, source_folder=source_folder,\n                                       output_folder=output_folder)\n\n    # TODO: Decide API to put this\n    app = ConanApp(conan_api.cache_folder)\n    conanfile = deps_graph.root.conanfile\n    conanfile.folders.set_base_package(conanfile.folders.base_build)\n    run_build_method(conanfile, app.hook_manager)\n\n    lockfile = conan_api.lockfile.update_lockfile(lockfile, deps_graph, args.lockfile_packages,\n                                                  clean=args.lockfile_clean)\n    conan_api.lockfile.save_lockfile(lockfile, args.lockfile_out, source_folder)\n    return deps_graph\n", "path": "conan/cli/commands/build.py"}]}