Skip to content

Conversation

thomashampson
Copy link
Contributor

@thomashampson thomashampson commented Oct 3, 2024

Description of work

Something has changed between conda 24.7 and 24.9 to cause a failure when installing the mantidworkbench package on our Windows CI machines. It fails at the post-link.bat stage, which is required to set a Qt plugin path environment variable:

ERROR conda.core.link:_execute(951): An error occurred while installing package 'file:///C:/jenkins_workdir/workspace/release-next_nightly_deployment/conda-bld::mantidworkbench-6.10.20241002.1135-py310h424512f_0'.
Rolling back transaction: ...working... done
post-link script failed for package file:///C:/jenkins_workdir/workspace/release-next_nightly_deployment/conda-bld::mantidworkbench-6.10.20241002.1135-py310h424512f_0
location of failed script: C:\jenkins_workdir\workspace\release-next_nightly_deployment\source\installers\conda\win\_conda_env\Scripts\.mantidworkbench-post-link.bat
==> script messages <==
<None>
==> script output <==
stdout:
stderr: The system cannot find the path specified.

return code: 1

Pinning conda in the package-conda environment appears circumvent the problem. We do this for now to get the nightly running and investigate further later. For some reason I wasn't able to reproduce the problem locally but since there were no code changes that could cause this it is almost certainly the conda version change that has broken it.

There is no associated issue.

To test:

Verify the packages are build in this job:
https://builds.mantidproject.org/job/build_packages_from_branch/916/
Install the Windows conda package with:

mamba create -n workbench_windows_test
mamba activate workbench_windows_test
mamba install -c thomashampson/label/postlinkfix mantidworkbench

and verify that it launches with the workbench command.

This does not require release notes because it's a build script change


Reviewer

Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards?
  • Are the unit tests small and test the class in isolation?
  • If there is GUI work does it follow the GUI standards?
  • If there are changes in the release notes then do they describe the changes appropriately?
  • Do the release notes conform to the release notes guide?

Functional Tests

  • Do changes function as described? Add comments below that describe the tests performed?
  • Do the changes handle unexpected situations, e.g. bad input?
  • Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

@thomashampson thomashampson added High Priority An issue or pull request that if not addressed is severe enough to postponse a release. ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions DevOps Issues and pull requests related to DevOps Dependencies Pull requests that update a dependency file labels Oct 3, 2024
@thomashampson thomashampson added this to the Release 6.11 milestone Oct 3, 2024
@thomashampson thomashampson marked this pull request as ready for review October 3, 2024 15:03
@SilkeSchomann SilkeSchomann self-assigned this Oct 3, 2024
@cailafinn cailafinn self-assigned this Oct 3, 2024
@jclarkeSTFC
Copy link
Contributor

I'll check the Windows conda install

@jclarkeSTFC jclarkeSTFC self-assigned this Oct 3, 2024
Copy link
Contributor

@SilkeSchomann SilkeSchomann left a comment

Choose a reason for hiding this comment

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

I can confirm that workbench starts as expected when following the test instructions.

Since the windows test failure was not caused by these changes I am happy to approve.

Copy link
Contributor

@jclarkeSTFC jclarkeSTFC left a comment

Choose a reason for hiding this comment

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

Conda install worked fine on my Windows machine.

@cailafinn cailafinn merged commit 25060cc into release-next Oct 3, 2024
9 of 10 checks passed
@cailafinn cailafinn deleted the fix_windows_post_linking branch October 3, 2024 15:33
SilkeSchomann pushed a commit that referenced this pull request May 12, 2025
…#39295)

### Description of work
Move logic to set `QT_PLUGIN_PATH` from `post-link.bat` to Python. This
will make Conda installs on Windows more robust.

