Skip to content

Commit 23f59ec

Browse files
committed
crash: add build configuration and distributor information
Also adds distributor to --version and build configuration to --version --verbose
1 parent 8e40112 commit 23f59ec

File tree

9 files changed

+156
-82
lines changed

9 files changed

+156
-82
lines changed

.github/ISSUE_TEMPLATE/crash.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ body:
3333
attributes:
3434
label: Minidump
3535
description: |
36-
Attach `minidump.dmp` here. If it is too big to upload, compress it.
36+
Attach `minidump.dmp.log` here. If it is too big to upload, compress it.
3737
3838
You may skip this step if quickshell crashed while processing a password
3939
or other sensitive information. If you skipped it write why instead.
@@ -44,7 +44,7 @@ body:
4444
attributes:
4545
label: Log file
4646
description: |
47-
Attach `log.qslog` here. If it is too big to upload, compress it.
47+
Attach `log.qslog.log` here. If it is too big to upload, compress it.
4848
4949
You can preview the log if you'd like using `quickshell read-log <path-to-log>`.
5050
validations:
@@ -70,3 +70,13 @@ body:
7070
in the crash reporter.
7171
2. Once it loads, type `bt -full` (then enter)
7272
3. Copy the output and attach it as a file or in a spoiler.
73+
- type: textarea
74+
id: exe
75+
attributes:
76+
label: Executable
77+
description: |
78+
If the crash folder contains a executable.txt file, upload it here. If not you can ignore this field.
79+
If it is too big to upload, compress it.
80+
81+
Note: executable.txt is the quickshell binary. It has a .txt extension due to github's limitations on
82+
filetypes.

BUILD.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
Instructions for building from source and distro packagers. We highly recommend
33
distro packagers read through this page fully.
44

5+
## Packaging
6+
If you are packaging quickshell for official or unofficial distribution channels,
7+
such as a distro package repository, user repository, or other shared build location,
8+
please set the following CMake flags.
9+
10+
`-DDISTRIBUTOR="your distribution platform"`
11+
12+
Please make this descriptive enough to identify your specific package, for example:
13+
- `Official Nix Flake`
14+
- `AUR (quickshell-git)`
15+
- `Nixpkgs`
16+
- `Fedora COPR (errornointernet/quickshell)`
17+
18+
`-DDISTRIBUTOR_DEBUGINFO_AVAILABLE=YES/NO`
19+
20+
If we can retrieve binaries and debug information for the package without actually running your
21+
distribution (e.g. from an website), and you would like to strip the binary, please set this to `YES`.
22+
23+
If we cannot retrieve debug information, please set this to `NO` and
24+
**ensure you aren't distributing stripped (non debuggable) binaries**.
25+
26+
In both cases you should build with `-DCMAKE_BUILD_TYPE=RelWithDebInfo` (then split or keep the debuginfo).
27+
528
## Dependencies
629
Quickshell has a set of base dependencies you will always need, names vary by distro:
730

@@ -18,12 +41,6 @@ At least Qt 6.6 is required.
1841

1942
All features are enabled by default and some have their own dependencies.
2043

21-
### QML Library
22-
If you wish to use a linter or similar tools, you will need the QML Modules for it
23-
to pick up on the types.
24-
25-
To disable: `-DINSTALL_QML_LIB=OFF`
26-
2744
### Crash Reporter
2845
The crash reporter catches crashes, restarts quickshell when it crashes,
2946
and collects useful crash information in one place. Leaving this enabled will
@@ -169,9 +186,6 @@ or quickshell will fail to build.
169186

170187
Additionally, note that clang builds much faster than gcc if you care.
171188

