Skip to content

Frozen modules shouldn't be written to the source tree on Windows #113258

Closed

Description

@itamaro

Feature or enhancement

Proposal:

As a follow-up to gh-113039, this issue suggests we change the Windows build to avoid writing the generated frozen modules back into the source tree.

Quoting @zooba

I'm not sure where the relative path came from, but I don't like it. I'm also not a huge fan of generated files going back into the source tree (I prefer them in $(IntDir) so that read-only source trees are supported)

This is already the case on Linux and MacOS, so making Windows use $(IntDir) for these is also more consistent.

While we're there, consider also changing getpath.c again to include getpath.h, as suggested here.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

Previous discussion: gh-113039

Linked PRs

Activity

  1. itamaro commented on Dec 18, 2023

    @itamaro
    ContributorAuthor

    for future reference, the frozen modules Windows build is in PCbuild/_freeze_module.vcxproj

  2. added a commit that references this issue on Dec 20, 2023
  3. itamaro commented on Dec 20, 2023

    @itamaro
    ContributorAuthor

    @zooba I made an attempt in gh-113303
    it successfully generated the frozen modules (headers and deepfreeze.c) in $(IntDir), but I wasn't able to get the rest of the build to find these. I think my problem is that the generated files are written to the $(IntDir) of the _freeze_module project, which is not the same thing as the $(IntDir) of the pythoncore project. before falling into a rabbit hole about how to get one vcxproj consuming the intermediate outputs of another vcxproj, I wanted to pause and see if this is even the right direction, and whether there are other examples in the Windows build that I can borrow from.

  4. zooba commented on Dec 20, 2023

    @zooba
    Member

    Make sure you've got the latest from main, and then look for GeneratedPyConfigDir in pyproject.props. You'll want to do something like that for FrozenModulesDir and then reference that variable instead (it can keep the extra subdirectories so that #include works the same, but use the new property throughout the projcet files).

    There's also a script to update the project files with the properties you've edited, so make sure you find and update that first and then regenerate the files. It's probably in Tools somewhere, and might be referenced from PCbuild/regen.targets, which would mean you can PCbuild/build.bat --regen to run it.

  5. added a commit that references this issue on Dec 25, 2023
  6. added a commit that references this issue on Jan 3, 2024
  7. added a commit that references this issue on Jan 22, 2024
  8. added a commit that references this issue on Feb 11, 2024
  9. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsbuildThe build process and cross-buildtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions