Building from source, running into issue on the make command (Windows 10)

I am on windows 10 and I am attempting to build from source to start contributing to the project.
I was following along with the guide.
These are the version of the programs I have in path currently:

* Python 3.9.13
* Git 2.36.1
* GNU Make 3.81
* Poetry 1.7.1
* Node.js 20.9.0
* npm 10.1.0
* Rust 1.75.0
* Cargo 1.75.0

I am in powershell and here is the output:

PS C:\Users\L3> cd A:\.code\py\standalone\2024\activitywatch\activitywatch
PS A:\.code\py\standalone\2024\activitywatch\activitywatch> .\venv\Scripts\Activate.ps1
(venv) PS A:\.code\py\standalone\2024\activitywatch\activitywatch> make build
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
if [ -e "aw-core/.git" ]; then \
                echo "Submodules seem to already be initialized, continuing..."; \
        else \
                git submodule update --init --recursive; \
        fi
-e was unexpected at this time.
make: *** [build] Error 255

Downloaded make from the link the guide provided: make version

You need to use the bash shell (usually known as “git bash” on Windows as it’s included with git), Powershell is not supported.

The docs mention this briefly where it mentions how to activate the virtualenv, but I could probably make this clearer: “for Windows git bash…”

Trying to use git bash but not really sure how to continue. Was really hoping to contribute but feel like I am just wasting your guys time at the moment. Sorry.

You were so close! The last command source venv/Scripts/activate was correct, you just forgot a " at the end.

Oh wow, ya was so close. Got the build working but getting the same message I got when I tried to manually build all the components myself. I don’t mind deleting the folder and trying to re-build fresh (I ran out of space on the first build and had to run again) but maybe the issue about no aw-server and missing watcher’s has some easy fix?
Thanks for the help btw!

The tray icon shows up btw, just have no page at: http://localhost:5666/
Also have the regular Activity Watch running at the same time but it seems that’s not an issue if I use the testing flag.

Also experience the same issue as @KarlRW. Anyone manage to solve it?

I had the same issue, got a little further, but couldn’t solve it.

I replace this line in the makefile in the root of the project:

$(shell make -q -C $1 $2 >/dev/null 2>&1; if [ $$? -eq 0 -o $$? -eq 1 ]; then echo $1; fi)

with this line:

$(shell bash -c “make -q -C $1 $2 >/dev/null 2>&1; EXIT_CODE=$$?; if [ $$EXIT_CODE -eq 0 ] || [ $$EXIT_CODE -eq 1 ]; then echo $1; fi”)

I tried making a minimal make file on windows, and couldn’t get it to run shell commands no matter what I set “SHELL” to, so I specify bash in the command. You probably need to make sure that gitbash bin folder is in your PATH env variable for this to work.

I also had to cd into some of the submodules and run poetry lock in the terminal, and doing that requires you change another line in pyproject.toml for aw-qt, documented here: build: remove upper version requirement on Python (#106) · ActivityWatch/aw-qt@43864b2 · GitHub although in my case I had to change it to just “*”, which seems bad, but oh well.

Even after getting make to run, pretty much everything failed to build. I suspect it’s because it really is necessary for the SHELL thing in the makefile to work, because otherwise commands like mkdir -p will fail, and apparently silently.

If somebody has more experience with forcing windows to use the right shell when running make, I suspect that will fix the issue. Is anyone able to build from source on windows successfully?