public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Lemures Lemniscati <lemures.lemniscati@gmail.com>
To: cygwin@cygwin.com
Subject: Re: [ANNOUNCEMENT] Test: cmake-3.17.3-1
Date: Sat, 18 Jul 2020 09:45:59 +0900	[thread overview]
Message-ID: <20200718094555.9CED.50F79699@gmail.com> (raw)
In-Reply-To: <announce.3c6e5318-b740-8adf-0684-79486aa82f88@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]

Date: Fri, 17 Jul 2020 23:47:59 +0200
From: Marco Atzeri via Cygwin-announce <cygwin-announce@cygwin.com>

> To: cygwin-announce@cygwin.com
> Subject: Test: cmake-3.17.3-1
> 
> Test version 3.17.3-1 of
> 
>    cmake
>    cmake-doc
>    cmake-gui
>    emacs-cmake
> 
> are available in the Cygwin distribution.
> 
> Please report any issue or problem.
> Also positive feedback in complex projects are appreciated
> 

Hi!

Thank you for updating cmake.

Some errors'll occur in Source/kwsys/SystemInformation.cxx
since /proc/meminfo in Cygwin has only these fields

$ cat /proc/meminfo
MemTotal:       20824372 kB
MemFree:        13545156 kB
HighTotal:             0 kB
HighFree:              0 kB
LowTotal:       20824372 kB
LowFree:        13545156 kB
SwapTotal:       3145728 kB
SwapFree:        3131252 kB

In particular, we have no MemAvailable field in Cygwin.



I attached a patch 0001-3.17.3-cpuinfo_suppl.patch for this issue,
which should be applied after 3.17.3-cpuinfo.patch

The patch separates a case defined(__CYGWIN__) from a case defined(__linux)


Regards,

Lem

[-- Attachment #2: 0001-3.17.3-cpuinfo_suppl.patch --]
[-- Type: application/octet-stream, Size: 1399 bytes --]

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lemures Lemniscati <lemures.lemniscati@gmail.com>
Date: Sat, 18 Jul 2020 08:22:59 +0900
Subject: [PATCH] 3.17.3-cpuinfo_suppl

---
 Source/kwsys/SystemInformation.cxx | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 1d070e5520..1a0cf7d0b7 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3715,7 +3715,17 @@ SystemInformationImplementation::GetHostMemoryUsed()
   GlobalMemoryStatusEx(&statex);
   return (statex.ullTotalPhys - statex.ullAvailPhys) / 1024;
 #  endif
-#elif defined(__linux) || defined(__CYGWIN__)
+#elif defined(__CYGWIN__)
+  const char* names[3] = { "MemTotal:", "MemFree:", NULL };
+  SystemInformation::LongLong values[2] = { SystemInformation::LongLong(0) };
+  int ierr = GetFieldsFromFile("/proc/meminfo", names, values);
+  if (ierr) {
+    return ierr;
+    }
+  SystemInformation::LongLong& memTotal = values[0];
+  SystemInformation::LongLong& memFree = values[1];
+  return memTotal - memFree;
+#elif defined(__linux)
   const char* names[3] = { "MemTotal:", "MemAvailable:", NULL };
   SystemInformation::LongLong values[2] = { SystemInformation::LongLong(0) };
   int ierr = GetFieldsFromFile("/proc/meminfo", names, values);
-- 
2.27.0


  reply	other threads:[~2020-07-18  0:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 21:47 Marco Atzeri via Cygwin-announce
2020-07-18  0:45 ` Lemures Lemniscati [this message]
2020-07-18  5:47   ` Marco Atzeri
2020-07-19  1:07     ` Lemures Lemniscati
2020-07-18  6:14   ` Achim Gratz
2020-07-18  6:26     ` Marco Atzeri

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200718094555.9CED.50F79699@gmail.com \
    --to=lemures.lemniscati@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).