{"id":496,"date":"2023-06-25T20:41:14","date_gmt":"2023-06-25T20:41:14","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=496"},"modified":"2023-06-25T20:41:14","modified_gmt":"2023-06-25T20:41:14","slug":"week-4-report-automated-gentoo-system-updater","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/week-4-report-automated-gentoo-system-updater\/","title":{"rendered":"Week 4 Report, Automated Gentoo System Updater"},"content":{"rendered":"<p>This article is a summary of all the changes made on\u00a0<a href=\"https:\/\/wiki.gentoo.org\/wiki\/Google_Summer_of_Code\/2023\/Ideas\/Automated_Gentoo_system_updater\">Automated Gentoo System Updater<\/a>\u00a0project during\u00a0<strong>week 4<\/strong>\u00a0of GSoC.<\/p>\n<p>Project is hosted on\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">Github<\/a>.<\/p>\n<h3 id=\"progress-on-week-4\">Progress on Week 4<\/h3>\n<p>Started the week by discovering that my updates to ebuild were\u00a0<a href=\"https:\/\/github.com\/gentoo\/guru\/commit\/bfffbe1a4bcd10a5e6a20d3ef314ac31cd00641f#comments\">not accepted<\/a>\u00a0in the GURU overlay. The issue arose due to a misuse of USE flags feature in the ebuild. Maintainers of GURU (big thanks to\u00a0<strong>antecrescent<\/strong>!) pointed out my mistake and explained how to fix it, which I did by submitting 2 more commits (\u00a0<a href=\"https:\/\/github.com\/gentoo\/guru\/commit\/bc46fa1c58c1d493892d6fb339b34f58636b3846\">commit1<\/a>\u00a0and\u00a0<a href=\"https:\/\/github.com\/gentoo\/guru\/commit\/ee6e79850b9189da680fbfdc091ab355574f9180\">commit2<\/a>).<\/p>\n<p>Then I proceeded to write an introductory blog post. It can currently be read in\u00a0<a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/gentoo_update-introduction\/\">Gentoo GSoC blog<\/a>. I\u2019ve delayed posting about it on forums because I was waiting for the newest ebuild version to be merged to the main branch in GURU overlay (and because I was a bit anxious to be honest \ud83d\ude30). But in the end I decided to stop waiting, and just mentioned in the blog post that <em>gentoo_update<\/em>\u00a0can be also installed via pip.<br \/>\nForum post can be found\u00a0<a href=\"https:\/\/forums.gentoo.org\/viewtopic-p-8793590.html#8793590\">here<\/a>.<\/p>\n<p>Updater also received some improvements overall. I found errors in\u00a0<em>&#8211;args<\/em>\u00a0flag (used for passing custom parameters to\u00a0<em>emerge<\/em>), in some cases it was not reading all parameters correctly. To fix the problem I changed the input type, now it receives a string of space separated parameters instead of a list, for example\u00a0<em>&#8220;quiet-build=y color=y&#8221;<\/em>, and the problem was fixed.<\/p>\n<p>Also the packaging with Python\u2019s setuptools was improved, now there are no warnings during wheel building.<\/p>\n<p>Finally, I started working on the parser. Right now it can only split the output to different categories.<\/p>\n<p>Overall, the week was not a very productive one, but many bugs and imperfections were discovered and fixed which is great because I can now focus on the parser!<\/p>\n<h3 id=\"challenges\">Challenges<\/h3>\n<p>It was a bit challenging to understand the reason why USE flags were not a good solutions in my case, but after I got it it suddenly became obvious \ud83e\udd13<\/p>\n<p>I used USE flags to install optional dependencies for the updater. However, USE flags are typically meant to guide Portage in the program\u2019s build and compilation processes, and in this case USE flags don\u2019t change the outcome of how the program is built. If these flags are ever removed, it would trigger an unnecessary recompilation of the updater. The proper management of optional dependencies, as\u00a0<a href=\"https:\/\/github.com\/gentoo\/guru\/commit\/bfffbe1a4bcd10a5e6a20d3ef314ac31cd00641f#comments\">recommended<\/a>\u00a0by antecrescent, involves using the\u00a0<a href=\"https:\/\/devmanual.gentoo.org\/eclass-reference\/optfeature.eclass\/index.html\">optfeature eclass<\/a>. This approach provides users with dependency information and prompts them to consider installing dependencies by themselves.<\/p>\n<p>Then it was a bit tricky to get rid of warnings from setuptools (it feels like I\u2019m struggling with setuptools every week \ud83d\ude14). Warning were saying that\u00a0<em>updater.sh<\/em>\u00a0and even\u00a0<em>tests<\/em>\u00a0directories were treated as Python packages, which was a problem because\u00a0<em>update.sh<\/em>\u00a0is a Bash script, and\u00a0<em>tests<\/em>\u00a0contains scripts and Docker compose file used for tests, and both of them were not meant to be a package. I found a solution in Gentoo\u2019s\u00a0<a href=\"https:\/\/projects.gentoo.org\/python\/guide\/qawarn.html#stray-top-level-files-in-site-packages\">Python Guide<\/a>\u00a0which suggested a proper way to exclude the packages to avoid issues with Portage.<\/p>\n<div class=\"post-content\">\n<h3 id=\"plans-for-week-5\">Plans for Week 5<\/h3>\n<p>Mostly I plan to work on the parser the whole week. Here is the checklist from last week:<\/p>\n<ul>\n<li><del>Split log into multiple sections, i.e updated programs, what needs restarting etc.<\/del><\/li>\n<li>Summarize sections and create a report<\/li>\n<li>If updater exits with error, crate a separate error report<\/li>\n<\/ul>\n<\/div>\n<footer class=\"post-footer\"><\/footer>\n","protected":false},"excerpt":{"rendered":"<p>This article is a summary of all the changes made on\u00a0Automated Gentoo System Updater\u00a0project during\u00a0week 4\u00a0of GSoC. Project is hosted on\u00a0Github. Progress on Week 4 Started the week by discovering that my updates to ebuild were\u00a0not accepted\u00a0in the GURU overlay. &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/week-4-report-automated-gentoo-system-updater\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,18],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/496"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=496"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":500,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/496\/revisions\/500"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}