git/list[1] front-page[2] threads[3] people[4] search[5] about
 

chainlink.pl /proc/cpuinfo regexp fails on s390x

From
Andreas Hasenack <andreas@canonical.com>
Date
Nov 22, 2022, 17:37 UTC
Message-ID
<CANYNYEHXU8ivgAOa8EO5e9kOcbu6XF7rj+9EcSrbDQE+Rvyw_Q@mail.gmail.com>
Hi,
(please CC me on replies, as I'm not subscribed)

git commit 29fb2ec384a867ca577335a12f4b45c184e7b642[1], present in 2.38.0 and later, introduced a function that gets the number of cores from /proc/cpuinfo. It essentially does this on linux:

    do { local @ARGV='/proc/cpuinfo'; return
scalar(grep(/^processor\s*:/, <>)); } if -r '/proc/cpuinfo';
On s390x, the ^processor lines are like this:
processor 0: version = FF, identification = 148F67, machine = 2964
In other arches (I checked amd64, armhf and arm64), they are like this instead:
processor : 0

As a result, that function is returning 0 on s390x, and that value is used for the number of jobs the script should execute. Since it's zero, it exits without doing anything, and that breaks the test and the build[3] on s390x.

This is trivial and I don't think a PR is necessary, but let me know if you want one.

That regexp could perhaps be:
/^processor\s*\d*\s*:/
or
/^processor[\s\d]*:/
or something else.
1. https://github.com/git/git/commit/29fb2ec384a867ca577335a12f4b45c184e7b642
2. https://github.com/git/git/commit/29fb2ec384a867ca577335a12f4b45c184e7b642#diff-e7042d714d4be11a06d153e6f2daeb3c3a9766b972522baab8ba113b962086cfR574
3. https://launchpadlibrarian.net/635348769/buildlog_ubuntu-lunar-s390x.git_1%3A2.38.1-1ubuntu1_BUILDING.txt.gz
Next: Eric Sunshine
Message 1 of 10 in “chainlink.pl /proc/cpuinfo regexp fails on s390x”
  1. Andreas HasenackNov 22, 2022
  2. Eric SunshineNov 22, 2022
  3. Andreas HasenackNov 22, 2022
  4. Eric SunshineNov 22, 2022
  5. Andreas HasenackNov 22, 2022
  6. Eric SunshineNov 22, 2022
  7. Andreas SchwabNov 22, 2022
  8. Eric SunshineNov 22, 2022
  9. Andreas SchwabNov 23, 2022
  10. Eric SunshineNov 23, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.