-
Notifications
You must be signed in to change notification settings - Fork 70
Implement build-time package dependencies #274
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
Conversation
The existing `depends` field only addressed install-time package dependencies. This PR makes it so that dependencies of packages are also installed at build time, before each package is built. Both dependencies on Debian packages (“build” packages) and other Entware or Toltec packages (“host” packages) are supported. When running `make repo`, recipes are built in topological order following the declared dependencies. To illustrate and test this new feature, the following packages are also changed by this PR: * _calculator, evtest, plato, wireguard, zoneinfo-utils:_ turn manual invocations of `apt-get` into `makedepends` entries * _all packages using the existing `depends` field:_ upgrade to the v1.3.2 toolchain version that ships with the `opkg` binary * _vnsee:_ create a separate _libvncserver_ recipe that contains the _libvncserver.so_ and _libvncclient.so_ shared libraries, make _vnsee_ link to that library instead of bundling it in the _vnsee_ binary * _recrossable:_ create a separate _libdlib_ recipe that contains the _libdlib.so_ shared library, and link _recrossable_ to that library Test plan: * Checked that all packages build without error and in the correct order (libvncserver before vnsee, libdlib before recrossable) when running `make repo-local` from an empty repo. * Checked that when a recipe-level dependency cycle is created or a recipe depends on itself, a CycleError is raised. * Checked that _vnsee_ and _recrossable_ install their required libraries and that they run properly (no dynamic linker error)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
What is the purpose of |
There can only be host-type dependencies in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the plan to keep the changes in vnsee, recrossable, etc?
"-n", | ||
"--no-fetch", | ||
"-d", | ||
"--diff", | ||
action="store_true", | ||
help="do not fetch missing packages from the remote repository", | ||
help="only keep new packages that do not exist on the remote repository", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you describe the difference in behavior, if any? (i think the PR artifact will still only retain the important packages - will downloads increase with this change?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The downloads do increase with this change. With this flag, instead of ignoring locally missing packages that already exist on the remote, the script now fetches them for the time of the build, then discards them. The rationale is that we may have some packages that depend on other existing packages at build time, so even if we do not want them in the final PR artifacts, we still need them to build the updated packages.
Do you think the flag’s description is clear enough as it stands or do you think it should be improved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flag's description is fine
Yes. I plan to take advantage of the separation of libvncserver out of VNSee later on, to make packaging rM-vnc-server easier, as they share the same dependency. As for recrossable, moving the dlib dependency out of the toolchain and into a separate package is a step towards lighter Docker images (I removed dlib from the toolchain in version 1.3). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems good to me. i built an assortment of packages (evtest, calculator, rmkit, vnsee) but not all. i understand the changes and motivation, all makes sense
for vnsee, i get the following:
okay@chalk:~/tonka/src/remarkable/toltec$ ./scripts/package_build.py -v vnsee
[ DEBUG] docker.utils.config: Trying paths: ['/home/okay/.docker/config.json', '/home/okay/.dockercfg']
[ DEBUG] docker.utils.config: No config file found
[ DEBUG] docker.utils.config: Trying paths: ['/home/okay/.docker/config.json', '/home/okay/.dockercfg']
[ DEBUG] docker.utils.config: No config file found
The build directory 'build/package/vnsee' for recipe 'vnsee' already exists.
Would you like to [c]ancel, [r]emove that directory, or [k]eep it (not recommended)? [C/r/k] r
[ INFO] toltec.builder: vnsee: Fetching source files
[ DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): github.com:443
[ DEBUG] urllib3.connectionpool: https://github.com:443 "GET /matteodelabre/vnsee/archive/3f07c04e1991c1c5ff3b5a4758aa42301bf86fae.zip HTTP/1.1" 302 158
[ DEBUG] urllib3.connectionpool: Starting new HTTPS connection (1): codeload.github.com:443
[ DEBUG] urllib3.connectionpool: https://codeload.github.com:443 "GET /matteodelabre/vnsee/zip/3f07c04e1991c1c5ff3b5a4758aa42301bf86fae HTTP/1.1" 200 207831
[ DEBUG] toltec.builder: vnsee: Skipping prepare (nothing to do)
[ INFO] toltec.builder: vnsee: Building artifacts
[ DEBUG] urllib3.connectionpool: http://localhost:None "POST /v1.35/containers/create HTTP/1.1" 201 88
[ DEBUG] urllib3.connectionpool: http://localhost:None "GET /v1.35/containers/a6caa5880a0161dfbe50d4b0b1caa0c8fef61cce1868338f2aa4419b9936b9d2/json HTTP/1.1" 200 None
[ DEBUG] urllib3.connectionpool: http://localhost:None "POST /v1.35/containers/a6caa5880a0161dfbe50d4b0b1caa0c8fef61cce1868338f2aa4419b9936b9d2/start HTTP/1.1" 204 0
[ DEBUG] urllib3.connectionpool: http://localhost:None "GET /v1.35/containers/a6caa5880a0161dfbe50d4b0b1caa0c8fef61cce1868338f2aa4419b9936b9d2/logs?stderr=1&stdout=1×tamps=0&follow=1&tail=all HTTP/1.1" 200 None
[ DEBUG] urllib3.connectionpool: http://localhost:None "GET /v1.35/containers/a6caa5880a0161dfbe50d4b0b1caa0c8fef61cce1868338f2aa4419b9936b9d2/json HTTP/1.1" 200 None
[ DEBUG] toltec.builder: vnsee: * opkg_prepare_url_for_install: Couldn't find anything to satisfy 'libvncclient'.
[ DEBUG] urllib3.connectionpool: http://localhost:None "POST /v1.35/containers/a6caa5880a0161dfbe50d4b0b1caa0c8fef61cce1868338f2aa4419b9936b9d2/wait HTTP/1.1" 200 None
[ DEBUG] urllib3.connectionpool: http://localhost:None "DELETE /v1.35/containers/a6caa5880a0161dfbe50d4b0b1caa0c8fef61cce1868338f2aa4419b9936b9d2?v=False&link=False&force=False HTTP/1.1" 204 0
[ ERROR] toltec.builder: vnsee: build() failed
Traceback (most recent call last):
File "./scripts/package_build.py", line 44, in <module>
if not builder.make(recipe, packages):
File "/home/okay/tonka/src/remarkable/toltec/scripts/toltec/builder.py", line 129, in make
self._build(recipe, src_dir)
File "/home/okay/tonka/src/remarkable/toltec/scripts/toltec/builder.py", line 295, in _build
self._print_logs(logs, "build()")
File "/home/okay/tonka/src/remarkable/toltec/scripts/toltec/builder.py", line 502, in _print_logs
raise err
File "/home/okay/tonka/src/remarkable/toltec/scripts/toltec/builder.py", line 483, in _print_logs
for line in logs:
File "/home/okay/tonka/src/remarkable/toltec/scripts/toltec/bash.py", line 413, in run_script_in_container
raise ScriptError(f"Script exited with code {result['StatusCode']}")
toltec.bash.ScriptError: Script exited with code 255
this makes me think i should make sure the whole repo builds, so i will run make repo
now while i do some other tasks
"-n", | ||
"--no-fetch", | ||
"-d", | ||
"--diff", | ||
action="store_true", | ||
help="do not fetch missing packages from the remote repository", | ||
help="only keep new packages that do not exist on the remote repository", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flag's description is fine
also, i think that might be expected behavior - do i need to run |
make repo works (yay!), so its just behavior when building single package that has dependencies
|
Thanks for testing! As you’ve noticed, I did not change the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't mind when it's fixed, but i think that it will come up eventually (when someone tries to build something) and we'll get support requests then.
i've read through the code so many times, but i think i should just be taking time to come up with scenarios that might break. either way, it looks good to me
Thanks for reviewing! I’ll merge this so that we can move forward with packages that need build dependencies. We’ll revisit dependency handling in |
new packages: [ddvk-hacks] Add ddvk-hacks (toltec-dev#247) updated packages: [wireguard][1.0.20210219] - Updated package (and include wireguard-tools) (toltec-dev#285) [rm2fb] update rm2fb to work with xochitl 2.6 (v1.0.1) (toltec-dev#301) [recrossable] Update recrossable (toltec-dev#312) [wikipedia] Initial wikipedia package. [appmarkable] Update appmarkable to 0.0.0-9 and rmservewacominput to 0.3.0-1 (toltec-dev#308) with rm2 support [rmkit] patch genie to fix crash in testing (toltec-dev#304) [oxide] Update Oxide to v2.1.2 (toltec-dev#241) [rm2fb] update rm2fb with wait ioctl and no-op on rM1 (toltec-dev#298) [rmkit] add bufshot app, add lamp, add iago, add changelog (toltec-dev#276) [rmkit] update rmkit to latest (2021-02-17) (toltec-dev#286) [zshelf][0.3.1] - Updated Package (toltec-dev#287) tooling: Pin the Ubuntu version used in workflows to 20.04 (toltec-dev#316) Provide better version number error messages (toltec-dev#314) util.auto_extract: Extract broken symlinks and missing directories (toltec-dev#302) change web background color to #fcfaf8 (toltec-dev#280) Implement build-time package dependencies (toltec-dev#274) Rewrite repo-build-web in Python (toltec-dev#266) Print last 50 lines of output on build error (toltec-dev#263) Hardcode REMOTE_HTTP secret in PR workflows (toltec-dev#262) Rewrite repo-build and package-build in Python (toltec-dev#218) Make bootstrap execution conditional on hash verification (toltec-dev#257) Add Toltec web home page (toltec-dev#193)
New packages: * bufshot - 0.1.0-2 (#276) * ddvk-hacks - 17.04-1 (#247) * iago - 0.1.0-1 (#276) * lamp - 0.1.0-1 (#276) * libdlib, libdlib-dev - 19.21-1 (#274) * libvncserver, libvncserver-dev - 0.9.13-1 (#274) * wikipedia - 0.1.0-2 (#311) Updated packages: * appmarkable - 0.0.0-9 (#308) * decay - 2.1.2~1 (#241) * erode - 2.1.2~1 (#241) * fret - 2.1.2~1 (#241) * genie - 0.1.4-2 (#304) * harmony - 0.1.2-1 (#286) * mines - 0.1.2-1 (#286) * nao - 0.1.2-1 (#286) * oxide - 2.1.2~1 (#241) * recrossable - 0.0.0-5 (#274, #312) * remux - 0.1.8-1 (#286) * rm2fb - 1.0.1-1 (#298, #301) * rmservewacominput - 0.3.0-1 (#308) * rot - 2.1.2~1 (#241) * simple - 0.1.3-1 (#286) * tarnish - 2.1.2~1 (#241) * vnsee - 0.3.1-2 (#274) Tooling: * Pin the Ubuntu version used in workflows to 20.04 (#316) * Provide better version number error messages (#314) * util.auto_extract: Extract broken symlinks and missing directories (#302) * change web background color to #fcfaf8 (#280) * Implement build-time package dependencies (#274) * Rewrite repo-build-web in Python (#266) * Print last 50 lines of output on build error (#263) * Hardcode REMOTE_HTTP secret in PR workflows (#262) * Rewrite repo-build and package-build in Python (#218) * Make bootstrap execution conditional on hash verification (#257) * Add Toltec web home page (#193) Co-authored-by: okay <okay@arkose> Co-authored-by: Mattéo Delabre <[email protected]>
The existing `depends` field only addressed install-time package dependencies. This PR makes it so that dependencies of packages are also installed at build time, before each package is built. Both dependencies on Debian packages (“build” packages) and other Entware or Toltec packages (“host” packages) are supported. When running `make repo`, recipes are built in topological order following the declared dependencies. To illustrate and test this new feature, the following packages are also changed by this PR: * _calculator, evtest, plato, wireguard, zoneinfo-utils:_ turn manual invocations of `apt-get` into `makedepends` entries * _all packages using the existing `depends` field:_ upgrade to the v1.3.2 toolchain version that ships with the `opkg` binary * _vnsee:_ create a separate _libvncserver_ recipe that contains the _libvncserver.so_ and _libvncclient.so_ shared libraries, make _vnsee_ link to that library instead of bundling it in the _vnsee_ binary * _recrossable:_ create a separate _libdlib_ recipe that contains the _libdlib.so_ shared library, and link _recrossable_ to that library Test plan: * Checked that all packages build without error and in the correct order (libvncserver before vnsee, libdlib before recrossable) when running `make repo-local` from an empty repo. * Checked that when a recipe-level dependency cycle is created or a recipe depends on itself, a CycleError is raised. * Checked that _vnsee_ and _recrossable_ install their required libraries and that they run properly (no dynamic linker error)
This reverts commit c2791a1.
(Fixes #85.)
The existing
depends
field only addressed install-time package dependencies. This PR makes it so that dependencies of packages are also installed at build time, before each package is built. Both dependencies on Debian packages (“build” packages) and other Entware or Toltec packages (“host” packages) are supported. When runningmake repo
, recipes are built in topological order following the declared dependencies.To illustrate and test this new feature, the following packages are also changed by this PR:
apt-get
intomakedepends
entriesdepends
field: upgrade to the v1.3.2 toolchain version that ships with theopkg
binaryTest plan:
make repo-local
from an empty repo.