Skip to content

feat: update default windows compiler#2136

Open
Glatzel wants to merge 20 commits intoprefix-dev:mainfrom
Glatzel:update-win-compiler
Open

feat: update default windows compiler#2136
Glatzel wants to merge 20 commits intoprefix-dev:mainfrom
Glatzel:update-win-compiler

Conversation

@Glatzel
Copy link
Copy Markdown
Contributor

@Glatzel Glatzel commented Feb 10, 2026

@Glatzel
Copy link
Copy Markdown
Contributor Author

Glatzel commented Feb 10, 2026

The error comes from upstream vc package and starts from vs2019_xxx. The expansion of temp(prefix) path in test in vc activate.bat exceeds 8192 characters.

https://github.com/conda-forge/vc-feedstock/blob/41025d6f35dbe5134294f7ad2cbca95a25b8ec65/recipe/activate.bat#L155-L159

https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation

@Glatzel Glatzel marked this pull request as ready for review February 10, 2026 11:12
@wolfv
Copy link
Copy Markdown
Member

wolfv commented Feb 17, 2026

Hey @Glatzel I am not sure if we should really edit this ... I have asked on Zulip:

#build-tools > Updating the default compilers (Windows)

@Glatzel
Copy link
Copy Markdown
Contributor Author

Glatzel commented Feb 18, 2026

Hi @wolfv, I agree with removing the default bahavior of parsing ${{compiler('xxx')}} like thing.

But, it needs decision, if you think rattler-build concerns more about building for arbitrary build environment, not just conda-forge, removing the default compiler is reasonable. Just need to add docs the sample pin file/link(the one in conda-forge-pinning-feedstock is already good enough), users will add their own conda_build_config.yaml and have fully control over their own build workflow, just like a normal varient file, no black-box and implicit "magic".

If you decide to apply the no default compiler solution, just close this pr. I may try it to remove those compiler relate code and revise the doc. It could effect many tests and need some time, so no guarentee here.

Update default Windows compilers to match conda-forge pinning:
- C/C++: vs2017 → vs2022
- Fortran: gfortran → flang (on Windows)

References: conda-forge/conda-forge-pinning-feedstock

Co-Authored-By: Glatzel <chenzelin9794@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wolfv wolfv force-pushed the update-win-compiler branch from d7707fe to 64c7e1d Compare February 18, 2026 11:58
@Glatzel
Copy link
Copy Markdown
Contributor Author

Glatzel commented Apr 2, 2026

The doc is generated by ai, but I have reviewed and revised it.

@Hofer-Julian
Copy link
Copy Markdown
Contributor

Will check this out @Glatzel as soon as CI is green. Please ping me sometime next week if I don't get to it :)

Comment on lines +10 to +30
@pytest.fixture
def clean_path_on_win32():
# On Windows, clear path to avoid hitting the cmd.exe
# line-length limit during VS compiler activation (vcvars64.bat).
if sys.platform == "win32":
original_path = os.environ.get("PATH", "")
try:
os.environ["PATH"] = ""
yield
finally:
os.environ["PATH"] = original_path
else:
yield


def pytest_configure(config):
# On Windows, use a short absolute path to avoid hitting the cmd.exe
# line-length limit during VS compiler activation (vcvars64.bat).
if sys.platform == "win32":
worker_id = os.environ.get("PYTEST_XDIST_WORKER", "bld").replace("gw", "")
config.option.basetemp = Path(f"C:/{worker_id}")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baszalmstra can you please take a look if this makes sense to you?

@Glatzel Glatzel requested a review from Hofer-Julian April 3, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change default windows compiler to vs2022

3 participants