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

[Feature]: list and suggest dependency packages #819

Open
1 task done
pzhlkj6612 opened this issue Sep 8, 2024 · 0 comments
Open
1 task done

[Feature]: list and suggest dependency packages #819

pzhlkj6612 opened this issue Sep 8, 2024 · 0 comments
Labels
enhancement New feature or request triage

Comments

@pzhlkj6612
Copy link
Contributor

Is your feature request related to a problem?

Source: jurplel/install-qt-action#253


This is https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_672/Updates.xml:

<PackageUpdate>
    <Name>qt.qt6.672.win64_mingw</Name>
    <DisplayName>MinGW 11.2.0 64-bit</DisplayName>
    <Description>Qt 6.7.2 Prebuilt Components for MinGW 11.2.0 64-bit</Description>
    <Version>6.7.2-0-202406110335</Version>
    <ReleaseDate>2024-06-11</ReleaseDate>
    <Dependencies>qt.tools.qtcreator, qt.tools.win64_mingw900, qt.qt6.672.doc, qt.qt6.672.examples</Dependencies>
    <AutoDependOn/>
    <Default>false</Default>
    <Script>installscript.qs</Script>
    <SortingPriority>590</SortingPriority>
    <DownloadableArchives>qtbase-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z, qtsvg-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z, qtdeclarative-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z, qttools-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z, qttranslations-Windows-Windows_10_22H2-Mingw-Windows-Windows_10_22H2-X86_64.7z, MinGW-w64-x86_64-11.2.0-release-posix-seh-rt_v9-rev1-runtime.7z, d3dcompiler_47-x64.7z, opengl32sw-64-mesa_11_2_2-signed_sha256.7z</DownloadableArchives>
    <UpdateFile CompressedSize="145016172" OS="Any" UncompressedSize="1107047540"/>
    <SHA1>45c7b1f426fd6dd1a7356bbd8fe37c85a8fe0ba5</SHA1>
</PackageUpdate>

Some users may don't know the mingw toolchain will not be installed without install-tool.

The solution

IMO, unconditionally installing all dependencies will cause a waste of space. Not everyone needs qt.tools.qtcreator, qt.qt6.672.doc and qt.qt6.672.examples, especially in a CI environment. However, the toolchain is essential for Qt development, so I think we can provide suggestions based on string matching.

$ aqt install-qt windows desktop 6.7.2 win64_mingw
...
INFO    : Downloading qtbase...
INFO    : Downloading qtdeclarative...
INFO    : Downloading qtsvg...
INFO    : Downloading qttools...
...
???     : Dependencies: qt.tools.qtcreator, qt.tools.win64_mingw900, qt.qt6.672.doc, qt.qt6.672.examples
???     : Suggested:
              tools_mingw90 (from qt.tools.win64_mingw900)

Another example:

https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_672/Updates.xml

<PackageUpdate>
    <Name>qt.qt6.672.win64_llvm_mingw</Name>
    <DisplayName>LLVM-MinGW 17.0.6 64-bit</DisplayName>
    <Description>Qt 6.7.2 Prebuilt Components for LLVM-MinGW 17.0.6 64-bit with clang compiler</Description>
    <Version>6.7.2-202406110335</Version>
    <ReleaseDate>2024-06-11</ReleaseDate>
    <Dependencies>qt.tools.qtcreator, qt.tools.win64_llvm_mingw1706, qt.qt6.672.doc, qt.qt6.672.examples</Dependencies>
    <AutoDependOn/>
    <Default>false</Default>
    <Script>installscript.qs</Script>
    <SortingPriority>590</SortingPriority>
    <DownloadableArchives>qtbase-Windows-Windows_11_23H2-Clang-Windows-Windows_11_23H2-X86_64.7z, qtsvg-Windows-Windows_11_23H2-Clang-Windows-Windows_11_23H2-X86_64.7z, qtdeclarative-Windows-Windows_11_23H2-Clang-Windows-Windows_11_23H2-X86_64.7z, qttools-Windows-Windows_11_23H2-Clang-Windows-Windows_11_23H2-X86_64.7z, qttranslations-Windows-Windows_11_23H2-Clang-Windows-Windows_11_23H2-X86_64.7z, llvm-mingw-20231128-ucrt-x86_64-runtime.7z, d3dcompiler_47-x64.7z, opengl32sw-64-mesa_11_2_2-signed_sha256.7z</DownloadableArchives>
    <UpdateFile CompressedSize="69141011" OS="Any" UncompressedSize="507994635"/>
    <SHA1>31ea0f63b7601ca7ee1cc7181e0837b0c9a57cea</SHA1>
</PackageUpdate>

https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/tools_llvm_mingw1706/Updates.xml

<Updates>
    <ApplicationName>{AnyApplication}</ApplicationName>
    <ApplicationVersion>1.0.0</ApplicationVersion>
    <Checksum>true</Checksum>
    <PackageUpdate>
    <Name>qt.tools.win64_llvm_mingw1706</Name>
    <DisplayName>LLVM-MinGW 17.0.6 64-bit</DisplayName>
    <Description>LLVM-MinGW-builds 17.0.6 64-bit toolchain</Description>
    <Version>17.0.6-202401290621</Version>
    <ReleaseDate>2024-01-29</ReleaseDate>
    <Dependencies>qt.tools.qtcreator</Dependencies>
    <Default>false</Default>
    <Script>installscript.qs</Script>
    <SortingPriority>1706</SortingPriority>
    <DownloadableArchives>llvm_mingw1706.7z</DownloadableArchives>
    <UpdateFile CompressedSize="81035244" OS="Any" UncompressedSize="525090560"/>
    <SHA1>440cb60331ffe975fb80bccfcd3ce894eee0b02d</SHA1>
    </PackageUpdate>
    <SHA1>f551f31e2bdc0c3876484d6f357c67accc940a25</SHA1>
    <MetadataName>2024-01-29-0623_meta.7z</MetadataName>
</Updates>
$ aqt install-qt windows desktop 6.7.2 win64_llvm_mingw
...
???     : Dependencies: ...
???     : Suggested:
              tools_llvm_mingw1706 (from qt.tools.win64_llvm_mingw1706)

.

Alternatives you've considered

None.

Additional context

I didn't debug the code, but saw the get_depends() function and a few tests about it:

aqtinstall/aqt/archives.py

Lines 231 to 247 in cc13229

def get_depends(self, target: str) -> Iterable[str]:
# initialize
filo = [target]
packages = []
visited = []
# dfs look-up
while len(filo) > 0:
next = filo.pop()
packages.append(next)
for entry in self.package_updates:
if entry.name == next:
visited.append(next)
if entry.dependencies is not None:
for depend in entry.dependencies:
if depend not in visited:
filo.append(depend)
return packages

.

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

1 participant