D27557: Auto-generate 24px monochrome icons

Harald Sitter noreply at phabricator.kde.org
Mon Feb 24 13:34:00 GMT 2020


sitter added a comment.


  This is now working again. The symlink tests fail though. That still needs fixing by someone who isn't me.
  
  Here's my feedback:
  
  For bash or sh scripts:
  
  - make sure a sh script is actually POSIX compliant by running it through a POSIX sh implementation
  - if the scripts outcome is relevant you must `set -e` to force all errors to also terminate the script and in turn force you to either deal with them or explicitly ignore them
  - if your script is doing a lot of stuff you may want to revise how the script works. specifically for this diff sed needs to iter all the content of all the SVGs this can benefit greatly from running across multiple cores, but with the way it is written it cannot. a better solution would be to move the for loop into cmake and then construct targets for all files where each target calls `generate.sh inputfile` and the shell script only has the logic from inside the loop. this effectively gives you free "threading" in that cmake/make/ninja know how to run build targets in parallel so by making each file its own target you can now utilize all cores of a system without having to manage threading manually.
  
  On the cmake side:
  
  - do not ever mutate installation paths (well, exceptions apply ofc, but 99.9% of the time). they may not be writable and they will not ever be what you expect them to be because the paths themselves are mutable in packaging scenarios (as in: cmake gets run with path=/usr BUT that's is not at all where things get installed when `make install` gets called).
  - setting working directory to current source is bad form. it allows you to accidentally pollute or change the source dir, it's undesirable and generally speaking relying on relative paths is a bit meh anyway
  - bit nitpicky: but generally when you have any find_* call you'll want some cmake FeatureSummary call to go along with that to describe whatever you need the finded thing for. specifically since this script is actually bash-dependent we need to look for bash, but currently we provide no useful feedback on it being missing and the build will just fail on BASH-EXEC_NOT_FOUND or something when the relevant target would get run. a cheap solution is to use ` add_feature_info` to describe the feature
  
  In general for this diff:
  
  - the introduced script absolutely needs a test. its correct behavior is required to have the x24 variants and right now we have no assurances of that
  - as mentioned, I really do not like that this runs at build time. it's not very "green". the outcome does not change based on environment, nor is the target environment relevant. so a dozen or more developers regularly needlessly spend power on generating the ever same mutations of the largely ever same files, and every month all distributions do the same, equally needlessly. this should only be run when artists add/change icons

REPOSITORY
  R266 Breeze Icons

REVISION DETAIL
  https://phabricator.kde.org/D27557

To: ngraham, #vdg, ndavis, #frameworks, sitter
Cc: davidre, bcooksley, kossebau, kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200224/a6811c02/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list