Skip to content

Instantly share code, notes, and snippets.

Avatar
😸
Herding cats

Stephen Gutekanst slimsag

😸
Herding cats
View GitHub Profile
View libcxx_incompatible
error(compilation): clang failed with stderr: zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
In file included from C:\Users\slimsag\Desktop\zig\zig-out\lib\zig\libcxxabi\src/cxa_aux_runtime.cpp:14:
In file included from C:\Users\slimsag\Desktop\zig\zig-out\lib\zig\libcxx\include\typeinfo:75:
C:\Users\slimsag\Desktop\zig\zig-out\lib\zig\libc\include\any-windows-any\vcruntime_typeinfo.h:121:13: error: target of using declaration conflicts with declaration already in scope
C:\Users\slimsag\Desktop\zig\zig-out\lib\zig\libc\include\any-windows-any\vcruntime_typeinfo.h:69:7: note: target of using declaration
C:\Users\slimsag\Desktop\zig\zig-out\lib\zig\libcxxabi\include\cxxabi.h:30:27: note: conflicting declaration
error(compilation): clang failed with stderr: zig: warning: argument unused during compilation: '-nostdinc++' [-Wunused-command-line-argument]
zig: warning:
View widl_win32metadata_incompatible.md

WIDL compiler incompatibilities with Windows SDK

I attempted to compile the IDL files distributed in https://github.com/microsoft/win32metadata/tree/master/generation/WinSDK/RecompiledIdlHeaders using the latest (7.0.1-rc.1) version of the Wine IDL compiler, called WIDL. Unlike Microsoft's MIDL compiler which ships with Visual Studio, WIDL is open source.

More importantly, WIDL contains patches to generated header files that make e.g. COM calling conventions compatible with mingw-w64 and clang when targetting GNU ABI.

View gist:a55c0f6d715a8ab10e77b9b565e5ccc3
CREATE SCHEMA partman;
CREATE EXTENSION pg_partman SCHEMA partman;
CREATE ROLE partman WITH LOGIN;
GRANT ALL ON SCHEMA partman TO partman;
GRANT ALL ON ALL TABLES IN SCHEMA partman TO partman;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA partman TO partman;
GRANT EXECUTE ON ALL PROCEDURES IN SCHEMA partman TO partman; -- PG11+ only
GRANT ALL ON SCHEMA my_partition_schema TO partman;
GRANT TEMPORARY ON DATABASE sg to partman; -- allow creation of temp tables to move data out of default
View gist:826f2171c5d2296b7ecc3ef77ab84d1f
postgres=# SELECT sp.series_id, sp.time AS interval_time, SUM(value) as value, null as metadata
postgres-# FROM series_points sp JOIN repo_names rn ON sp.repo_name_id = rn.id
postgres-# WHERE series_id='s:7390958469D3357348D1873F0D7EE7D1130023CDE9AE614F6F945ACEBF4DD36D'
postgres-# GROUP BY sp.series_id, interval_time, sp.repo_name_id
postgres-# ORDER BY sp.series_id, interval_time, sp.repo_name_id DESC;
series_id | interval_time | value | metadata
--------------------------------------------------------------------+------------------------+-------+----------
s:7390958469D3357348D1873F0D7EE7D1130023CDE9AE614F6F945ACEBF4DD36D | 2020-09-01 00:00:00+00 | 0 |
s:7390958469D3357348D1873F0D7EE7D1130023CDE9AE614F6F945ACEBF4DD36D | 2020-09-01 00:00:00+00 | 0 |
s:7390958469D3357348D1873F0D7EE7D1130023CDE9AE614F6F945ACEBF4DD36D | 2020-09-01 00:00:00+00 | 0 |
View main.zig
const std = @import("std");
const builtin = @import("builtin");
const testing = std.testing;
const process = std.process;
const fs = std.fs;
const ChildProcess = std.ChildProcess;
var a: *std.mem.Allocator = undefined;
pub fn main() !void {
View gist:c28dd9b2aada8467ae1225b044043cfd
$ lldb -- /Users/slimsag/Desktop/hexops/zig/build/bin/zig build-exe /Users/slimsag/Desktop/hexops/zig/src/main.zig /Users/slimsag/Desktop/hexops/zig/build/zigcpp/libzigcpp.a /usr/local/opt/llvm/lib/libclangFrontendTool.a /usr/local/opt/llvm/lib/libclangCodeGen.a /usr/local/opt/llvm/lib/libclangFrontend.a /usr/local/opt/llvm/lib/libclangDriver.a /usr/local/opt/llvm/lib/libclangSerialization.a /usr/local/opt/llvm/lib/libclangSema.a /usr/local/opt/llvm/lib/libclangStaticAnalyzerFrontend.a /usr/local/opt/llvm/lib/libclangStaticAnalyzerCheckers.a /usr/local/opt/llvm/lib/libclangStaticAnalyzerCore.a /usr/local/opt/llvm/lib/libclangAnalysis.a /usr/local/opt/llvm/lib/libclangASTMatchers.a /usr/local/opt/llvm/lib/libclangAST.a /usr/local/opt/llvm/lib/libclangParse.a /usr/local/opt/llvm/lib/libclangSema.a /usr/local/opt/llvm/lib/libclangBasic.a /usr/local/opt/llvm/lib/libclangEdit.a /usr/local/opt/llvm/lib/libclangLex.a /usr/local/opt/llvm/lib/libclangARCMigrate.a /usr/local/opt/llvm/lib/libclangRewriteFrontend.a /usr/
View gist:9303f03066a5d3e841bfbe997cb520cf
$ zig build --prefix $(pwd)/stage2 -Denable-llvm --search-prefix "$(brew --prefix llvm)"
warning(link): library not found for '-lLLVMWindowsManifest'
warning(link): Library search paths:
warning(link): /usr/local/opt/llvm/lib
warning(link): /usr/local/opt/llvm/lib
warning(link): /usr/lib
warning(link): /usr/local/lib
warning(link): library not found for '-lLLVMXRay'
warning(link): Library search paths:
warning(link): /usr/local/opt/llvm/lib
View gist:b34a2733afba70360df1ed2ad225fec4
$ zig build --prefix $(pwd)/stage2 -Denable-llvm --search-prefix "$(brew --prefix llvm)"
warning(link): library not found for '-lLLVMWindowsManifest'
warning(link): Library search paths:
warning(link): /usr/local/opt/llvm/lib
warning(link): /usr/local/opt/llvm/lib
warning(link): /usr/lib
warning(link): /usr/local/lib
warning(link): library not found for '-lLLVMXRay'
warning(link): Library search paths:
warning(link): /usr/local/opt/llvm/lib
View gist:3f3b5e8b64674751ae02d98d68c87d64
/Users/slimsag/Desktop/hexops/zig/build/lib/zig/std/fmt.zig:606:17: error: Unable to format type 'anyframe'
else => @compileError("Unable to format type '" ++ @typeName(T) ++ "'"),
^
/Users/slimsag/Desktop/hexops/zig/build/lib/zig/std/fmt.zig:558:35: note: called from here
try formatType(elem, actual_fmt, options, writer, max_depth - 1);
^
/Users/slimsag/Desktop/hexops/zig/build/lib/zig/std/fmt.zig:511:31: note: called from here
try formatType(@field(value, f.name), ANY, options, writer, max_depth - 1);
^
/Users/slimsag/Desktop/hexops/zig/build/lib/zig/std/fmt.zig:511:31: note: called from here