Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Add CD to compile #15

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
./release/generate_linux_binary.sh
chmod +x ./dist/varc
./dist/varc # check it doesn't return non 0 exit status, i.e. crash
- uses: actions/upload-artifact@v3
with:
name: varc
path: ./dist/varc

centos:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -102,6 +106,7 @@ jobs:

windows:
runs-on: windows-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand All @@ -113,7 +118,14 @@ jobs:
pip3 install -r ./requirements.txt
- name: Run varc Python
run: |
python3 varc.py
python3 varc.py --skip-memory
cd release
pip3 install pyinstaller==5.0
./generate_windows_binary.bat
- uses: actions/upload-artifact@v3
with:
name: varc
path: ./dist/varc.exe

macos:
runs-on: macos-12
Expand All @@ -129,3 +141,13 @@ jobs:
- name: Run varc Python
run: |
python3 varc.py
- name: Build & Run Binary
run: |
chmod +x ./release/generate_linux_binary.sh
./release/generate_linux_binary.sh
chmod +x ./dist/varc
./dist/varc # check it doesn't return non 0 exit status, i.e. crash
- uses: actions/upload-artifact@v3
with:
name: varc
path: ./dist/varc
15 changes: 13 additions & 2 deletions release/generate_osx_binary.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Tested with python 3.10 and PyInstaller 5.4.1

pip3 install -r requirements.txt
pyinstaller --onefile --clean --target-arch universal2 varc.py
PATHS="../venv/lib/python3.10/site-packages"

python3 -m venv venv
source ./venv/bin/activate
cd cado-host-python


python3 -m pip install --upgrade pip
python3 -m pip install pyinstaller==5.4.1
python3 -m pip install -r requirements.txt
# Universal target currently fails
# python3 -m PyInstaller --onefile --clean --paths $PATHS --target-arch universal2 varc.py
python3 -m PyInstaller --onefile --clean --paths $PATHS varc.py
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
long_description = (this_directory / "README.md").read_text()


VERSION = '1.0.5'
VERSION = '1.0.6'

setup(
name='varc',
Expand Down
45 changes: 24 additions & 21 deletions varc_core/systems/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,30 @@ def dump_processes(self) -> None:
"""Dumps all processes to temp files, adds temp file to output archive then removes the temp file"""
archive_out = self.output_path
with zipfile.ZipFile(archive_out, "a", compression=zipfile.ZIP_DEFLATED) as zip_file:
for proc in tqdm(self.process_info, desc="Process dump progess", unit=" procs"):
pid = proc["Process ID"]
p_name = proc["Name"]
maps = self.parse_mem_map(pid, p_name)
if not maps:
continue
with NamedTemporaryFile(mode="w+b", buffering=0, delete=True) as tmpfile:
try:
for map in maps:
page_start = map[0]
page_len = map[1] - map[0]
mem_page_content = self.read_bytes(pid, page_start, page_len)
if mem_page_content:
tmpfile.write(mem_page_content)
zip_file.write(tmpfile.name, f"process_dumps{sep}{p_name}_{pid}.mem")
except PermissionError:
logging.warning(f"Permission denied opening process memory for {p_name} (pid {pid}). Cannot dump this process.")
try:
for proc in tqdm(self.process_info, desc="Process dump progess", unit=" procs"):
pid = proc["Process ID"]
p_name = proc["Name"]
maps = self.parse_mem_map(pid, p_name)
if not maps:
continue
except OSError as oserror:
logging.warning(f"Error opening process memory page for {p_name} (pid {pid}). Error was {oserror}. Dump may be incomplete.")
pass

with NamedTemporaryFile(mode="w+b", buffering=0, delete=True) as tmpfile:
try:
for map in maps:
page_start = map[0]
page_len = map[1] - map[0]
mem_page_content = self.read_bytes(pid, page_start, page_len)
if mem_page_content:
tmpfile.write(mem_page_content)
zip_file.write(tmpfile.name, f"process_dumps{sep}{p_name}_{pid}.mem")
except PermissionError:
logging.warning(f"Permission denied opening process memory for {p_name} (pid {pid}). Cannot dump this process.")
continue
except OSError as oserror:
logging.warning(f"Error opening process memory page for {p_name} (pid {pid}). Error was {oserror}. Dump may be incomplete.")
pass
except MemoryError:
logging.warning("Exceeded available memory, skipping further memory collection")


logging.info(f"Dumping processing has completed. Output file is located: {archive_out}")