172-
You may disable debug information but it's only a couple megabytes and is extremely helpful
173-
for helping us fix problems when they do arise.
174-
175189
#### Building
176190
```sh
177191
$ cmake --build build

CMakeLists.txt

Lines changed: 61 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,64 @@ set(QT_MIN_VERSION "6.6.0")
55
set(CMAKE_CXX_STANDARD 20)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77

8-
option(BUILD_TESTING "Build tests" OFF)
9-
option(ASAN "Enable ASAN" OFF) # note: better output with gcc than clang
10-
option(FRAME_POINTERS "Always keep frame pointers" ${ASAN})
11-
12-
option(INSTALL_QML_LIB "Installing the QML lib" ON)
13-
option(CRASH_REPORTER "Enable the crash reporter" ON)
14-
option(USE_JEMALLOC "Use jemalloc over the system malloc implementation" ON)
15-
option(SOCKETS "Enable unix socket support" ON)
16-
option(WAYLAND "Enable wayland support" ON)
17-
option(WAYLAND_WLR_LAYERSHELL "Support the zwlr_layer_shell_v1 wayland protocol" ON)
18-
option(WAYLAND_SESSION_LOCK "Support the ext_session_lock_v1 wayland protocol" ON)
19-
option(WAYLAND_TOPLEVEL_MANAGEMENT "Support the zwlr_foreign_toplevel_management_v1 wayland protocol" ON)
20-
option(X11 "Enable X11 support" ON)
21-
option(HYPRLAND "Support hyprland specific features" ON)
22-
option(HYPRLAND_IPC "Hyprland IPC" ON)
23-
option(HYPRLAND_GLOBAL_SHORTCUTS "Hyprland Global Shortcuts" ON)
24-
option(HYPRLAND_FOCUS_GRAB "Hyprland Focus Grabbing" ON)
25-
option(SERVICE_STATUS_NOTIFIER "StatusNotifierItem service" ON)
26-
option(SERVICE_PIPEWIRE "PipeWire service" ON)
27-
option(SERVICE_MPRIS "Mpris service" ON)
28-
option(SERVICE_PAM "Pam service" ON)
29-
option(SERVICE_GREETD "Greet service" ON)
30-
option(SERVICE_UPOWER "UPower service" ON)
31-
option(SERVICE_NOTIFICATIONS "Notification server" ON)
8+
set(QS_BUILD_OPTIONS "")
9+
10+
function(boption VAR NAME DEFAULT)
11+
cmake_parse_arguments(PARSE_ARGV 3 arg "" "REQUIRES" "")
12+
13+
option(${VAR} ${NAME} ${DEFAULT})
14+
15+
set(STATUS "${VAR}_status")
16+
set(EFFECTIVE "${VAR}_effective")
17+
set(${STATUS} ${${VAR}})
18+
set(${EFFECTIVE} ${${VAR}})
19+
20+
if (${${VAR}} AND DEFINED arg_REQUIRES)
21+
set(REQUIRED_EFFECTIVE "${arg_REQUIRES}_effective")
22+
if (NOT ${${REQUIRED_EFFECTIVE}})
23+
set(${STATUS} "OFF (Requires ${arg_REQUIRES})")
24+
set(${EFFECTIVE} OFF)
25+
endif()
26+
endif()
27+
28+
set(${EFFECTIVE} "${${EFFECTIVE}}" PARENT_SCOPE)
29+
30+
message(STATUS " ${NAME}: ${${STATUS}}")
31+
32+
string(APPEND QS_BUILD_OPTIONS "\\n ${NAME}: ${${STATUS}}")
33+
set(QS_BUILD_OPTIONS "${QS_BUILD_OPTIONS}" PARENT_SCOPE)
34+
endfunction()
35+
36+
set(DISTRIBUTOR "Unset" CACHE STRING "Distributor")
37+
string(APPEND QS_BUILD_OPTIONS " Distributor: ${DISTRIBUTOR}")
3238

3339
message(STATUS "Quickshell configuration")
34-
message(STATUS " QML lib installation: ${INSTALL_QML_LIB}")
35-
message(STATUS " Crash reporter: ${CRASH_REPORTER}")
36-
message(STATUS " Jemalloc: ${USE_JEMALLOC}")
37-
message(STATUS " Build tests: ${BUILD_TESTING}")
38-
message(STATUS " Sockets: ${SOCKETS}")
39-
message(STATUS " Wayland: ${WAYLAND}")
40-
if (WAYLAND)
41-
message(STATUS " Wlroots Layershell: ${WAYLAND_WLR_LAYERSHELL}")
42-
message(STATUS " Session Lock: ${WAYLAND_SESSION_LOCK}")
43-
message(STATUS " Toplevel Management: ${WAYLAND_TOPLEVEL_MANAGEMENT}")
44-
endif ()
45-
message(STATUS " X11: ${X11}")
46-
message(STATUS " Services")
47-
message(STATUS " StatusNotifier: ${SERVICE_STATUS_NOTIFIER}")
48-
message(STATUS " PipeWire: ${SERVICE_PIPEWIRE}")
49-
message(STATUS " Mpris: ${SERVICE_MPRIS}")
50-
message(STATUS " Pam: ${SERVICE_PAM}")
51-
message(STATUS " Greetd: ${SERVICE_GREETD}")
52-
message(STATUS " UPower: ${SERVICE_UPOWER}")
53-
message(STATUS " Notifications: ${SERVICE_NOTIFICATIONS}")
54-
message(STATUS " Hyprland: ${HYPRLAND}")
55-
if (HYPRLAND)
56-
message(STATUS " IPC: ${HYPRLAND_IPC}")
57-
message(STATUS " Focus Grabbing: ${HYPRLAND_FOCUS_GRAB}")
58-
message(STATUS " Global Shortcuts: ${HYPRLAND_GLOBAL_SHORTCUTS}")
59-
endif()
40+
message(STATUS " Distributor: ${DISTRIBUTOR}")
41+
boption(DISTRIBUTOR_DEBUGINFO_AVAILABLE "Distributor provided debuginfo" NO)
42+
boption(NO_PCH "Disable precompild headers (dev)" OFF)
43+
boption(BUILD_TESTING "Build tests (dev)" OFF)
44+
boption(ASAN "ASAN (dev)" OFF) # note: better output with gcc than clang
45+
boption(FRAME_POINTERS "Keep Frame Pointers (dev)" ${ASAN})
46+
47+
boption(CRASH_REPORTER "Crash Handling" ON)
48+
boption(USE_JEMALLOC "Use jemalloc" ON)
49+
boption(SOCKETS "Unix Sockets" ON)
50+
boption(WAYLAND "Wayland" ON)
51+
boption(WAYLAND_WLR_LAYERSHELL " Wlroots Layer-Shell" ON REQUIRES WAYLAND)
52+
boption(WAYLAND_SESSION_LOCK " Session Lock" ON REQUIRES WAYLAND)
53+
boption(WAYLAND_TOPLEVEL_MANAGEMENT " Foreign Toplevel Management" ON REQUIRES WAYLAND)
54+
boption(HYPRLAND " Hyprland" ON REQUIRES WAYLAND)
55+
boption(HYPRLAND_IPC " Hyprland IPC" ON REQUIRES HYPRLAND)
56+
boption(HYPRLAND_GLOBAL_SHORTCUTS " Hyprland Global Shortcuts" ON REQUIRES HYPRLAND)
57+
boption(HYPRLAND_FOCUS_GRAB " Hyprland Focus Grabbing" ON REQUIRES HYPRLAND)
58+
boption(X11 "X11" ON)
59+
boption(SERVICE_STATUS_NOTIFIER "System Tray" ON)
60+
boption(SERVICE_PIPEWIRE "PipeWire" ON)
61+
boption(SERVICE_MPRIS "Mpris" ON)
62+
boption(SERVICE_PAM "Pam" ON)
63+
boption(SERVICE_GREETD "Greetd" ON)
64+
boption(SERVICE_UPOWER "UPower" ON)
65+
boption(SERVICE_NOTIFICATIONS "Notifications" ON)
6066

6167
if (NOT DEFINED GIT_REVISION)
6268
execute_process(
@@ -157,13 +163,11 @@ if (USE_JEMALLOC)
157163
target_link_libraries(quickshell PRIVATE ${JEMALLOC_LIBRARIES})
158164
endif()
159165

160-
if (INSTALL_QML_LIB)
161-
install(
162-
DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules/
163-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt-6/qml
164-
FILES_MATCHING PATTERN "*"
165-
)
166-
endif()
166+
install(
167+
DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules/
168+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/qt-6/qml
169+
FILES_MATCHING PATTERN "*"
170+
)
167171

168172
install(CODE "
169173
execute_process(

default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
withPipewire ? true,
3838
withPam ? true,
3939
withHyprland ? true,
40-
withQMLLib ? true,
4140
}: buildStdenv.mkDerivation {
4241
pname = "quickshell${lib.optionalString debug "-debug"}";
4342
version = "0.1.0";
@@ -71,14 +70,15 @@
7170
cmakeBuildType = if debug then "Debug" else "RelWithDebInfo";
7271

7372
cmakeFlags = [
73+
(lib.cmakeFeature "DISTRIBUTOR" "Official-Nix-Flake")
74+
(lib.cmakeBool "DISTRIBUTOR_DEBUGINFO_AVAILABLE" true)
7475
(lib.cmakeFeature "GIT_REVISION" gitRev)
7576
(lib.cmakeBool "CRASH_REPORTER" withCrashReporter)
7677
(lib.cmakeBool "USE_JEMALLOC" withJemalloc)
7778
(lib.cmakeBool "WAYLAND" withWayland)
7879
(lib.cmakeBool "SERVICE_PIPEWIRE" withPipewire)
7980
(lib.cmakeBool "SERVICE_PAM" withPam)
8081
(lib.cmakeBool "HYPRLAND" withHyprland)
81-
(lib.cmakeBool "INSTALL_QML_LIB" withQMLLib)
8282
];
8383

8484
# How to get debuginfo in gdb from a release build:

src/core/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,16 @@ else()
5252
set(CRASH_REPORTER_DEF 0)
5353
endif()
5454

55+
if (DISTRIBUTOR_DEBUGINFO_AVAILABLE)
56+
set(DEBUGINFO_AVAILABLE 1)
57+
else()
58+
set(DEBUGINFO_AVAILABLE 0)
59+
endif()
60+
5561
add_library(quickshell-build INTERFACE)
56-
configure_file(build.hpp.in build.hpp)
62+
63+
configure_file(build.hpp.in build.hpp @ONLY ESCAPE_QUOTES)
64+
5765
target_include_directories(quickshell-build INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
5866
target_link_libraries(quickshell-core PRIVATE quickshell-build)
5967

src/core/build.hpp.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22

33
// NOLINTBEGIN
44
#define GIT_REVISION "@GIT_REVISION@"
5+
#define DISTRIBUTOR "@DISTRIBUTOR@"
6+
#define DISTRIBUTOR_DEBUGINFO_AVAILABLE @DEBUGINFO_AVAILABLE@
57
#define CRASH_REPORTER @CRASH_REPORTER_DEF@
8+
#define BUILD_TYPE "@CMAKE_BUILD_TYPE@"
9+
#define COMPILER "@CMAKE_CXX_COMPILER_ID@ (@CMAKE_CXX_COMPILER_VERSION@)"
10+
#define COMPILE_FLAGS "@CMAKE_CXX_FLAGS@"
11+
#define BUILD_CONFIGURATION "@QS_BUILD_OPTIONS@"
612
// NOLINTEND

src/core/main.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <CLI/Validators.hpp>
1414
#include <fcntl.h>
1515
#include <qapplication.h>
16+
#include <qconfig.h>
1617
#include <qcontainerfwd.h>
1718
#include <qcoreapplication.h>
1819
#include <qcryptographichash.h>
@@ -36,6 +37,7 @@
3637
#include <qstring.h>
3738
#include <qtenvironmentvariables.h>
3839
#include <qtextstream.h>
40+
#include <qtversion.h>
3941
#include <unistd.h>
4042

4143
#include "../io/ipccomm.hpp"
@@ -425,7 +427,21 @@ int runCommand(int argc, char** argv, QCoreApplication* coreApplication) {
425427
}
426428

427429
if (state.misc.printVersion) {
428-
qCInfo(logBare).noquote() << "quickshell pre-release, revision" << GIT_REVISION;
430+
qCInfo(logBare).noquote().nospace() << "quickshell pre-release, revision " << GIT_REVISION
431+
<< ", distributed by: " << DISTRIBUTOR;
432+
433+
if (state.log.verbosity > 1) {
434+
qCInfo(logBare).noquote() << "\nBuildtime Qt Version:" << QT_VERSION_STR;
435+
qCInfo(logBare).noquote() << "Runtime Qt Version:" << qVersion();
436+
qCInfo(logBare).noquote() << "Compiler:" << COMPILER;
437+
qCInfo(logBare).noquote() << "Compile Flags:" << COMPILE_FLAGS;
438+
}
439+
440+
if (state.log.verbosity > 0) {
441+
qCInfo(logBare).noquote() << "\nBuild Type:" << BUILD_TYPE;
442+
qCInfo(logBare).noquote() << "Build configuration:";
443+
qCInfo(logBare).noquote().nospace() << BUILD_CONFIGURATION;
444+
}
429445
} else if (*state.subcommand.log) {
430446
return readLogFile(state);
431447
} else if (*state.subcommand.list) {

src/crash/interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ CrashReporterGui::CrashReporterGui(QString reportFolder, int pid)
5454

5555
mainLayout->addWidget(new ReportLabel(
5656
"Github:",
57-
"https://github.com/outfoxxed/quickshell/issues/new?template=crash.yml",
57+
"https://github.com/quickshell-mirror/quickshell/issues/new?template=crash.yml",
5858
this
5959
));
6060

0 commit comments

Comments
 (0)