Skip to content

Instantly share code, notes, and snippets.

View kwk's full-sized avatar

Konrad Kleine kwk

View GitHub Profile
@kwk
kwk / README.md
Created February 16, 2024 18:16
Testing with tmt without a copr build first

How to run test

I want to run the following very simple test on Fedora's testing farm. Is this possible and if so how?

summary: Very basic tests
discover:
    how: shell
    tests:
 - name: test hello world
@kwk
kwk / README.md
Last active December 11, 2023 15:29
Make llvm-snapshot-builder obsolete

The llvm-snapshot-builder is overly complex to maintain in the RPM build process. Here's a script and its output that could be included with %include version.spec.inc in the main llvm.spec file.

The output could look like this:

[INFO] Get the source tarball
[INFO] Source tarball already exists: llvm-project.tar.xz
[INFO] Grab git revision from tarball
[INFO] Extract the llvm/CMakeLists.txt file from the source tarball
[INFO] Parse llvm/CMakeLists.txt for the LLVM version
@kwk
kwk / test.log
Created December 4, 2023 12:11
test.log
Change Dir: '/home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build'
Run Build Command(s): /usr/bin/ninja-build -v -j 64 check-all
[0/10] cd /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/builtins-bins && /usr/bin/cmake --build .
ninja: no work to do.
[1/10] cd /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/builtins-bins && /usr/bin/cmake -E echo_append
[3/10] cd /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes && /usr/bin/cmake -E make_directory /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/CMakeFiles && /usr/bin/cmake -E touch /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/CMakeFiles/builtins-complete && /usr/bin/cmake -E touch /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/builtins-stamps/builtins-done
[3/10] cd /
@kwk
kwk / __init__.py
Last active December 1, 2023 15:04
OMP GDB Problem
# /home/fedora/src/llvm-rpms/llvm-big-merge/BUILD/llvm-18.0.0.src/redhat-linux-build/runtimes/runtimes-bins/openmp/libompd/test/../gdb-plugin/python-module/ompd/__init__.py
import sys
import os.path
import traceback
if __name__ == "__main__":
try:
sys.path.append(os.path.dirname(__file__))
import ompd
@kwk
kwk / README.md
Last active November 29, 2023 16:17
Automate getting Kerberos tickets with kinit using secret-tool

README

I often have to get multiple Kerberos tickets and I do this with kinit kkleine@REDHAT.COM for example. Then I have to enter my password. This is annoying. The script kinit-wrapper helps me use the secret-tool to store passwords in the default keyring on the first run and later pull them out of the keyring.

First run

Here's an example of a first run:

$ kinit-wrapper 
@kwk
kwk / create_arrays_heap.ll
Last active September 1, 2023 09:47
Is create_arrays_heap function ever used?
; ModuleID = '<stdin>'
source_filename = "<stdin>"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define void @create_arrays_heap(double %beta, ptr nocapture readonly %A, ptr nocapture %B) local_unnamed_addr #0 {
entry:
%beta.s2a = alloca double, align 8
%malloccall = tail call ptr @malloc(i64 2162688)
%malloccall1 = tail call ptr @malloc(i64 432537600000)
@kwk
kwk / foo.diff
Created August 29, 2023 15:09
Test diff
--- a/llvm/test/CodeGen/WebAssembly/lower-wasm-sjlj.ll
+++ b/llvm/test/CodeGen/WebAssembly/lower-wasm-sjlj.ll
@@ -2,6 +2,7 @@
; RUN: opt < %s -wasm-lower-em-ehsjlj -wasm-enable-sjlj -S --mattr=+atomics,+bulk-memory | FileCheck %s -DPTR=i32
; RUN: opt < %s -wasm-lower-em-ehsjlj -wasm-enable-sjlj --mtriple=wasm64-unknown-unknown -data-layout="e-m:e-p:64:64-i64:64-n32:64-S128" -S | FileCheck %s -DPTR=i64
+
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown"
5 ./clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-bind.cpp:boost::bind
4 ./clang/unittests/Format/UsingDeclarationsSorterTest.cpp:boost::regex;\n"
4 ./clang/unittests/Format/UsingDeclarationsSorterTest.cpp:boost::regex_constants::icase;\n"
4 ./clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-type-union-access.cpp:boost::)variant
3 ./libcxxabi/test/test_demangle.pass.cpp:boost::arg<2>,
3 ./libcxxabi/test/test_demangle.pass.cpp:boost::arg<1>,
3 ./clang-tools-extra/test/clang-tidy/checkers/modernize/use-nodiscard.cpp:boost::function<bool()>
3 ./clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-bind.cpp:boost::bind(add,
3 ./clang-tools-extra/test/clang-tidy/checkers/boost/use-to-string.cpp:boost::lexical_cast<T>(42);
3 ./clang/include/clang/Format/Format.h:boost::regex_constants::icase;
@kwk
kwk / README.md
Created May 25, 2023 14:45
Release: -tags in LLVM spec files for Fedora Rawhide over the last 13 years

I wanted to know how many times we've changes a Release: tag in any of the package spec files under the LLVM umbrella over the course of the last 13 years.

Here's the script I ran:

projects="clang llvm lldb lld python-lit mlir libomp"

(for y in {2023..2010}; do 
     for p in $projects; do
 rows=$(git -C ~/dev/llvm-rpms/$p-fedora \
@kwk
kwk / command.sh
Created May 22, 2023 15:19
Get list of builder admins for buildbot
curl -sL https://lab.llvm.org/buildbot/api/v2/workers > workers.json
curl -sL https://lab.llvm.org/buildbot/api/v2/builders > builders.json
cat builders.json | jq '.builders[] | {(.builderid|tostring): .name}' | jq '{"builders": (reduce inputs as $in (.; . + $in))}' > builders_lut.json
jq -s '.[0] * .[1]' builders_lut.json workers.json > joined.json
cat joined.json | jq '.builders as $builders | .workers[] | {"workername": .name, "admin": (""+.workerinfo.admin|tostring), "builders": $builders[.configured_on[].builderid | tostring]}' | jq -s > temp.json
cat temp.json | jq 'group_by(.admin)[] | {"admin": ("" + .[0].admin), "builders": [.[] | .builders] | sort | unique}' | jq -s