[IMP] odoo-setup: Add support for windows packaging#1242
[IMP] odoo-setup: Add support for windows packaging#1242d-fence wants to merge 10 commits intoActivityWatch:masterfrom
Conversation
- Add `buildpackage.sh` script to build the tool and package it as a Debian package. By default, it builds the `noble` package. To build the `jammy` package, pass `jammy` as the first argument (e.g., `./buildpackage.sh jammy`). - Add Dockerfiles for Ubuntu Jammy and Noble. They differ mainly in the `rustup` and `poetry` setup. - Add `aw-systray-odoo.py` as a replacement for `aw-qt`. It starts the Rust server, the `awatcher` module, and the GNOME extension needed for Wayland setups.
The script needs a previously crafted Windows qemu/kmv virtual machine with at least the following requirements: - Ssh server and MingGW in order to intrument the build through ssh - A valid ssh public key to use when building - python3 - Poetry - the rustup nightly toolchain - Node.js 20 - gnuwin32 - innosetup Details can be found here: https://docs.activitywatch.net/en/latest/installing-from-source.html#checking-dependencies
When building windows package, we exclude aw-qt and the python server from the Windows installer. This is done through the environment variable ODOO_WINDOWS_BUILD
Adapt the script to work on Windows by using pystray instead of gi when building for Windows platform. While pystray is cross platform, we need to keep gi as python3-pystray package is not available on Ubuntu Jammy. So the script is now able to conditionaly use one or another.
Add a .spec file used by pyinstaller to build aw-systray-odoo for windows platform.
Greptile SummaryThis PR adds Odoo-specific Windows and Debian packaging support to ActivityWatch, including a new cross-platform system tray app ( Critical issues:
Other notable issues:
Confidence Score: 1/5Not safe to merge — three critical regressions break standard (non-Odoo) builds for all contributors. Three P0 issues affect shared infrastructure: (1) .gitmodules replaces upstream ActivityWatch submodule URLs with SSH Odoo forks; (2) Makefile regression removes aw-qt dist relocation for all non-Tauri builds; (3) activitywatch-setup.iss unconditionally changes the Windows installer entrypoint, breaking all standard Windows packaging. .gitmodules, Makefile, and scripts/package/activitywatch-setup.iss all require immediate attention before merge. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Build Triggered] --> B{TAURI_BUILD?}
B -- yes --> C[Tauri build path]
B -- no --> D{ODOO_WINDOWS_BUILD?}
D -- yes --> E[pip install pystray/pillow/pywin32]
E --> F[pyinstaller aw-systray-odoo.spec]
F --> G[cp aw-systray-odoo.exe to dist/activitywatch/]
D -- no --> H[⚠️ aw-qt relocation step MISSING - regression for standard builds]
A2[Windows Packaging] --> I{ODOO_WINDOWS_BUILD?}
I -- yes --> J[awbuilder.py: start KVM VM]
J --> K[SSH into VM]
K --> L[Upload activitywatch sources via SCP]
L --> M[Run make build + make package on VM]
M --> N[Download .exe artifact]
N --> O{--pesign?}
O -- yes --> P[Sign with HSM]
O -- no --> Q[Output to destdir]
P --> Q
A3[Linux Packaging] --> R[buildpackage.sh]
R --> S[docker build Dockerfile_jammy/noble]
S --> T[docker run: make build + make package]
T --> U[unzip Linux build into Debian pkg structure]
U --> V[Add GNOME extension zip]
V --> W[dpkg-deb build .deb]
|
| url = git@github.com:odoo/aw-server.git | ||
| [submodule "aw-watcher-afk"] |
There was a problem hiding this comment.
Submodule URLs point to Odoo SSH forks instead of upstream ActivityWatch repos
Both aw-server and aw-server-rust submodule URLs have been changed from the official ActivityWatch HTTPS URLs to SSH-based Odoo org forks:
url = git@github.com:odoo/aw-server.git
url = git@github.com:odoo/aw-server-rust.git
This has two significant problems:
-
SSH vs HTTPS protocol: The upstream repo used HTTPS URLs, which work for anyone. SSH URLs require a properly configured SSH key with access to GitHub. Any contributor cloning this repo without GitHub SSH credentials configured will fail on
git submodule update --init. -
Odoo-specific forks in the public repo: These point to
odoo/aw-serverandodoo/aw-server-rust, which are Odoo internal forks. If those repos are private, every contributor to the ActivityWatch project will be unable to fetch the submodules. Even if they are public, they replace the canonical ActivityWatch source, which is unexpected for a community project.
The same issue appears at line 19 for aw-server-rust.
These should either revert to the upstream ActivityWatch HTTPS URLs, or the Odoo-specific overrides should be kept out-of-tree (e.g., via a local .gitconfig override or a separate odoo-specific manifest).
| #define MyAppPublisher "ActivityWatch Contributors" | ||
| #define MyAppURL "https://activitywatch.net/" | ||
| #define MyAppExeName "aw-qt.exe" | ||
| #define MyAppExeName "aw-systray-odoo.exe" |
There was a problem hiding this comment.
Inno Setup script unconditionally switched to
aw-systray-odoo.exe
MyAppExeName is now set to aw-systray-odoo.exe unconditionally:
#define MyAppExeName "aw-systray-odoo.exe"This file is the standard Windows installer script for ActivityWatch. Changing the main app executable to aw-systray-odoo.exe means that any standard (non-Odoo) Windows build will produce a broken installer — it will reference an executable that doesn't exist in the standard package. The original aw-qt.exe entry was also removed from [Files].
This change should be conditionalized (e.g., using Inno Setup preprocessor #ifdef ODOO_BUILD) or kept in a separate, Odoo-specific .iss file that doesn't modify the upstream installer.
| ], | ||
| ) | ||
| aw_server_a = build_analysis( |
There was a problem hiding this comment.
aw_server_a analysis is always built even when skip_aw_server_python=True
When SKIP_SERVER_PYTHON=true, the script sets skip_aw_server_python = True and skips creating aws_coll, but the aw_server_a analysis on line 121 is still unconditionally executed:
aw_server_a = build_analysis(
"aw-server",
aws_location,
...
)This means PyInstaller still performs the full dependency analysis of the Python server even in the SKIP_SERVER_PYTHON=true case, which defeats the purpose of the flag. If the aw-server Python source is not present (e.g., when building without that submodule), this will also fail with a FileNotFoundError.
The build_analysis call should also be guarded:
if not skip_aw_server_python:
aw_server_a = build_analysis(
"aw-server",
aws_location,
...
)| python3 python3-dev python3-pip python3-venv curl \ | ||
| pkgconf libssl-dev libxkbcommon-dev libglib2.0-0 && \ |
There was a problem hiding this comment.
Duplicate
curl package in apt-get install
curl appears twice in the same apt-get install command:
apt-get install -y --no-install-recommends ca-certificates apt-transport-https adduser \
build-essential zip unzip git curl \
python3 python3-dev python3-pip python3-venv curl \While this doesn't cause a build failure, it's a leftover from copy-paste and should be cleaned up.
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends ca-certificates apt-transport-https adduser \ | ||
| build-essential zip unzip git curl rustup \ | ||
| python3 python3-dev python3-pip python3-venv python3-poetry curl rustup \ |
There was a problem hiding this comment.
Duplicate
curl and rustup packages in apt-get install
Both curl and rustup appear twice in the same apt-get install line. Additionally, Dockerfile_noble installs python3-poetry via apt-get but the venv is created manually without using it, while Dockerfile_jammy installs poetry via pip. Consider making them consistent.
| Maintainer: Christophe Monniez <moc@odoo.com> | ||
| Homepage: https://nightly.odoo.com/aw | ||
| Package: activitywatch-odoo | ||
| Version: 0.13.2-1 |
There was a problem hiding this comment.
Hardcoded package version will get out of sync
The version is hardcoded as 0.13.2-1. This will need to be manually updated with every release and will silently drift out of sync with the actual ActivityWatch version. Consider generating this field dynamically in buildpackage.sh using sed or a template mechanism driven by the git tag/version.
| SUBMODULES := $(filter-out aw-server,$(SUBMODULES)) | ||
| endif | ||
| # Odoo-specific Windows build: replaces aw-qt with aw-systray-odoo | ||
| ifeq ($(ODOO_WINDOWS_BUILD),true) | ||
| SUBMODULES := $(filter-out aw-qt,$(SUBMODULES)) | ||
| endif | ||
| # Include extras if AW_EXTRAS is true |
There was a problem hiding this comment.
Inconsistent indentation in new
ifeq blocks (spaces vs tabs)
The existing ifeq blocks in this Makefile use tab indentation for commands inside them, but the two new blocks use 4-space indentation. Please align with the file's existing style.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
No description provided.