Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
from requests import post
from flask import Flask, request
from threading import Thread
from os import urandom
from io import BytesIO
import time
SIZE = 3000 # Size in bytes
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/983jm469h6mdxczjbnmayqlx19xy72hb-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
{
"/nix/store/m22zx328ms9b4q4jwaz9r8y3sbspcqjz-qttranslations-5.15.10.drv": {
"args": [
"-e",
"/nix/store/6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh"
],
"builder": "/nix/store/m36d29gn5gm9bk0g7fcln1v8171hvn95-bash-5.2-p15/bin/bash",
"env": {
"__structuredAttrs": "",
"buildInputs": "",
❯ nix-shell shell.nix --show-trace
error:
… while calling the 'derivationStrict' builtin
at /builtin/derivation.nix:9:12: (source not available)
… while evaluating derivation 'interactive-python3-3.8.16-environment'
whose name attribute is located at /nix/store/qqvsfjj4ykzgc5245w297sm5g4z8fxsn-nixpkgs-src/pkgs/stdenv/generic/make-derivation.nix:303:7
… while evaluating attribute 'nativeBuildInputs' of derivation 'interactive-python3-3.8.16-environment'
@peacememories
peacememories / gist:e8ed47f5209742af40d7f15ec9584b30
Created August 25, 2023 01:31
nix log /nix/store/s4cgqgzjd289wfnmkfgcwb01vwx04w4r-llvm-x86_64-unknown-linux-gnu-16.0.6.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/5kj6rnkmm9rla05xq8p5a485473lja55-llvm-src-16.0.6
source root is llvm-src-16.0.6/llvm
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/cf81k34hxdj4hnwpmm7v9z8jpn9mj2h5-gnu-install-dirs.patch
patching file CMakeLists.txt
patching file cmake/modules/AddLLVM.cmake
patching file cmake/modules/AddOCaml.cmake
@peacememories
peacememories / gist:3e8bea634d1198fe200a35220c9feca2
Last active August 25, 2023 01:27
nix log /nix/store/6ays9r4ksmizyp99ahf2x0ssqi9rx326-llvm-x86_64-unknown-linux-gnu-16.0.6.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/5kj6rnkmm9rla05xq8p5a485473lja55-llvm-src-16.0.6
source root is llvm-src-16.0.6/llvm
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/cf81k34hxdj4hnwpmm7v9z8jpn9mj2h5-gnu-install-dirs.patch
patching file CMakeLists.txt
patching file cmake/modules/AddLLVM.cmake
patching file cmake/modules/AddOCaml.cmake
@peacememories
peacememories / gist:21883d99572b336df0f5e714256934ca
Created August 25, 2023 01:18
nix log /nix/store/i70cjlqbvz5dlns1q30rnhmasf3zk51b-llvm-x86_64-unknown-linux-gnu-15.0.7.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/19mvbns54i38pgfk8frxy3jafi2j7y3m-llvm-src-15.0.7
source root is llvm-src-15.0.7/llvm
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/sinjjzbn52f5665m1i2mvj239kp3anpk-gnu-install-dirs.patch
patching file CMakeLists.txt
Hunk #1 succeeded at 950 (offset 8 lines).
patching file cmake/modules/AddLLVM.cmake
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/b8j0a2h47cgrdm1i8dfl0qiag9afxqq7-rustc-1.69.0-src.tar.gz
source root is rustc-1.69.0-src
setting SOURCE_DATE_EPOCH to timestamp 1681687962 of file rustc-1.69.0-src/vendor/zip/tests/zip_crypto.rs
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
patching script interpreter paths in src/etc
src/etc/generate-keyword-tests.py: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/c2hpj07z6h30s0rvfzs5rgm8xqr5vqfp-python3-3.10.12/bin/python"
src/etc/pre-push.sh: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/7avcas47b0g25c9bk7m4xb7p5p636qs7-bash-5.2-p15/bin/bash"

I could not get cross compiling to work on macOS. See this issue

Attempts

With cargo2nix

{pkgs ? import <nixpkgs> {}}: let
  cargo2nix = builtins.getFlake "github:cargo2nix/cargo2nix/release-0.11.0";
  pkgsCross = import pkgs.path {
    crossSystem = {
 config = "x86_64-unknown-linux-musl";
@peacememories
peacememories / error.txt
Created August 17, 2023 05:04
Error Log from cross compiling rust package
these 14 derivations will be built:
/nix/store/c8csl1lii5ynj07c2wl9h06wwxi626rz-x86_64-unknown-linux-gnu-rustc-1.69.0.drv
/nix/store/kj0lamppn0c4zq660b4id2sxylal093a-cargo-1.69.0.drv
/nix/store/fy5fb3im9yv5xld2galk52wh7wsmcv6w-cargo-check-hook.sh.drv
/nix/store/qkibwr7sb07cc0yp9iri2d4392sms1wz-cargo-build-hook.sh.drv
/nix/store/gfljk06kcn6cxkbxjngbl3yvx9f6dylb-cargo-auditable-0.6.1.drv
/nix/store/n37hp4lmlnb3kzc6ycds13haq2gxwh4c-auditable-cargo-bootstrap-1.68.2.drv
/nix/store/wc392fgzmkfaaydqyv76nkdqa2bz4adj-cargo-1.69.0.drv
/nix/store/3vfills5hakvzi8lr2j2l75s09cav08y-cargo-check-hook.sh.drv
/nix/store/6jps87gi6rcp2r17z8zab9m429dqc3wb-cargo-build-hook.sh.drv