Skip to content

fix: if miktex is available then make use of it#1305

Merged
RobPasMue merged 11 commits into
mainfrom
fix/use-miktex-if-available-on-windows
May 13, 2026
Merged

fix: if miktex is available then make use of it#1305
RobPasMue merged 11 commits into
mainfrom
fix/use-miktex-if-available-on-windows

Conversation

@RobPasMue
Copy link
Copy Markdown
Member

Reported in ansys/pysherlock#778

If MikTex is installed already at system level, the new action implementation causes it to fail since we simply take it from the local installation. Let's make it more "dynamic"

  1. Verify if MikTex is already there - if so, use it
  2. If the available installs of MikTex are corrupt - reinstall at local user level
  3. If MikTex is not installed - then use the local user install

@RobPasMue RobPasMue requested a review from a team as a code owner May 8, 2026 08:17
@github-actions github-actions Bot added the fix Pull requests related to resolving problems or errors label May 8, 2026
Comment thread doc-build/action.yml Outdated
@RobPasMue
Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Contributor

@AlejandroFernandezLuces AlejandroFernandezLuces left a comment

Choose a reason for hiding this comment

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

LGTM if it fixes the issue. Just an opinionated suggestion. Is it possible to handle the ifs logic with github workflow syntax and keep powershell minimal? I really hate powershell it is so hard to read.

I'm thinking of something like: try to use user installation. If it fails, proceed to next approach.

@RobPasMue
Copy link
Copy Markdown
Member Author

I'm thinking of something like: try to use user installation. If it fails, proceed to next approach.

We will hardly get around the powershell syntax - especially for the Windows-based action 😄 . I agree with you, it's not my favourite either... but even if we split it into GitHub workflow steps, we will still need to verify the exit codes from previous powershell operations, store paths into the env, etc. -- meaning that we might be able to reduce 20% of the PowerShell syntax at the expense of increasing a lot the number of steps ( I envision at least 3 new workflow steps in that case)...

So, overall, the gain is not too much 😄

Let's discuss this altogether in the next team meeting (getting rid of PowerShell syntax as much as possible) - but if we attempt this, it will have to be done at a larger scale. And we would have to ensure that all runners have a bash terminal (Windows runners included, since sometimes the self-hosted ones might be missing it). But I'm all for it!

Comment thread _doc-build-windows/action.yml Outdated
Comment thread _doc-build-windows/action.yml Outdated
Comment thread _doc-build-windows/action.yml Outdated
Copy link
Copy Markdown
Contributor

@MaxJPRey MaxJPRey left a comment

Choose a reason for hiding this comment

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

Great! I was rusty with PowerShell though.

@RobPasMue RobPasMue requested review from MaxJPRey and klmcadams May 11, 2026 06:40
Copy link
Copy Markdown
Contributor

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for handling that @RobPasMue. I left a minor comment to remove the extra argument (and had a great time discovering coding in powershell... \o/)

Given the problem that happened in the past with choco and potential future updates, I would highly recommend any installation at system level to be removed and reinstalled at user level but if this. But, that's another siubject :)

Comment thread _doc-build-windows/action.yml
Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com>
@RobPasMue
Copy link
Copy Markdown
Member Author

RobPasMue commented May 11, 2026

Given the problem that happened in the past with choco and potential future updates, I would highly recommend any installation at system level to be removed and reinstalled at user level but if this. But, that's another siubject :)

Let's leave that for another day 😄 - I think that's a broader discussion we should have for all choco-related installs we perform. And we should handle the changes all at the same time throughout our actions

@RobPasMue
Copy link
Copy Markdown
Member Author

@MaxJPRey @SMoraisAnsys @klmcadams - since your comments implied modifications, please review the PR again before we proceed to merge

Comment thread _doc-build-windows/action.yml
Copy link
Copy Markdown
Contributor

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

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

LGTM, just revert the pinned branch and all good :)

@RobPasMue RobPasMue merged commit 4b36210 into main May 13, 2026
82 of 83 checks passed
@RobPasMue RobPasMue deleted the fix/use-miktex-if-available-on-windows branch May 13, 2026 07:40
@RobPasMue
Copy link
Copy Markdown
Member Author

@moe-ad - could you please trigger a patch release with these changes?

moe-ad pushed a commit that referenced this pull request May 13, 2026
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com>
@moe-ad
Copy link
Copy Markdown
Contributor

moe-ad commented May 13, 2026

Release completed.

@RobPasMue
Copy link
Copy Markdown
Member Author

Thanks @moe-ad !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests related to resolving problems or errors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants