aboutsummaryrefslogtreecommitdiff
path: root/i3-dump-log
AgeCommit message (Collapse)Author
2024-01-27clang-format: enable InsertBraces (#5882)Orestis Floros
Enforces a rule that we have followed for years now. Yes, the diff is quite big but we get it over with once and we prevent having to nit-pick future PRs.
2021-01-20i3-dump-log -f: switch from pthreads to UNIX socketsMichael Stapelberg
fixes #4117
2020-04-20Remove unused headersOrestis Floros
With help from https://github.com/include-what-you-use/include-what-you-use/
2020-04-19Sort includes in *.c filesOrestis Floros
Not enabling in .clang-format because it breaks headers files. Used: IncludeCategories: - Regex: '^<config' Priority: 0 - Regex: '^".*"' Priority: 1 - Regex: '^<(xcb|xkb|yajl|X11)' Priority: 3 - Regex: '.*' Priority: 2
2020-02-21Code style: fix misaligned and trailing whitespacesAlbert Safin
2019-02-12i3-dump-log: make log message a little more clear (#3618)Michael Stapelberg
This came up when trying to debug an issue.
2017-11-26i3-dump-log: enable shmlog on demandMichael Stapelberg
fixes #3055
2017-09-24Replace http:// with https:// where applicableMichael Stapelberg
The testcases will be updated automatically in a separate commit.
2016-10-23Ensure all *.[ch] files include config.hMichael Stapelberg
Including config.h is necessary to get e.g. the _GNU_SOURCE define and any other definitions that autoconf declares. Hence, config.h needs to be included as the first header in each file. This is done either via: 1. Including "common.h" (i3bar) 2. Including "libi3.h" 3. Including "all.h" (i3) 4. Including <config.h> directly Also remove now-unused I3__FILE__, add copyright/license statement where missing and switch include/all.h to #pragma once.
2016-10-23Switch to autotools (GNU build system)Michael Stapelberg
This commit probably comes as a surprise to some, given that one of i3’s explicitly stated goals used to be “Do not use programs such as autoconf/automake for configuration and creating unreadable/broken makefiles”. I phrased this goal over 7 years ago, based largely on a grudge that I inherited, which — as I’ve realized in the meantime — was largely held against FOSS in general, and not actually nuanced criticism of autotools. In the meantime, I have come to realize that the knee-jerk reaction of “I could do this better!” (i.e. writing our own build system in this particular case) is usually misguided, and nowadays I strongly suggest trying hard to fix the existing system for the benefit of all existing and future users. Further, I recently got to experience the other side of the coin, as I packaged a new version of FreeRADIUS for Debian, which at the time of writing used autoconf in combination with boilermake, a custom make-based build system that only FreeRADIUS uses. Understanding the build system enough to fix issues and enable parallel compilation took me an entire day. That time is time which potentially every downstream maintainer needs to invest, and the resulting knowledge cannot be applied to any other project. Hence, I believe it’s a good idea switch i3 to autotools. Yes, it might be that particular features were easier to implement/understand in our custom Makefiles, and there might be individuals who have an easier time reading through our custom Makefiles than learning autotools. All of these considerations are outweighed by the benefits we get from using the same build system as literally thousands of other FOSS software packages. Aside from these somewhat philosophical considerations, there’s also practical improvements which this change brings us. See the “changes” section below. ┌──────────────────────────────────────────────────────────────────────────────┐ │ new workflow │ └──────────────────────────────────────────────────────────────────────────────┘ You can now build i3 like you build any other software package which uses autotools. Here’s a memory refresher: autoreconf -fi mkdir -p build && cd build ../configure make -j8 (The autoreconf -fi step is unnecessary if you are building from a release tarball, but shouldn’t hurt either.) ┌──────────────────────────────────────────────────────────────────────────────┐ │ recommended reading │ └──────────────────────────────────────────────────────────────────────────────┘ I very much recommend reading “A Practitioner's Guide to GNU Autoconf, Automake, and Libtool” by John Calcote (https://www.nostarch.com/autotools.htm). That book is from 2010 and, AFAICT, is the most up to date comprehensive description of autotools. Do not read older documentation. In particular, if a document you’re reading mentions configure.in (deprecated filename) or recursive make (now considered harmful), it’s likely outdated. ┌──────────────────────────────────────────────────────────────────────────────┐ │ changes │ └──────────────────────────────────────────────────────────────────────────────┘ This commit implements the following new functionality/changes in behavior: • We use the AX_ENABLE_BUILDDIR macro to enforce builds happening in a separate directory. This is a prerequisite for the AX_EXTEND_SRCDIR macro and building in a separate directory is common practice anyway. In case this causes any trouble when packaging i3 for your distribution, please let me know. • “make check” runs the i3 testsuite. You can still use ./testcases/complete-run.pl to get the interactive progress output. • “make distcheck” (runs testsuite on “make dist” result, tiny bit quicker feedback cycle than waiting for the travis build to catch the issue). • “make uninstall” (occasionally requested by users who compile from source) • “make” will build manpages/docs by default if the tools are installed. Conversely, manpages/docs are not tried to be built for users who don’t want to install all these dependencies to get started hacking on i3. • non-release builds will enable address sanitizer by default. Use the --disable-sanitizers configure option to turn off all sanitizers, and see --help for available sanitizers. • Support for pre-compiled headers (PCH) has been dropped for now in the interest of simplicitly. Maybe we can re-add it later. • coverage reports are now generated using “make check-code-coverage”, which requires specifying --enable-code-coverage when calling configure. ┌──────────────────────────────────────────────────────────────────────────────┐ │ build system feature parity/testing │ └──────────────────────────────────────────────────────────────────────────────┘ In addition to what’s described above, I tested the following features: • “make install” installs the same files (plus documentation and manpages) cd i3-old && make install PREFIX=/tmp/inst/old cd i3-new && ./configure --prefix=/tmp/inst/new cd /tmp/inst (cd old && for f in $(find); do [ -e "../new/$f" ] || echo "$f missing"; done) • make dist generates a tarball which includes the same files cd i3-old && make dist cd i3-new/x86_64-pc-linux-gnu && make dist colordiff -u <(tar tf i3-old/i3-4.12.tar.bz2 | sort) \ <(tar tf i3-new/x86_64-pc-linux-gnu/i3-4.12.tar.gz | sort) There are some expected differences: • Some files have been renamed (e.g. the new etc/ and share/ subdirectories) • Some files will now be generated at build-time, so only their corresponding .in file is shipped (e.g. testcases/complete-run.pl) • The generated parser files are shipped in the dist tarball (they only depend on the parser-specs/* files, not on the target system) • autotools infrastructure is shipped (e.g. “configure”, “missing”, etc.) • DLOG and ELOG statements still produce the same file name in logfiles • Listing source code in gdb still works. • gdb backtraces contain the i3-<version> path component • release.sh still works • version embedding 1. git checkout shows “4.12-136-gf720023 (2016-10-10, branch "autotools")” 2. tarball of a git version shows “4.12-non-git” 3. release tarball shows 4.13 • debug mode is enabled by default for non-release builds • enabling verbose builds via V=1 ┌──────────────────────────────────────────────────────────────────────────────┐ │ speed │ └──────────────────────────────────────────────────────────────────────────────┘ There is no noticeable difference in compilation speed itself (of binaries, documentation and manpages): i3-old $ time make all docs mans -j8 make all docs mans -j8 28.92s user 2.15s system 640% cpu 4.852 total i3-new $ time make -j8 make -j8 27.08s user 1.92s system 620% cpu 4.669 total In terms of one-time costs: configuring the build system (../configure) takes about 2.7s on my machine, generating the build system (autoreconf -fi) takes about 3.1s on my machine. ┌──────────────────────────────────────────────────────────────────────────────┐ │ m4 macros │ └──────────────────────────────────────────────────────────────────────────────┘ All files in m4/ have been copied from the autoconf-archive package in version b6aeb1988f4b6c78bf39d97b6c4f6e1d594d59b9 and should be updated whenever they change. This commit has been tested with autoconf 2.69 and automake 1.15.
2016-09-24Remove compatibility definitions for xcb-util < 0.3.8 (#2473)Michael Stapelberg
Even Debian oldstable has xcb-util 0.3.8.
2016-06-11Don't use pthread on OpenBSDChristopher Zimmermann
since OpenBSD pthread does not support pthread_condattr_setpshared(). This patch could also stay in the OpenBSD ports tree or depend on a configure test macro rather than defined __OpenBSD__.
2016-01-08i3-dump-log: explicitly free shmnameMichael Stapelberg
Reduces memory usage and makes LeakSanitizer more quiet.
2015-04-20Update copyright notices and get rid of rangesDeiz
The script used to make these changes can be found at: https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-12Respect EXEC_PREFIX and a users' choice of PKG_CONFIG.Thomas Anderson
The Makefiles should put binaries in $(EXEC_PREFIX) and architecture-independent files in $(PREFIX). Also a user may have a prefixed- pkg-config, as in the case of cross compiling on Exherbo Linux, so respect the well-accepted $(PKG_CONFIG) variable for this purpose.
2015-03-29Add a safe wrapper for write and fix some warningshwangcc
1. Add a function writeall and make swrite wrap that function. Use either writeall or swrite, depending on whether we want to exit on errors or not. 2. Fix warnings when compiling with a higher optimisation level. (CFLAGS ?= -pipe -O3 -march=native -mtune=native -freorder-blocks-and-partition) Signed-off-by: hwangcc <hwangcc@csie.nctu.edu.tw>
2014-06-15format **/*.c with clang-format-3.5Michael Stapelberg
This has multiple effects: 1) The i3 codebase is now consistently formatted. clang-format uncovered plenty of places where inconsistent code made it into our code base. 2) When writing code, you don’t need to think or worry about our coding style. Write it in yours, then run clang-format-3.5 3) When submitting patches, we don’t need to argue about coding style. The basic idea is that we don’t want to care about _how_ we write the code, but _what_ it does :). The coding style that we use is defined in the .clang-format config file and is based on the google style, but adapted in such a way that the number of modifications to the i3 code base is minimal.
2013-11-22make i3bar use libi3’s root_atom_contents()Michael Stapelberg
This removes code duplication, which will be useful for a subsequent commit. Furthermore, we now don’t open X11 connections unnecessarily in some corner cases.
2012-12-24i3-dump-log/main.c: error handling for write(...)Sascha Kruse
2012-12-14i3-dump-log: Correct comment to reflect truthAxel Wagner
2012-09-03fix compilation with older xcb-util with -DXCB_COMPAT (Thanks okraits)Michael Stapelberg
2012-08-13libi3: Implement Pango renderingFernando Tarlá Cardoso Lemos
2012-08-13shm-logging: implement i3-dump-log -f (follow)Michael Stapelberg
This changes the SHM log format, it doesn’t use 0-bytes to separate entries anymore. Instead of using lots of printf() calls in i3-dump-log, we now do precisely one big write(). So, to be clear: i3-dump-log and i3 both need to be upgraded. Mismatching versions will lead to garbage output (no crashes of i3, just garbage output). The -f flag uses an inter-process pthread_cond_t in the shared memory header to broadcast the arrival of new messages to all i3-dump-log processes. This internally uses futexes and thus doesn’t even mean a kernel call in most cases. inter-process pthread_cond_ts require NPTL (the Native Posix Thread Library, introduce in Linux 2.6).
2012-07-23Fix linking by linking libi3 first and its dependencies afterwardsMichael Stapelberg
Interestingly, compilation was only broken on some systems apparently
2012-07-23common.mk: Split XCB common flagsQuentin Glidic
2012-07-22common.mk: Introduce I3_*FLAGSQuentin Glidic
CPPFLGES, CFLAGS and LDFLAGS should be user variables We now provide default flags but use I3_*FLAGS flags for our own needed flags Also reoder lib flags a bit
2012-07-22*.mk: Support passing specific CFLAGS/LIBSQuentin Glidic
2012-07-22Add stub Makefiles to allow subdir make callsQuentin Glidic
2012-07-22Move i3-dump-log to the new Makefile layoutQuentin Glidic
2012-05-09Improve the main error message of i3-dump-logMichael Stapelberg
2012-01-06shmlog: store meta information in the buffer itself, store path as X11 atomMichael Stapelberg
This makes i3-dump-log completely independent of a running i3 instance.
2011-12-10add i3-dump-log, a tool to dump the SHM logMichael Stapelberg