这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Maxython
Copy link
Member

@Maxython Maxython commented Jun 12, 2024

close #20338 - it is not possible to compile all packages using build-all.sh because buildorder.py cannot create build orders with circular dependencies.

There is also a solution to part of problem #20500:

Subpackages cause cycles in the build order.

There are also minor changes, all details are in the commit.

CC @tstein @TomJo2000

@Maxython Maxython force-pushed the fix-build-all branch 2 times, most recently from 9b5068d to 4317575 Compare June 13, 2024 14:35
@Maxython Maxython changed the title build-all.sh: fixes for working with cyclic dependencies Script improvements and fixes Jun 13, 2024
@Maxython Maxython force-pushed the fix-build-all branch 2 times, most recently from 59138be to c820cc0 Compare June 13, 2024 17:53
Copy link
Contributor

@tstein tstein left a comment

Choose a reason for hiding this comment

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

It took me an hour to review this and I'm still not clear on what the new behavior is. We should not merge this until the code and comments are clear enough that reading it in one pass leaves you with a truthy understanding of the build order computation.

(I think it's a mistake to keep hacking on this without stepping back to think about how this code should be and how your changes get us closer. Not trying to block, because I think it's possible to get this to a state where it's better to merge it than not, but then we should have that conversation right after this.)

@agnostic-apollo

This comment was marked as off-topic.

@Maxython

This comment was marked as off-topic.

@agnostic-apollo

This comment was marked as off-topic.

@Maxython Maxython force-pushed the fix-build-all branch 5 times, most recently from 3dab149 to d46835f Compare June 17, 2024 15:23
@Maxython Maxython marked this pull request as ready for review June 17, 2024 15:23
@Maxython Maxython requested a review from Grimler91 June 17, 2024 15:23
@Maxython Maxython changed the title Script improvements and fixes Scripts fixe and improvement Jun 18, 2024
@Maxython Maxython changed the title Scripts fixe and improvement Fixes and improvements to scripts for working with cyclic dependencies Jun 18, 2024
@Maxython Maxython requested a review from TomJo2000 June 18, 2024 11:46
@Maxython Maxython force-pushed the fix-build-all branch 2 times, most recently from 6b39ff1 to 5890600 Compare June 18, 2024 14:26
Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

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

Nice work Max.

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

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

This review is only pertaining to commit c7976ec.

This is pretty much unreviewable.
843 lines changed in a single commit is one hell of a lot to ask.
The specific pieces I have commented on in this review are by no means exhaustive, but I do not have 2-3 hours to review one commit.
I may be coming back to this later and do more incremental review,
but the amount of nesting in the code makes it exceedingly difficult to follow.

Please consider inverting some of the deeply nested conditionals into guard clauses so they can be mentally discarded after they are passed.

@Maxython Maxython force-pushed the fix-build-all branch 3 times, most recently from fa6bcc3 to 45fe9d9 Compare December 11, 2024 17:14
@Maxython
Copy link
Member Author

Please consider inverting some of the deeply nested conditionals into guard clauses so they can be mentally discarded after they are passed.

Perhaps some local functions could be created in some places, but is it worth it to make the code more readable? It is worth noting that the commit highlights a large number of changed lines due to new conditions added to large algorithms (but in essence they did not change that much) for the correct operation of the collector.

scripts/buildorder.py:
 - the algorithm of the function `generate_full_buildorder` has been changed, now it can work with cyclic dependencies
 - added new flag `-l` and function `get_list_cyclic_dependencies` which allows to find cyclic dependencies
 - for subpackages a new variable `depend_on_parent` has been added which allows disabling dependencies on the parent package (controlled via the variable `TERMUX_SUBPKG_DEPEND_ON_PARENT`)
 - updated logic of variable `only_installing`, now package dependency (with this variable) from variable `pkg_deps` will be used
 - added the ability to control the `only_installing` variable for subpackages via the `TERMUX_SUBPKG_DEPEND_ON_PARENT` variable
 - updated logic of the `recursive_dependencies` function, now only dependencies of the requested package will be returned during non-fast build
scripts/build/termux_step_get_dependencies.sh:
 - removed `-s` flag when compiling dependencies to fix cyclic dependencies
 - fixed running of `termux_download_repo_file` function when cyclic dependencies are detected
build-package.sh: the algorithm that launches the signing key settings has been changed, now it will be launched if the value from the `TERMUX_REPO_PACKAGE` variable and from `TERMUX_APP_PACKAGE` match
build-all.sh: removed default `-s` flag when compiling packages and added check for compiled packages
Virtual packages are packages that are compiled and installed into the system, but are not assembled into a source package for package managers. One advantage of virtual packages is that they can use sources (including values from configured variables) from regular packages. This will allow us to easily create special virtual packages that will have to resolve cyclic dependencies in regular packages.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: build-all.sh is broken due to build order computation [Bug]: buildorder.py - ERROR: Cycle exists. Remaining:

6 participants