From 9d4c39178438dfa07c8a2591aaf5a6958c63125f Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Mon, 24 Feb 2025 01:57:54 +0530 Subject: [PATCH 1/4] Print details about os and mounted filesystems --- packcheck.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packcheck.sh b/packcheck.sh index a12aa8c..dad2fac 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -171,12 +171,21 @@ show_machine_info() { local os=$(uname) case "$os" in Linux) - echo "OS: $os" + #echo "OS: $os" + run_verbose lsb_release -a || true + echo + run_verbose uname -a || true + + show_step "CPU" + echo "lscpu" lscpu | grep "^Archi\|^CPU\|^Bogo\|^Hyper\|^Virtualiz" - echo "Memory:" + show_step "Memory" run_verbose free -h || true + show_step "Filesystems" + run_verbose mount || true + show_step "Container/cgroup information" # See https://stackoverflow.com/questions/20010199/determining-if-a-process-runs-inside-lxc-docker # For comprehensive detection see container-detect.conf in ubuntu From 03f9e753567d08835e342c8d24a406d5a1e1582e Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Fri, 21 Mar 2025 01:15:42 +0530 Subject: [PATCH 2/4] Add "df" command for disk usage info --- packcheck.sh | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/packcheck.sh b/packcheck.sh index dad2fac..f511c96 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -183,9 +183,6 @@ show_machine_info() { show_step "Memory" run_verbose free -h || true - show_step "Filesystems" - run_verbose mount || true - show_step "Container/cgroup information" # See https://stackoverflow.com/questions/20010199/determining-if-a-process-runs-inside-lxc-docker # For comprehensive detection see container-detect.conf in ubuntu @@ -197,11 +194,32 @@ show_machine_info() { sudo -n cat /proc/1/environ | tr '\0' '\n' | grep "^container=" || true run_verbose cat /sys/fs/cgroup/cpu/cpu.cfs_period_us || true run_verbose cat /sys/fs/cgroup/cpu/cpu.cfs_quota_us || true - run_verbose cat /sys/fs/cgroup/memory/memory.limit_in_bytes || true ;; + run_verbose cat /sys/fs/cgroup/memory/memory.limit_in_bytes || true + + show_step "Filesystems" + run_verbose mount || true + + show_step "Disk Usage" + run_verbose df -T || true ;; + FreeBSD) - echo "OS: FreeBSD" ;; + echo "OS: FreeBSD" + + show_step "Filesystems" + run_verbose mount || true + + show_step "Disk Usage" + run_verbose df || true ;; + Darwin) - echo "OS: MacOS" ;; + echo "OS: MacOS" + + show_step "Filesystems" + run_verbose mount || true + + show_step "Disk Usage" + run_verbose df -Y || true ;; + MINGW*) echo "OS: Windows (MINGW)" ;; *) die "OS: Unknown OS [$os]" ;; @@ -923,8 +941,8 @@ ghcup_install() { else # User can either add it in the PATH or we can use the full path of the # tool either as found in PATH or use GHCUP_PATH directly. We should - # probably fix each tool's location as found and use that rather using it - # from PATH. + # probably fix each tool's location as found and use that rather + # than using it from PATH. if test -e "$GHCUP_PATH" then die "$GHCUP_PATH already exists, not overwriting." From 17831494af8b3afdaebe7b508124d313a8b4132f Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Fri, 21 Mar 2025 01:35:31 +0530 Subject: [PATCH 3/4] Use github cache@v3 and update packcheck commit --- .circleci/config.yml | 2 +- .cirrus.yml | 2 +- .github/workflows/packcheck.yml | 4 ++-- appveyor.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a0748c..fe9196d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,7 +65,7 @@ env: &env # If you have not committed packcheck.sh in your repo at PACKCHECK # then it is automatically pulled from this URL. PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck" - PACKCHECK_GITHUB_COMMIT: "v0.7.1" + PACKCHECK_GITHUB_COMMIT: "03f9e753567d08835e342c8d24a406d5a1e1582e" # ubuntu seems to have better support than debian on CI systems docker: diff --git a/.cirrus.yml b/.cirrus.yml index 09716b5..f1424c3 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -36,7 +36,7 @@ task: # packcheck location and revision PACKCHECK: "./packcheck.sh" PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck" - PACKCHECK_GITHUB_COMMIT: "v0.7.1" + PACKCHECK_GITHUB_COMMIT: "03f9e753567d08835e342c8d24a406d5a1e1582e" # Pull token from "secrets" setting of the github repo # COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} diff --git a/.github/workflows/packcheck.yml b/.github/workflows/packcheck.yml index ecaed3e..2ddbc35 100644 --- a/.github/workflows/packcheck.yml +++ b/.github/workflows/packcheck.yml @@ -88,7 +88,7 @@ jobs: # If you have not committed packcheck.sh in your repo at PACKCHECK # then it is automatically pulled from this URL. PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck" - PACKCHECK_GITHUB_COMMIT: "v0.7.1" + PACKCHECK_GITHUB_COMMIT: "03f9e753567d08835e342c8d24a406d5a1e1582e" # ------------------------------------------------------------------------ # Final build variables @@ -158,7 +158,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/cache@v3 name: Cache common directories with: path: | diff --git a/appveyor.yml b/appveyor.yml index e4857f1..09a1352 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -63,7 +63,7 @@ environment: # If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH # then it is automatically pulled from this URL. PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck" - PACKCHECK_GITHUB_COMMIT: "v0.7.1" + PACKCHECK_GITHUB_COMMIT: "03f9e753567d08835e342c8d24a406d5a1e1582e" # Override the temp directory to avoid sed escaping issues # See https://github.com/haskell/cabal/issues/5386 From 8c61fb67ee860ad86049ab17e31bfa8f368b73cf Mon Sep 17 00:00:00 2001 From: Harendra Kumar Date: Fri, 21 Mar 2025 01:50:55 +0530 Subject: [PATCH 4/4] Add a todo for misaligned stdout/stderr --- packcheck.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packcheck.sh b/packcheck.sh index f511c96..13525d0 100755 --- a/packcheck.sh +++ b/packcheck.sh @@ -101,6 +101,8 @@ require_cmd () { # $1: command function run_verbose() { + # XXX redirecting to stderr leads to misaligned output because stdout and + # stdin are printed at different times. echo "$*" 1>&2 bash -c "$*" }