Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "ReadLinesFromFile" task was not given a value for the required parameter "File". after automatic upgrade to v3.3.1 #44

Open
AnyOldName3 opened this issue Jan 22, 2025 · 2 comments

Comments

@AnyOldName3
Copy link

Describe the bug
When building a .sln with v3.3.1 which hasn't been modified and worked fine with v3.2.0, I get the following error:

C:\Users\...\AppData\Local\QtMsBuild\qt_vars.targets(521,5): error MSB4044: The "ReadLinesFromFile" task was not given a value for the required parameter "File".

It's possible that it worked with v3.3.0, too, as the last successful build was after that version was tagged, but I don't know if there was an automatic update installed between it being tagged and that build.

To Reproduce
Steps to reproduce the behavior:

Currently unknown - the specific project's under NDA, so I can't provide it, and I'm about to finish work for the day, so want this posted in case anyone who knows something figures it out overnight. I'll try and come up with something tomorrow.

Expected behavior
This error doesn't happen, and the build succeeds.

Screenshots

Image

Desktop (please complete the following information):

  • Qt VS Tool Version 3.3.1
  • Visual Studio version: VS2022

Additional context
Add any other context about the problem here.

@AnyOldName3
Copy link
Author

I think I've isolated the cause. It's a <Keyword>Qt4VSv1.0</Keyword> project, so doesn't set QtVsProjectSettings. The part of qt_vars.targets that sets QtVarsFilePath has Condition="'$(QtVsProjectSettings)' == 'true'", so it's left unset, and so <ReadLinesFromFile File="$(QtVarsFilePath)"> in the QtVarsRead target has its File set to an empty string.

That line was added by 1ef7c52, and before that, it looks like the file was imported, directly, and that was gated behind an Exists('$(QtVarsFilePath)') check. I've tested, and Exists returns false when it's passed an empty string.

Based on that, I tried just gating the QtVarsRead target off so it doesn't do anything when QtVsProjectSettings is unset, but haven't yet managed to get that working.

I managed to reproduce the error by modifying the QtProjectV200.vcxproj from this repo's Tests/ProjectFormats directory. When I compared the unmodified file to the one from the project that died, a difference that stuck out to me was that the dead project had

  <ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
    <Import Project="$(QtMsBuild)\qt.targets" />
  </ImportGroup>

at the end. Adding that block to this repo's test gave the same error. Lots of the other templates and tests in this repo have the same ImportGroup, so I guess this is something that's supposed to work.

I've done enough to confirm this is a regression, identify what caused it and how to reproduce it to satisfy myself, so I'm going to downgrade to an older version so I can move on with my work now.

@kaheimri
Copy link
Collaborator

Thank you very much for reporting this issue and providing additional insights. Your report has been recorded in our public bug tracker, where all further updates will be shared: The "ReadLinesFromFile" task was not given a value for the required parameter "File". (issue #44).

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

No branches or pull requests

2 participants