Skip to content

Instantly share code, notes, and snippets.

View toots's full-sized avatar

Romain Beauxis toots

View GitHub Profile
@toots
toots / dune
Created May 30, 2026 19:22
dune bug: enabled_if with %{read:...} not allowed in executable stanza even in dune 3.23
(executable
(name main)
(enabled_if (= %{read:./foo} true)))
@toots
toots / conf.ml
Created March 18, 2026 14:05
Dune dependency cycle bug: enabled_if with %{read:generated_file} triggers cycle when dune-project has a (package) stanza
let () = print_string "true"
commit 51c3524d20c35d6c99c50243326ae0123f7ed1e8
Author: Romain Beauxis <toots@rastageeks.org>
Date: Sun Apr 2 10:11:54 2023 -0500
Test.
diff --git a/Makefile.defs.in b/Makefile.defs.in
index b90215e5..5614bad0 100644
--- a/Makefile.defs.in
+++ b/Makefile.defs.in
@toots
toots / dune
Last active October 6, 2022 00:03
(lang dune 3.2)
(using dune_site 0.1)
(package
(name repro-main)
(depends
(ocaml (>= 4.12.0))
dune-site)
(sites (share libs))
(synopsis "Repro main"))
@toots
toots / dune
Last active June 2, 2022 05:41
dune site crash test
(generate_sites_module
(module sites)
(sites test-dune-site))
(executable
(name test_dune_site)
(public_name test_dune_site)
(libraries dune-site)
(modules sites test_dune_site))
interface SearchContextType {
show: boolean
setShow: (_: boolean) => void
query: string
setQuery: (_: string) => void
}
const SearchContext = createContext<SearchContextType>({} as SearchContextType)
export const SearchProvider = ({ children }: { children: React.ReactNode }) => {
interface SearchContextType {
show: boolean
setShow: (_: boolean) => void
query: string
setQuery: (_: string) => void
}
const SearchContext = createContext<SearchContextType>({} as SearchContextType)
export const SearchProvider = ({ children }: { children: React.ReactNode }) => {
@toots
toots / discover.ml
Last active November 24, 2021 21:25
Test dune configurator with cross-compilers.
module C = Configurator.V1
let () =
C.main ~name:"test-dune-configurator" (fun c ->
let has_alsa =
C.c_test c
{|
#include <alsa/asoundlib.h>
int main() {
snd_pcm_t *pcm_handle;
@toots
toots / dune
Created July 31, 2021 06:40
Dune private lib issue
(library
(name test_private_lib)
(public_name test_private_lib)
(modules public)
(libraries private))
(library
(name private)
(package test_private_lib)
(modules private))
(executable
(name test)
(modules test)
(optional)
(libraries foo))