Compiling python on windows with vs

Thomas Schweikle tschweikle at bfs.de
Tue Jun 13 15:32:32 EDT 2023



Am Di., 13.Juni.2023 um 20:36:17 schrieb Mats Wichmann via Python-list:
> On 6/13/23 12:12, Thomas Schweikle via Python-list wrote:
>>
>>
>> Am Di., 13.Juni.2023 um 19:20:38 schrieb Jim Schwartz:
>>> What version of visual studio are you using?
>>
>> Visual Studio 2022, aka 17.6.2.
>>
>>> What version of python?
>>
>> python 3.10.11 or 3.11.4
>>
>>> I’ve had success with using the cython package in python and cl from 
>>> visual studio, but I haven’t tried visual studio alone.
>>
>> Same problem at the same place: directory "../modules/..." not found, 
>> Renaming it from "Modules" to "modules" it is found, but then fails to 
>> find "Modules".
>>
>> Looks like it awaits, compiling in Windows an filesystem only case 
>> aware, not case sensitive -- I'm assuming this a bug now. Building 
>> within cygwin (or MSYS, Ubuntu) this works as expected. But there it 
>> does not search for "modules" once and "Modules" at an other place.
> 
> I just did this build the other day for the first time even from a git 
> checkout (so VS22, and not a versioned release but top of main branch), 
> and there was no such problem - did you follow the instructions at 
> https://devguide.python.org/getting-started/setup-building/index.html?

Yes.
Had git installed (2.41.0.windows.1), did "git clone 
https://github.com/python/cpython.git", then checked out the branch I 
wanted: "git checkout 3.10.12" (or 3.11.4, 3.12.0b2).

Python was already installed and in path:
"python --version" gives back: "Python 3.11.4"

Changed into cpython directory, then called: ".\PCbuild\build.bat" 
(".\pcbuild\build.bat" will, within cmd.exe, throw an error: File not 
found -- remember directory cpython and all beyond are case sensitive, 
not only case aware -- git sets case sensitiveness for checked out 
directories).

It compiles until it does not find "modules", because the directory is 
named "Modules" (all posix file systems behave this way and NTFS can be 
forced to behave this way too. It is easy and any user can do it:

"fsutil.exe file SetCaseSensitiveInfo <path> enable"

You may query this with:

"fsutil.exe file queryCaseSensitiveInfo <path>"

In my case:
~/Documents/Projekte/cpython> fsutil.exe file queryCaseSensitiveInfo .
Das Attribut für Groß-/Kleinschreibung für das Verzeichnis ^
"C:\Users\user\Documents\Projekte\cpython" ist aktiviert.

Or: the directory we're in is case sensitive and distinguishes between 
"Modules", "modules" and "MODULES" and you can have them all:

C:\Users\user\Documents\Projekte\cpython>dir
  Datenträger in Laufwerk C: ist Windows
  Volumeseriennummer: BC5E-F466

  Verzeichnis von C:\Users\user\Documents\Projekte\cpython

Di, 13.Jun.2023  21:23    <DIR>          .
Di, 13.Jun.2023  21:23    <DIR>          ..
[...]
Di, 13.Jun.2023  21:23    <DIR>          MODULES
Mo, 12.Jun.2023  22:13    <DIR>          Modules
Di, 13.Jun.2023  21:23    <DIR>          modules
[...]
               16 Datei(en),      1.320.340 Bytes
               21 Verzeichnis(se), 134.699.622.400 Bytes frei

Since case sensitivity is necessary for a variety of projects normally 
only used with *nix-OS I've configured git to create directories with 
case sensitivity set enabled (its default meanwhile if git is installed 
on windows).
-- 
Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 321 bytes
Desc: OpenPGP digital signature
URL: <https://mail.python.org/pipermail/python-list/attachments/20230613/76371ffd/attachment.sig>


More information about the Python-list mailing list