Skip to content

Instantly share code, notes, and snippets.

View robbertvanginkel's full-sized avatar

Robbert van Ginkel robbertvanginkel

View GitHub Profile
@robbertvanginkel
robbertvanginkel / quickjs-wasi.patch
Created January 4, 2023 16:41
quickjs wasi wazero
From 58e4fc1373b6ee5d3810b7e4668762de87731b2f Mon Sep 17 00:00:00 2001
From: Robbert van Ginkel <rvanginkel@buf.build>
Date: Wed, 4 Jan 2023 11:05:15 -0500
Subject: [PATCH] Add wazero based build script
To build the quickjs interpreter, some js files need to be transformed into
quickjs bytecode using qjsc.
---
build.sh | 36 ++++++++++++++++++++++++++++++++++++
qjs.c | 4 ++--
package main
// typedef int (*intFunc) ();
//
// int
// bridge_int_func(intFunc f)
// {
// return f();
// }
//
@robbertvanginkel
robbertvanginkel / BUILD.bazel
Last active June 19, 2019 20:37
rules_go caching and stamping
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
go_binary(
name = "go",
srcs = ["main.go"],
x_defs = {"main.buildtime" : "{BUILD_TIMESTAMP}"}
)
cc_library(
name = "stamp",
linkstamp = "stamp.cc",
@robbertvanginkel
robbertvanginkel / BUILD.bazel
Last active May 24, 2019 23:10
rules_go stamping issue
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "github.com/example/project",
visibility = ["//visibility:private"],
x_defs = {
"github.com/example/project.simple": "{BUILD_USER}",
"github.com/example/project.compound": "{BUILD_USER}@{BUILD_HOST}",