prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  package_id() regression bug in conan 1.4.x?
  Consider the following `conanfile.py`:
  ```python
  from conans import ConanFile
  
  class TestConan(ConanFile):
      name = "Test"
      version = "0.0.1"
      settings = "os", "arch"
  
      def package_id(self):
          self.info.include_build_settings()
          self.info.settings.os_build = self.info.settings.os
          self.info.settings.arch_build = self.info.settings.arch
          del self.info.settings.os
          del self.info.settings.arch
          print(">>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build: ",str(self.info.settings.os_build))
          print(">>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build: ",str(self.info.settings.arch_build))
  ```
  
  Now test it with conan 1.3.3:
  ```
  C:\Users\dbely\conan\conan-test>pip install conan==1.3.3
  ...
  C:\Users\dbely\conan\conan-test>conan create . dbely/testing
  ...
  Test/0.0.1@dbely/testing: The stored package has not changed
  >>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build:  Windows
  >>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build:  x86_64
  Test/0.0.1@dbely/testing: Installing package
  ...
  C:\Users\dbely\conan\conan-test>conan search Test/0.0.1@dbely/testing
  Existing packages for recipe Test/0.0.1@dbely/testing:
  
      Package_ID: 456f15897172eef340fcbac8a70811f2beb26a93
          [settings]
              arch_build: x86_64
              os_build: Windows
          Outdated from recipe: False
  ```
  Everything is good. Upgrade to conan 1.4.4 (all 1.4.x versions behave the same) and try again:
  ```
  C:\Users\dbely\conan\conan-test>pip install conan==1.4.4
  ...
  C:\Users\dbely\conan\conan-test>conan create . dbely/testing
  ...
  Test/0.0.1@dbely/testing: A new conanfile.py version was exported
  Test/0.0.1@dbely/testing: Folder: C:\Users\dbely\.conan\data\Test\0.0.1\dbely\testing\export
  >>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build:  Windows
  >>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build:  x86_64
  Test/0.0.1@dbely/testing: Installing package
  >>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build:  None
  >>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build:  None
  ...
  C:\Users\dbely\conan\conan-test>conan search Test/0.0.1@dbely/testing
  Existing packages for recipe Test/0.0.1@dbely/testing:
  
      Package_ID: 456f15897172eef340fcbac8a70811f2beb26a93
          [settings]
              arch_build: None
              os_build: None
          Outdated from recipe: False
  ```
  Oops! `package_id()` is now called twice and after the second call `os_build` and `arch_build` are set to `None`. Looks like a bug to me. 
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `conans/client/graph/printer.py`
  Content:
  ```
  1 from conans.client.output import Color
  2 from conans.model.ref import PackageReference
  3 from conans.model.workspace import WORKSPACE_FILE
  4 
  5 
  6 def print_graph(deps_graph, out):
  7     all_nodes = []
  8     ids = set()
  9     for node in sorted(n for n in deps_graph.nodes if n.conan_ref):
  10         package_id = PackageReference(node.conan_ref, node.conanfile.package_id())
  11         if package_id not in ids:
  12             all_nodes.append(node)
  13             ids.add(package_id)
  14     requires = [n for n in all_nodes]
  15     out.writeln("Requirements", Color.BRIGHT_YELLOW)
  16 
  17     def _recipes(nodes):
  18         for node in nodes:
  19             if node.remote == WORKSPACE_FILE:
  20                 from_text = "from '%s'" % WORKSPACE_FILE
  21             else:
  22                 from_text = "from local cache" if not node.remote else "from '%s'" % node.remote.name
  23             out.writeln("    %s %s" % (repr(node.conan_ref), from_text), Color.BRIGHT_CYAN)
  24     _recipes(requires)
  25     out.writeln("Packages", Color.BRIGHT_YELLOW)
  26 
  27     def _packages(nodes):
  28         for node in nodes:
  29             ref, conanfile = node.conan_ref, node.conanfile
  30             ref = PackageReference(ref, conanfile.info.package_id())
  31             out.writeln("    %s" % (repr(ref)), Color.BRIGHT_CYAN)
  32     _packages(requires)
  33 
  34     out.writeln("")
  35
  ```
  --- 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/conans/client/graph/printer.py b/conans/client/graph/printer.py
  --- a/conans/client/graph/printer.py
  +++ b/conans/client/graph/printer.py
  @@ -7,7 +7,7 @@
       all_nodes = []
       ids = set()
       for node in sorted(n for n in deps_graph.nodes if n.conan_ref):
  -        package_id = PackageReference(node.conan_ref, node.conanfile.package_id())
  +        package_id = PackageReference(node.conan_ref, node.conanfile.info.package_id())
           if package_id not in ids:
               all_nodes.append(node)
               ids.add(package_id)
  
