i3 / i3/i3status

Fails to build on Mac

Open
#500 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
653
Forks
254
PR merge metrics
No merged PRs in 30d

Description

Today I wanted to build `i3status` from source because it doesn’t seem to be available from MacPorts (whereas [`i3` is](https://ports.macports.org/port/i3/), albeit not maintained).

So, following the instructions got me a few warnings and then
```
FAILED: i3status.p/src_print_disk_info.c.o
cc -Ii3status.p -I. -I.. -I../include -I/opt/local/include -I/opt/local/include/yajl -fcolor-diagnostics -Wall -Winvalid-pch -std=c11 -O0 -g -Wunused-value -D_GNU_SOURCE -D_REENTRANT -MD -MQ i3status.p/src_print_disk_info.c.o -MF i3status.p/src_print_disk_info.c.o.d -o i3status.p/src_print_disk_info.c.o -c ../src/print_disk_info.c
../src/print_disk_info.c:138:16: error: use of undeclared identifier 'path'
if (statfs(path, &buf) == -1)
^
1 error generated.
```
and it seems the `__APPLE__` code is the culprit:

https://github.com/i3/i3status/blob/30ea2d2da37187c9f1ef0fdd47d0999eb4751dc1/src/print_disk_info.c#L135-L141

Changing `path` to `ctx->path` compiles and seems to run:
```
savage@pooh ~/opt/src/i3status/build > i3status
i3status: trying to auto-detect output_format setting
i3status: auto-detected "term"
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.09 | 2022-09-10 19:49:28
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.09 | 2022-09-10 19:49:29
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.00 | 2022-09-10 19:49:30
no IPv6 | 33.7 GiB | W: down | E: down | No battery | 2.00 | 2022-09-10 19:49:31
```

Contributor guide

Open the contributing guide

Research direction

Start in src/print_disk_info.c around the __APPLE__ code referenced in the report, then reproduce the build on macOS using the issue's command output as a guide. The work is done when i3status builds successfully and runs without the reported undeclared-identifier error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.