#### Summary of work
The `post-link.bat` file included in the `mantidworkbench` conda recipe
was added to set `QT_PLUGIN_PATH` to avoid the following error that
prevents workbench from launching:
```
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
```
For some conda installs on Windows it was necessary to deactivate and
reactivate the environment so that the `post-link.bat` takes effect. Not
sure why. It has also been necessary to pin conda in [the
past](#38140) when we were
unable to install `mantidworkbench` to create the standalone package.
Here we move the logic to Python, which avoids the need for the
additional scripts in the conda recipe. This aligns with the
recommendation that such scripts should [be avoided whenever
possible](https://docs.conda.io/projects/conda-build/en/stable/resources/link-scripts.html).

Fixes #38997

### To test:
1. Install the standalone Windows from
[here](https://builds.mantidproject.org/job/build_packages_from_branch/1100/)
package and check that it launches
2. Install the conda package and check that it launches:
`conda install thomashampson/label/qt_plugin_path_test::mantidworkbench
-c mantid`


<!-- Ensure the base of this PR is correct (e.g. release-next or main)
Finally, don't forget to add the appropriate labels, milestones, etc.!
-->

---

### Reviewer

Please comment on the points listed below ([full
description](http://developer.mantidproject.org/ReviewingAPullRequest.html)).
**Your comments will be used as part of the gatekeeper process, so
please comment clearly on what you have checked during your review.** If
changes are made to the PR during the review process then your final
comment will be the most important for gatekeepers. In this comment you
should make it clear why any earlier review is still valid, or confirm
that all requested changes have been addressed.

#### Code Review

- Is the code of an acceptable quality?
- Does the code conform to the [coding
standards](http://developer.mantidproject.org/Standards/)?
- Are the unit tests small and test the class in isolation?
- If there is GUI work does it follow the [GUI
standards](http://developer.mantidproject.org/Standards/GUIStandards.html)?
- If there are changes in the release notes then do they describe the
changes appropriately?
- Do the release notes conform to the [release notes
guide](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)?

#### Functional Tests

- Do changes function as described? Add comments below that describe the
tests performed?
- Do the changes handle unexpected situations, e.g. bad input?
- Has the relevant (user and developer) documentation been
added/updated?

Does everything look good? Mark the review as **Approve**. A member of
`@mantidproject/gatekeepers` will take care of it.

### Gatekeeper

If you need to request changes to a PR then please add a comment and set
the review status to "Request changes". This will stop the PR from
showing up in the list for other gatekeepers.
peterfpeterson pushed a commit to peterfpeterson/mantid that referenced this pull request Jun 20, 2025
…mantidproject#39295)

### Description of work
Move logic to set `QT_PLUGIN_PATH` from `post-link.bat` to Python. This
will make Conda installs on Windows more robust.

#### Summary of work
The `post-link.bat` file included in the `mantidworkbench` conda recipe
was added to set `QT_PLUGIN_PATH` to avoid the following error that
prevents workbench from launching:
```
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
```
For some conda installs on Windows it was necessary to deactivate and
reactivate the environment so that the `post-link.bat` takes effect. Not
sure why. It has also been necessary to pin conda in [the
past](mantidproject#38140) when we were
unable to install `mantidworkbench` to create the standalone package.
Here we move the logic to Python, which avoids the need for the
additional scripts in the conda recipe. This aligns with the
recommendation that such scripts should [be avoided whenever
possible](https://docs.conda.io/projects/conda-build/en/stable/resources/link-scripts.html).

Fixes mantidproject#38997

### To test:
1. Install the standalone Windows from
[here](https://builds.mantidproject.org/job/build_packages_from_branch/1100/)
package and check that it launches
2. Install the conda package and check that it launches:
`conda install thomashampson/label/qt_plugin_path_test::mantidworkbench
-c mantid`


<!-- Ensure the base of this PR is correct (e.g. release-next or main)
Finally, don't forget to add the appropriate labels, milestones, etc.!
-->

---

### Reviewer

Please comment on the points listed below ([full
description](http://developer.mantidproject.org/ReviewingAPullRequest.html)).
**Your comments will be used as part of the gatekeeper process, so
please comment clearly on what you have checked during your review.** If
changes are made to the PR during the review process then your final
comment will be the most important for gatekeepers. In this comment you
should make it clear why any earlier review is still valid, or confirm
that all requested changes have been addressed.

#### Code Review

- Is the code of an acceptable quality?
- Does the code conform to the [coding
standards](http://developer.mantidproject.org/Standards/)?
- Are the unit tests small and test the class in isolation?
- If there is GUI work does it follow the [GUI
standards](http://developer.mantidproject.org/Standards/GUIStandards.html)?
- If there are changes in the release notes then do they describe the
changes appropriately?
- Do the release notes conform to the [release notes
guide](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)?

#### Functional Tests

- Do changes function as described? Add comments below that describe the
tests performed?
- Do the changes handle unexpected situations, e.g. bad input?
- Has the relevant (user and developer) documentation been
added/updated?

Does everything look good? Mark the review as **Approve**. A member of
`@mantidproject/gatekeepers` will take care of it.

### Gatekeeper

If you need to request changes to a PR then please add a comment and set
the review status to "Request changes". This will stop the PR from
showing up in the list for other gatekeepers.
peterfpeterson pushed a commit to peterfpeterson/mantid that referenced this pull request Jun 20, 2025
…mantidproject#39295)

### Description of work
Move logic to set `QT_PLUGIN_PATH` from `post-link.bat` to Python. This
will make Conda installs on Windows more robust.

#### Summary of work
The `post-link.bat` file included in the `mantidworkbench` conda recipe
was added to set `QT_PLUGIN_PATH` to avoid the following error that
prevents workbench from launching:
```
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
```
For some conda installs on Windows it was necessary to deactivate and
reactivate the environment so that the `post-link.bat` takes effect. Not
sure why. It has also been necessary to pin conda in [the
past](mantidproject#38140) when we were
unable to install `mantidworkbench` to create the standalone package.
Here we move the logic to Python, which avoids the need for the
additional scripts in the conda recipe. This aligns with the
recommendation that such scripts should [be avoided whenever
possible](https://docs.conda.io/projects/conda-build/en/stable/resources/link-scripts.html).

Fixes mantidproject#38997

### To test:
1. Install the standalone Windows from
[here](https://builds.mantidproject.org/job/build_packages_from_branch/1100/)
package and check that it launches
2. Install the conda package and check that it launches:
`conda install thomashampson/label/qt_plugin_path_test::mantidworkbench
-c mantid`


<!-- Ensure the base of this PR is correct (e.g. release-next or main)
Finally, don't forget to add the appropriate labels, milestones, etc.!
-->

---

### Reviewer

Please comment on the points listed below ([full
description](http://developer.mantidproject.org/ReviewingAPullRequest.html)).
**Your comments will be used as part of the gatekeeper process, so
please comment clearly on what you have checked during your review.** If
changes are made to the PR during the review process then your final
comment will be the most important for gatekeepers. In this comment you
should make it clear why any earlier review is still valid, or confirm
that all requested changes have been addressed.

#### Code Review

- Is the code of an acceptable quality?
- Does the code conform to the [coding
standards](http://developer.mantidproject.org/Standards/)?
- Are the unit tests small and test the class in isolation?
- If there is GUI work does it follow the [GUI
standards](http://developer.mantidproject.org/Standards/GUIStandards.html)?
- If there are changes in the release notes then do they describe the
changes appropriately?
- Do the release notes conform to the [release notes
guide](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)?

#### Functional Tests

- Do changes function as described? Add comments below that describe the
tests performed?
- Do the changes handle unexpected situations, e.g. bad input?
- Has the relevant (user and developer) documentation been
added/updated?

Does everything look good? Mark the review as **Approve**. A member of
`@mantidproject/gatekeepers` will take care of it.

### Gatekeeper

If you need to request changes to a PR then please add a comment and set
the review status to "Request changes". This will stop the PR from
showing up in the list for other gatekeepers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Pull requests that update a dependency file DevOps Issues and pull requests related to DevOps High Priority An issue or pull request that if not addressed is severe enough to postponse a release. ISIS: Core Issue and pull requests at ISIS that relate to Core features and functions
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants