This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients eric.snow, ned.deily, pablogsal, ronaldoussoren, steve.dower, vinay.sajip
Date 2022-03-07.21:39:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646689197.55.0.8791430941.issue46890@roundup.psfhosted.org>
In-reply-to
Content
WITH_NEXT_FRAMEWORK is a compile time option, I've added it to globals in values like PREFIX are added. That way the python code can behave differently for framework builds (which appears to be needed).

There are two big problems with my patches:
- Calculation of sys.prefix doesn't work in test_venv_framework_macos, but somehow works with a real installation. I haven't managed to track down the difference yet.
- Calculation for test_framework_macos appears to be ok on first glance, but adding "/Library/lib/python9.8.zip" as a known file shows that the code to look for the stdlib is misbehaving.

The latter appears to be a wider problem, if I add a test case based on test_normal_posix with PREFIX=/opt/python9.8 the getpath code looks for /opt/lib/python98.zip and uses that when found.

Test case for this (test passed when ``ns.add_known_file("/opt/lib/python98.zip")`` is commented out:

def test_normal_posix_in_opt(self):
          """Test a 'standard' install layout on *nix
          
          This uses '/opt/python9.8' as PREFIX
          """
          ns = MockPosixNamespace(
              PREFIX="/opt/python9.8",
              argv0="python",
              ENV_PATH="/usr/bin:/opt/python9.8/bin",
          )
          ns.add_known_xfile("/opt/python9.8/bin/python")
          ns.add_known_file("/opt/python9.8/lib/python9.8/os.py")
          ns.add_known_dir("/opt/python9.8/lib/python9.8/lib-dynload")
  
          # This shouldn't matter:
          ns.add_known_file("/opt/lib/python98.zip")
  
          expected = dict(
              executable="/opt/python9.8/bin/python",
              base_executable="/opt/python9.8/bin/python",
              prefix="/opt/python9.8",
              exec_prefix="/opt/python9.8",
              module_search_paths_set=1,
              module_search_paths=[
                  "/opt/python9.8/lib/python98.zip",
                  "/opt/python9.8/lib/python9.8",
                  "/opt/python9.8/lib/python9.8/lib-dynload",
              ],
          )
          actual = getpath(ns, expected)
          self.assertEqual(expected, actual)

This could be problematic, adding a suitably named file outside of $PREFIX breaks the python installation.  I haven't checked this with an unchanged getpath.py yet, but I shouldn't have made any changes that affect a non-framework install.
History
Date User Action Args
2022-03-07 21:39:57ronaldoussorensetrecipients: + ronaldoussoren, vinay.sajip, ned.deily, eric.snow, steve.dower, pablogsal
2022-03-07 21:39:57ronaldoussorensetmessageid: <1646689197.55.0.8791430941.issue46890@roundup.psfhosted.org>
2022-03-07 21:39:57ronaldoussorenlinkissue46890 messages
2022-03-07 21:39:57ronaldoussorencreate