|
|
Subscribe / Log in / New account

Replacing AWK with Python in GCC?

Replacing AWK with Python in GCC?

Posted Jul 26, 2018 20:14 UTC (Thu) by MrWim (subscriber, #47432)
In reply to: Replacing AWK with Python in GCC? by madscientist
Parent article: Replacing AWK with Python in GCC?

Saying "guess what, your previously working environment is now working Even Better(tm), but oh by the way now you need to install a whole bunch of extra stuff onto your system before you can do the same things you were doing yesterday" is not, to everyone, actually an improvement.

One trick they could apply is to run these scripts during make dist and include the output in the source tarball. This would mean that there are no additional dependencies required for people who just want to build GCC, only for those who want to develop GCC. This would make bring-up on new targets just as easy as now.

Of course this assumes that the process is deterministic and that the generated C files are themselves portable - but this should not be too much of an inconvenience.

You can even go further and include the generated C files in the git repo. It sounds icky I know, but the downsides of the duplication can be mitigated as long as:

  1. The generation is deterministic - it depends only on files in the same git repo and isn't dependent on the architecture of the machine it's running on or the environment in which it is run.
  2. You have a CI system to reject git commits with an inconsistency between the .opt and .c file
  3. Concurrent modifications to the .opt files are fairly rare - you don't want to be dealing with merge conflicts in generated code - even if they can be resolved just by rerunning the tool on the merge commit.

I've used this approach successfully in some of my projects where I want a build dependency, but I don't want to burden other developers (including casual, drive-by ones) with the requirement to install that dependency.


to post comments

Replacing AWK with Python in GCC?

Posted Jul 26, 2018 20:54 UTC (Thu) by jwilk (subscriber, #63328) [Link] (1 responses)

They already have configure (generated from configure.ac) committed to the repo, so the eww factor shouldn't be a problem.

(BTW, it's Subversion, not git.)

Replacing AWK with Python in GCC?

Posted Jul 27, 2018 21:19 UTC (Fri) by paulj (subscriber, #341) [Link]

The general approach is to have those built "source" files in the 'dist' tarball (generated by 'make dist'), so that that is buildable without dependencies on the tools needed for those built "source" files.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds