Skip to content

Commit

Permalink
chore(deps): Bump hs-tokstyle from 636ca43 to f640e80
Browse files Browse the repository at this point in the history
Bumps [hs-tokstyle](https://github.com/TokTok/hs-tokstyle) from `636ca43` to `f640e80`.
- [Release notes](https://github.com/TokTok/hs-tokstyle/releases)
- [Commits](TokTok/hs-tokstyle@636ca43...f640e80)

---
updated-dependencies:
- dependency-name: hs-tokstyle
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
  • Loading branch information
dependabot[bot] authored and iphydf committed Jan 13, 2024
1 parent 60b6095 commit 6980e85
Show file tree
Hide file tree
Showing 9 changed files with 131 additions and 11 deletions.
20 changes: 13 additions & 7 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ build:valgrind --config=dynamic-analysis
build:drmemory --run_under="drmemory --"
build:drmemory --config=dynamic-analysis

build:libfuzzer --per_file_copt="//c-toxcore[:/]@-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
build:libfuzzer --host_per_file_copt="//c-toxcore[:/]@-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
build:libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
build:libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer

Expand Down Expand Up @@ -177,7 +179,7 @@ build:asan --copt='-fsanitize=address'
build:asan --copt='-fsanitize-address-use-after-return=always'
build:asan --copt='-fsanitize-address-use-after-scope'
build:asan --linkopt='-fsanitize=address'
build:asan --action_env=ASAN_OPTIONS=color=always:detect_leaks=1:strict_string_checks=1:check_initialization_order=1:strict_init_order=1:external_symbolizer_path=/nix/store/643f0y8q5yfzrqq4kn56dc13xvz90srv-llvm-16.0.1/bin/llvm-symbolizer
build:asan --action_env=ASAN_OPTIONS=color=always:detect_leaks=1:strict_string_checks=1:check_initialization_order=1:strict_init_order=1:external_symbolizer_path=/nix/store/d0r6r274cpcr6gslqx16gn0m38qpy5p3-llvm-16.0.6/bin/llvm-symbolizer
build:asan --action_env=LSAN_OPTIONS=report_objects=1

build:msan --config=sanitizer
Expand All @@ -186,14 +188,14 @@ build:msan --config=sanitizer
build:msan --copt='-fsanitize=memory'
build:msan --copt='-fsanitize-memory-track-origins=2'
build:msan --linkopt='-fsanitize=memory'
build:msan --test_env=MSAN_OPTIONS=color=always:external_symbolizer_path=/nix/store/643f0y8q5yfzrqq4kn56dc13xvz90srv-llvm-16.0.1/bin/llvm-symbolizer
build:msan --test_env=MSAN_OPTIONS=color=always:external_symbolizer_path=/nix/store/d0r6r274cpcr6gslqx16gn0m38qpy5p3-llvm-16.0.6/bin/llvm-symbolizer
build:msan --per_file_copt='//toxic[:/]@-UAUDIO,-UVIDEO,-UPYTHON'

build:tsan --config=sanitizer
build:tsan --features=tsan
build:tsan --copt='-fsanitize=thread'
build:tsan --linkopt='-fsanitize=thread'
build:tsan --test_env=TSAN_OPTIONS=color=always,history_size=7,force_seq_cst_atomics=1:external_symbolizer_path=/nix/store/643f0y8q5yfzrqq4kn56dc13xvz90srv-llvm-16.0.1/bin/llvm-symbolizer
build:tsan --test_env=TSAN_OPTIONS=color=always,history_size=7,force_seq_cst_atomics=1:external_symbolizer_path=/nix/store/d0r6r274cpcr6gslqx16gn0m38qpy5p3-llvm-16.0.6/bin/llvm-symbolizer

build:ubsan --config=sanitizer
build:ubsan --features=ubsan
Expand All @@ -204,7 +206,7 @@ build:ubsan --linkopt='-fsanitize=integer,nullability,undefined'
# https://github.com/bazelbuild/bazel/issues/11122
build:ubsan --linkopt='-fsanitize-link-c++-runtime'
build:ubsan --per_file_copt='//c-toxcore[:/]@-D_DEBUG'
build:ubsan --test_env=UBSAN_OPTIONS=color=always,print_stacktrace=1:external_symbolizer_path=/nix/store/643f0y8q5yfzrqq4kn56dc13xvz90srv-llvm-16.0.1/bin/llvm-symbolizer
build:ubsan --test_env=UBSAN_OPTIONS=color=always,print_stacktrace=1:external_symbolizer_path=/nix/store/d0r6r274cpcr6gslqx16gn0m38qpy5p3-llvm-16.0.6/bin/llvm-symbolizer

# Link-time optimization.
build:lto --copt='-flto'
Expand Down Expand Up @@ -286,7 +288,8 @@ build:gcc --config=gnulike
# Use GNU versions of the C standard, because runtime/cgo doesn't set feature
# flags correctly. We then override it in *all* per-file flags, which ends up
# not matching runtime/cgo/gcc_setenv.c for some reason.
build:gnulike --cxxopt='-std=c++17'
build:gnulike --cxxopt='-std=c++20'
build:gnulike --host_cxxopt='-std=c++20'
build:gnulike --conlyopt='-std=gnu17'
build:gnulike --per_file_copt='\\.c$@-std=c17'

Expand Down Expand Up @@ -386,7 +389,8 @@ build:windows-x86_64 --per_file_copt='//c-toxcore/toxcore:network.c@-Wno-cast-qu

build:clang --per_file_copt='//c-toxcore/toxav:video.c@-Wno-used-but-marked-unused'
build:clang --per_file_copt='//c-toxcore/super_donators@-w'
build:clang --per_file_copt='_test\\.(cc|cpp)$@-Wno-global-constructors,-Wno-exit-time-destructors'
build:clang --per_file_copt='_bench\\.(cc|cpp)$@-Wno-weak-vtables,-Wno-zero-as-null-pointer-constant'
build:clang --per_file_copt='_(test|bench)\\.(cc|cpp)$@-Wno-global-constructors,-Wno-exit-time-destructors'
build:clang --per_file_copt='_test\\.(cc|cpp)$@-Wno-c99-extensions'
build:clang --per_file_copt='_test\\.(cc|cpp)$@-Wno-zero-as-null-pointer-constant'
build:clang --per_file_copt='_test\\.cpp$@-Wno-extra-semi-stmt'
Expand Down Expand Up @@ -467,7 +471,8 @@ build:gnulike --per_file_copt='/go_default_library%@-w'
# Ignore warnings for protobuf generated files.
build:gnulike --per_file_copt='\\.pb\\.cc$@-w'

# Disable some clang warnings on ffmpeg.
# Disable some clang warnings on various third party dependencies.
build:clang --per_file_copt='external/benchmark[:/]@-Wno-weak-vtables'
build:clang --per_file_copt='external/ffmpeg[:/]@-Wno-bool-operation'
build:clang --per_file_copt='external/ffmpeg[:/]@-Wno-braced-scalar-init'
build:clang --per_file_copt='external/ffmpeg[:/]@-Wno-dangling-else'
Expand Down Expand Up @@ -505,6 +510,7 @@ build:gcc --per_file_copt='external/ffmpeg[:/]@-Wno-stringop-truncation'
build:gcc --per_file_copt='external/libidn2[:/]@-Wno-unused-const-variable'
build:gcc --per_file_copt='external/opus[:/]@-Wno-maybe-uninitialized'

build:clang --per_file_copt='external/openal[:/]@-std=c++17'
build:clang --per_file_copt='external/openal[:/]@-Wno-unused-value'
build:gcc --host_per_file_copt='external/openal[:/]@-Wno-use-after-free'

Expand Down
7 changes: 7 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,13 @@ github_archive(
version = "b3a9ba2b8e975550799838332803d468797ae2e1",
)

github_archive(
name = "benchmark",
repo = "google/benchmark",
sha256 = "abfc22e33e3594d0edf8eaddaf4d84a2ffc491ad74b6a7edc6e7a608f690e691",
version = "v1.8.3",
)

new_github_archive(
name = "curl",
repo = "curl/curl",
Expand Down
2 changes: 1 addition & 1 deletion c-toxcore
Submodule c-toxcore updated 104 files
2 changes: 1 addition & 1 deletion hs-apigen
Submodule hs-apigen updated 1 files
+6 −2 tools/gen-python
8 changes: 8 additions & 0 deletions tools/built/src/home/.config/home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
if builtins.pathExists tokenFile
then lib.removeSuffix "\n" (builtins.readFile tokenFile)
else "";

ASAN_OPTIONS = "color=always:detect_leaks=1:strict_string_checks=1:check_initialization_order=1:strict_init_order=1";
LSAN_OPTIONS = "report_objects=1";
MSAN_OPTIONS = "color=always";
TSAN_OPTIONS = "color=always,history_size=7,force_seq_cst_atomics=1";
UBSAN_OPTIONS = "color=always,print_stacktrace=1";
};
home.sessionPath = [
"${config.home.homeDirectory}/.bin"
Expand All @@ -19,6 +25,8 @@
# Packages that should be installed to the user profile.
home.packages = with pkgs; [
astyle # C code formatting
bazel-watcher # runs bazel test/build in a loop when files change
clang-tools # C++ code formatting
connect # for ssh proxy via tor
gdb # debugger for C code
gnupg # for signing git commits
Expand Down
32 changes: 32 additions & 0 deletions tools/debug/symbolize
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
import re
import subprocess
import sys

SYMBOLIZER = (
"/nix/store/d0r6r274cpcr6gslqx16gn0m38qpy5p3-llvm-16.0.6/bin/llvm-symbolizer"
)

for line in sys.stdin:
m = re.fullmatch(
"#(\d+) (0x[0-9a-f]+) \((.*)\+(0x[0-9a-f]+)\)( \(BuildId: [0-9a-f]+\))?",
line.strip(),
)
if m:
num = m.group(1)
addr = m.group(2)
prog = m.group(3)
off = m.group(4)
buildid = m.group(5) or ""

try:
fun = (subprocess.run(
[SYMBOLIZER, "--pretty-print", f"--exe={prog}", off],
check=True,
capture_output=True,
).stdout.decode("utf-8").split("\n")[0])
print(f" #{num} {fun}")
except subprocess.CalledProcessError:
print(f" #{num} {addr} ({prog}+{off}){buildid}")
else:
print(line, end="")
67 changes: 67 additions & 0 deletions tools/run-fuzzers
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env python3
import glob
import os
import subprocess
import sys

CLEANUP = True
SELF_DIR = os.path.dirname(os.path.abspath(__file__))
TMP_CORPUS = "/tmp/fuzzing/corpus/"


def update_corpus(target: str, corpus: str) -> None:
with open(os.path.join(corpus, "bootstrap"), "w"):
# Touch one file so the corpus isn't empty.
pass
subprocess.run(
[
"bazel",
"run",
"--config=asan-libfuzzer",
target + "_run",
"--",
"--timeout_secs=30",
],
check=True,
)
for file in glob.glob(os.path.join(corpus, "*")):
if os.path.basename(file) != "bootstrap":
subprocess.run(["mv", file, TMP_CORPUS], check=True)
subprocess.run(
[
"bazel",
"run",
"--config=asan-libfuzzer",
target + "_bin",
"--",
"-merge=1",
corpus,
TMP_CORPUS,
],
check=True,
)
if CLEANUP:
for file in glob.glob(os.path.join(TMP_CORPUS, "*")):
os.remove(file)


def main() -> None:
if len(sys.argv) > 1:
query = " ".join(sys.argv[1:])
else:
query = "//c-toxcore/..."
targets = (subprocess.run(
["bazel", "query", f"kind(fuzzing_regression_test, {query})"],
check=True,
capture_output=True,
).stdout.decode("utf-8").strip().split("\n"))

for target in targets:
name = target.split(":")[1]
corpus = os.path.join(SELF_DIR, "toktok-fuzzer", "corpus", name)
if os.path.exists(corpus):
update_corpus(target, corpus)


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion tools/toktok-fuzzer
Submodule toktok-fuzzer updated 8282 files

0 comments on commit 6980e85

Please sign in to comment.