verification_info: {"golden_diff": "diff --git a/conans/client/graph/printer.py b/conans/client/graph/printer.py\n--- a/conans/client/graph/printer.py\n+++ b/conans/client/graph/printer.py\n@@ -7,7 +7,7 @@\n     all_nodes = []\n     ids = set()\n     for node in sorted(n for n in deps_graph.nodes if n.conan_ref):\n-        package_id = PackageReference(node.conan_ref, node.conanfile.package_id())\n+        package_id = PackageReference(node.conan_ref, node.conanfile.info.package_id())\n         if package_id not in ids:\n             all_nodes.append(node)\n             ids.add(package_id)\n", "issue": "package_id() regression bug in conan 1.4.x?\nConsider the following `conanfile.py`:\r\n```python\r\nfrom conans import ConanFile\r\n\r\nclass TestConan(ConanFile):\r\n    name = \"Test\"\r\n    version = \"0.0.1\"\r\n    settings = \"os\", \"arch\"\r\n\r\n    def package_id(self):\r\n        self.info.include_build_settings()\r\n        self.info.settings.os_build = self.info.settings.os\r\n        self.info.settings.arch_build = self.info.settings.arch\r\n        del self.info.settings.os\r\n        del self.info.settings.arch\r\n        print(\">>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build: \",str(self.info.settings.os_build))\r\n        print(\">>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build: \",str(self.info.settings.arch_build))\r\n```\r\n\r\nNow test it with conan 1.3.3:\r\n```\r\nC:\\Users\\dbely\\conan\\conan-test>pip install conan==1.3.3\r\n...\r\nC:\\Users\\dbely\\conan\\conan-test>conan create . dbely/testing\r\n...\r\nTest/0.0.1@dbely/testing: The stored package has not changed\r\n>>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build:  Windows\r\n>>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build:  x86_64\r\nTest/0.0.1@dbely/testing: Installing package\r\n...\r\nC:\\Users\\dbely\\conan\\conan-test>conan search Test/0.0.1@dbely/testing\r\nExisting packages for recipe Test/0.0.1@dbely/testing:\r\n\r\n    Package_ID: 456f15897172eef340fcbac8a70811f2beb26a93\r\n        [settings]\r\n            arch_build: x86_64\r\n            os_build: Windows\r\n        Outdated from recipe: False\r\n```\r\nEverything is good. Upgrade to conan 1.4.4 (all 1.4.x versions behave the same) and try again:\r\n```\r\nC:\\Users\\dbely\\conan\\conan-test>pip install conan==1.4.4\r\n...\r\nC:\\Users\\dbely\\conan\\conan-test>conan create . dbely/testing\r\n...\r\nTest/0.0.1@dbely/testing: A new conanfile.py version was exported\r\nTest/0.0.1@dbely/testing: Folder: C:\\Users\\dbely\\.conan\\data\\Test\\0.0.1\\dbely\\testing\\export\r\n>>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build:  Windows\r\n>>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build:  x86_64\r\nTest/0.0.1@dbely/testing: Installing package\r\n>>>>>>>>>>>>>>>>>>>>>>>>>>>> os_build:  None\r\n>>>>>>>>>>>>>>>>>>>>>>>>>>>> arch_build:  None\r\n...\r\nC:\\Users\\dbely\\conan\\conan-test>conan search Test/0.0.1@dbely/testing\r\nExisting packages for recipe Test/0.0.1@dbely/testing:\r\n\r\n    Package_ID: 456f15897172eef340fcbac8a70811f2beb26a93\r\n        [settings]\r\n            arch_build: None\r\n            os_build: None\r\n        Outdated from recipe: False\r\n```\r\nOops! `package_id()` is now called twice and after the second call `os_build` and `arch_build` are set to `None`. Looks like a bug to me. \n", "before_files": [{"content": "from conans.client.output import Color\nfrom conans.model.ref import PackageReference\nfrom conans.model.workspace import WORKSPACE_FILE\n\n\ndef print_graph(deps_graph, out):\n    all_nodes = []\n    ids = set()\n    for node in sorted(n for n in deps_graph.nodes if n.conan_ref):\n        package_id = PackageReference(node.conan_ref, node.conanfile.package_id())\n        if package_id not in ids:\n            all_nodes.append(node)\n            ids.add(package_id)\n    requires = [n for n in all_nodes]\n    out.writeln(\"Requirements\", Color.BRIGHT_YELLOW)\n\n    def _recipes(nodes):\n        for node in nodes:\n            if node.remote == WORKSPACE_FILE:\n                from_text = \"from '%s'\" % WORKSPACE_FILE\n            else:\n                from_text = \"from local cache\" if not node.remote else \"from '%s'\" % node.remote.name\n            out.writeln(\"    %s %s\" % (repr(node.conan_ref), from_text), Color.BRIGHT_CYAN)\n    _recipes(requires)\n    out.writeln(\"Packages\", Color.BRIGHT_YELLOW)\n\n    def _packages(nodes):\n        for node in nodes:\n            ref, conanfile = node.conan_ref, node.conanfile\n            ref = PackageReference(ref, conanfile.info.package_id())\n            out.writeln(\"    %s\" % (repr(ref)), Color.BRIGHT_CYAN)\n    _packages(requires)\n\n    out.writeln(\"\")\n", "path": "conans/client/graph/printer.py"}], "after_files": [{"content": "from conans.client.output import Color\nfrom conans.model.ref import PackageReference\nfrom conans.model.workspace import WORKSPACE_FILE\n\n\ndef print_graph(deps_graph, out):\n    all_nodes = []\n    ids = set()\n    for node in sorted(n for n in deps_graph.nodes if n.conan_ref):\n        package_id = PackageReference(node.conan_ref, node.conanfile.info.package_id())\n        if package_id not in ids:\n            all_nodes.append(node)\n            ids.add(package_id)\n    requires = [n for n in all_nodes]\n    out.writeln(\"Requirements\", Color.BRIGHT_YELLOW)\n\n    def _recipes(nodes):\n        for node in nodes:\n            if node.remote == WORKSPACE_FILE:\n                from_text = \"from '%s'\" % WORKSPACE_FILE\n            else:\n                from_text = \"from local cache\" if not node.remote else \"from '%s'\" % node.remote.name\n            out.writeln(\"    %s %s\" % (repr(node.conan_ref), from_text), Color.BRIGHT_CYAN)\n    _recipes(requires)\n    out.writeln(\"Packages\", Color.BRIGHT_YELLOW)\n\n    def _packages(nodes):\n        for node in nodes:\n            ref, conanfile = node.conan_ref, node.conanfile\n            ref = PackageReference(ref, conanfile.info.package_id())\n            out.writeln(\"    %s\" % (repr(ref)), Color.BRIGHT_CYAN)\n    _packages(requires)\n\n    out.writeln(\"\")\n", "path": "conans/client/graph/printer.py"}]}