simplify create_pagefile.bat#2569
Merged
Merged
Conversation
mgorny
approved these changes
Jun 3, 2026
| if exist D:\ set "PageFileDrive=D:" | ||
| ) | ||
|
|
||
| :: Only run if PAGEFILE_SIZE is set; EntryPointPath needs to be set outside if-condition when not using EnableDelayedExpansion. |
Contributor
There was a problem hiding this comment.
To be honest, I've left that comment in case the file changed in the future, but I'm fine with removing it.
Member
Author
There was a problem hiding this comment.
Since we're conditionally setting PageFileDrive, we can never remove delayed expansion here. 🤷
| PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%EntryPointPath%' -MinimumSize "%PAGEFILE_SIZE%GB" -MaximumSize "%PAGEFILE_SIZE%GB" -DiskRoot \"%PageFileDrive%\"" | ||
| ) | ||
| echo CONDA_BLD_PATH=%CONDA_BLD_PATH%; Setting pagefile size to %PAGEFILE_SIZE% GiB in %PageFileDrive% | ||
| REM Inspired by: |
Contributor
There was a problem hiding this comment.
BTW do we have an opinion on REM vs :: here?
Member
Author
There was a problem hiding this comment.
:: is nicer, but doesn't play well with indentation (of course it's possible to write the script; but it used to lead to warnings and/or weird output; perhaps things have improved...?).
My rule of thumb is: "if unindented, use ::; if indented, use REM"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2562; there's no scenario where
"%PageFileDrive%" == ""is ever true, so get rid of the condition for that; also delete a comment about not using delayed expansion, since that script is using delayed expansion. Finally, break up a very long line, at least a little (the rest is a nested invocation, so leave that as-is).CC @mgorny