Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case mismatch between "include" and "Include" #85835

Open
indygreg mannequin opened this issue Aug 30, 2020 · 5 comments
Open

Case mismatch between "include" and "Include" #85835

indygreg mannequin opened this issue Aug 30, 2020 · 5 comments
Labels
3.10 only security fixes OS-windows topic-installation type-bug An unexpected behavior, bug, or error

Comments

@indygreg
Copy link
Mannequin

indygreg mannequin commented Aug 30, 2020

BPO 41669
Nosy @pfmoore, @tjguk, @merwok, @zware, @zooba, @indygreg

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-08-30.21:48:06.267>
labels = ['type-bug', '3.10', 'OS-windows']
title = 'Case mismatch between "include" and "Include"'
updated_at = <Date 2020-10-22.20:44:59.869>
user = 'https://github.com/indygreg'

bugs.python.org fields:

activity = <Date 2020-10-22.20:44:59.869>
actor = 'eric.araujo'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Windows']
creation = <Date 2020-08-30.21:48:06.267>
creator = 'indygreg'
dependencies = []
files = []
hgrepos = []
issue_num = 41669
keywords = []
message_count = 3.0
messages = ['376131', '376172', '379344']
nosy_count = 6.0
nosy_names = ['paul.moore', 'tim.golden', 'eric.araujo', 'zach.ware', 'steve.dower', 'indygreg']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue41669'
versions = ['Python 3.10']

@indygreg
Copy link
Mannequin Author

indygreg mannequin commented Aug 30, 2020

On Windows, sysconfig.get_path('include') returns Include (capital I).

However, the actual installation path is include (lowercase i).

I believe the reason for the case mismatch is in this code in PC/layout/main.py:

    if ns.include_dev:

        for dest, src in rglob(ns.source / "Include", "**/*.h"):
            yield "include/{}".format(dest), src
        src = ns.source / "PC" / "pyconfig.h"
        yield "include/pyconfig.h", src

The case mismatch is relevant for case sensitive filesystems. In my case, I was extracting a Windows Python install on Linux and then using the sysconfig value to locate directories within that install. Due to the case mismatch, Linux says Include doesn't exist since sysconfig points to "include."

Case only renames can be a bit wonky to perform. I would suggest preserving what is shipped today and changing sysconfig to advertise lowercase "include." However, this would create a mismatch between the cpython source repo and built distributions. So maybe attempting the case-only rename is doable.

Note that Windows will not allow you to have a file/directory varying only in case. i.e. you can have both an "include" and "Include." I can't recall if you can perform a case-only rename with a single system call (meaning it is atomic) or whether you need to go through a temporary directory.

@indygreg indygreg mannequin added 3.8 only security fixes OS-windows type-bug An unexpected behavior, bug, or error labels Aug 30, 2020
@zooba
Copy link
Member

zooba commented Aug 31, 2020

Unfortunately, it's easier to change what we distribute, except that has _always_ been "include" (based on a 2.4 installer I had laying around). And of course we can't change the repo.

Still, case sensitivity is becoming more acceptable on Windows and there are more ways to enable it, so we're probably best to deal with this. For 3.10, we can update PC/layout/main.py and tools/msi/common.wxs#L80 to create "Include", and we probably want to go over the few places where we may reference it to make sure the case is consistent. (Noting that distutils is fully deprecated in 3.10, so it doesn't matter.)

I'm not sure that it qualifies as enough of a bugfix for 3.8 or 3.9.1, so I think we'll leave them alone. A case-sensitive file system can easily support a symlink/junction from "Include" to "include" anyway, which is a pretty straightforward workaround ;)

@zooba zooba added 3.10 only security fixes and removed 3.8 only security fixes labels Aug 31, 2020
@merwok
Copy link
Member

merwok commented Oct 22, 2020

Is this the same as bpo-24908 ?

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@FFY00
Copy link
Member

FFY00 commented Apr 3, 2023

Is this still relevant?

@zooba
Copy link
Member

zooba commented Apr 3, 2023

Nothing has been changed, so I suppose so.

Incidentally, there's also a change required to Tools\msi\common.wxs which is where the directory is named for the regular installer. Fixing the layout script should cover the other distribution packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes OS-windows topic-installation type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants