Subject: Re: [bug#54581] Add emacs-sqlite3-api package

From: Maxime Devos <[email-masked]>
Date: Sun, 27 Mar 2022 21:34:23 +0200

Roman Scherer schreef op zo 27-03-2022 om 19:55 [+0200]:
> But I also wonder if generating the consts.c file is actually better
> than just using the checked in consts.c file. The command to generate
> the file fetches a web page from the Sqlite website and builds the
> consts.c file with this information. And I think this is kind of a
> brittle approach. How would this approach would even work with
> Software
> heritage?

As-is, it won't even build, because the build container does not have
network access.  Something you could try, is adding an origin to the
'inputs':

(package
  (name "emacs-sqlite...")
  (inputs `(("web-page" ,(origin [...]
https://sqlite.org/c3ref/constlist.html [...])))))

and do some appropriate substitutions.  Problem is that this page is
not stable ...

To resolve this, you could modify gen-consts.py to not use the web page
to filter things out, basically, delete:

useful_codes = []
with open(sys.argv[1]) as f:
  for l in f.readlines():
    useful_codes.append(l.rstrip())

and

  #print("{0}".format(fields[1]))
  if not fields[1] in useful_codes:
    #print("{0} excluded".format(fields[1]))
    continue

and strip out the curl stuff from gen-consts.sh.

If you do this, don't forget to remove the non-deterministic NOW=$(date
...).

Greetings,
Maxime.