on a01bbc8 help sign in
12 files changed+30−134
since splitsnapshots
unifiedsplit
README.md+1−17 build-prybar.nix+5−4 flake.lock+8−8 flake.nix+8−71 languages/julia/main.go+1−1 languages/python310/.gitignore−3 languages/python310/compile−9 run_tests+2−3 run_tests_language+3−2 scripts/docker-install.sh−14 tests/nodejs/err.exp+1−1 tests/nodejs/prompt_no_tty.exp+1−1
README.md+1−17
@@ -50,35 +50,19 @@ written in the host language which starts a Prybar-compatible REPL.
5050| SQLite | ✔ | ✔ | ✔ | ✔ | ✗ | ✔ |
5151| Tcl | ✔ | ✔ | ✔ | ✗ | ✗ | - |
5252
53−## Start to Develop with Nix
54−
55−To get started developing Prybar, you can use the nix shell. Enter
56−
57−```
58−nix develop
59−```
60−
61−to drop into a shell that has all dependencies installed an ready to go.
62−
63−If you don't have nix yet, install that: https://nixos.org/
64−
6553## Build and run
6654
6755 % make help
6856 usage:
6957 make all Build all Prybar binaries
7058 make prybar-LANG Build the Prybar binary for LANG
71− make docker Run a shell with Prybar inside Docker
72− (don't do this in the nix shell, although this is
73− not needed if you use nix)
59+ make docker Run a shell with Prybar inside Docker
7460 make image Build a Docker image with Prybar for distribution
7561 make test Run integration tests
7662 make test-image Test Docker image for distribution
7763 make clean Remove build artifacts
7864 make help Show this message
7965
80−## You can also use Docker
81−
8266Prybar uses Docker to make it easy to get started with development.
8367First, you must [install Docker](https://docs.docker.com/install/).
8468Then, run:
build-prybar.nix+5−4
@@ -1,10 +1,10 @@
11{ language, buildInputs ? [ ], binaries ? [ ], setFlags ? false
22, pkgName ? language }:
33
4−{ lib, buildGoModule, fetchFromGitHub, bash, expect, pkg-config, runCommand, git
4+{ lib, buildGo117Module, fetchFromGitHub, bash, expect, pkg-config, runCommand, git
55, python3, copyPathToStore, rev, makeWrapper }:
66
7−buildGoModule {
7+buildGo117Module {
88 pname = "prybar-${language}";
99 version = rev;
1010
@@ -54,9 +54,10 @@ buildGoModule {
5454 # is running in.
5555 export HOME=$(echo pwd)
5656
57− # Currently the go tests won't work in nix because of something w/ nix's sandboxing.
57+ patchShebangs run_no_pty ./tests/${language}/*.exp
5858
59− DISABLE_GO_TESTS=1 "${bash}/bin/bash" "./run_tests_language" "${language}"
59+ # Currently the go tests won't work in nix because of something w/ nix's sandboxing.
60+ DISABLE_GO_TESTS=1 "${bash}/bin/bash" "./run_tests_language" "${language}" "${expect}/bin"
6061
6162 runHook postCheck
6263 '';
flake.lock+8−8
@@ -2,11 +2,11 @@
22 "nodes": {
33 "flake-utils": {
44 "locked": {
5− "lastModified": 1667395993,
6− "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
5+ "lastModified": 1623875721,
6+ "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
77 "owner": "numtide",
88 "repo": "flake-utils",
9− "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
9+ "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
1010 "type": "github"
1111 },
1212 "original": {
@@ -17,16 +17,16 @@
1717 },
1818 "nixpkgs": {
1919 "locked": {
20− "lastModified": 1670276674,
21− "narHash": "sha256-FqZ7b2RpoHQ/jlG6JPcCNmG/DoUPCIvyaropUDFhF3Q=",
22− "owner": "NixOS",
20+ "lastModified": 1642492175,
21+ "narHash": "sha256-lo5hxiY8U4eREChAR7JD94zns92hQqmp3wg3qTFolPA=",
22+ "owner": "nixos",
2323 "repo": "nixpkgs",
24− "rev": "52e3e80afff4b16ccb7c52e9f0f5220552f03d04",
24+ "rev": "9789ed45b759c8f770bcba4b06c1a1c5ec386664",
2525 "type": "github"
2626 },
2727 "original": {
2828 "owner": "nixos",
29− "ref": "nixos-22.11",
29+ "ref": "nixpkgs-unstable",
3030 "repo": "nixpkgs",
3131 "type": "github"
3232 }
flake.nix+8−71
@@ -2,21 +2,11 @@
22 description = "A universal interpreter front-end";
33
44 inputs = {
5− nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
5+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
66 flake-utils.url = "github:numtide/flake-utils";
77 };
88
99 outputs = { self, nixpkgs, flake-utils }:
10− {
11− overlays.default = final: prev: {
12− prybar = prev.lib.recurseIntoAttrs {
13− inherit (self.packages.${prev.system})
14− prybar-R prybar-clojure prybar-elisp prybar-julia prybar-lua prybar-nodejs
15− prybar-ocaml prybar-python2 prybar-python3 prybar-python310 prybar-ruby
16− prybar-scala prybar-sqlite prybar-tcl;
17− };
18− };
19− } //
2010 flake-utils.lib.eachDefaultSystem (system:
2111 let
2212 pkgs = nixpkgs.legacyPackages.${system};
@@ -33,19 +23,6 @@
3323
3424 clojureWithCP =
3525 import ./languages/clojure/wrappedClojure.nix { inherit pkgs; };
36−
37− python310Full = pkgs.python310.override {
38− self = python310Full;
39− pythonAttr = "python310Full";
40− bluezSupport = true;
41− x11Support = true;
42− };
43−
44− ocaml = pkgs.ocaml-ng.ocamlPackages_4_12.ocaml;
45− opam = pkgs.opam;
46− findlib = pkgs.ocaml-ng.ocamlPackages_4_12.findlib;
47− topkg = pkgs.ocaml-ng.ocamlPackages_4_12.topkg;
48− reason = pkgs.ocaml-ng.ocamlPackages_4_12.reason;
4926
5027 in {
5128 packages = {
@@ -58,7 +35,7 @@
5835
5936 prybar-nodejs = buildPrybar {
6037 language = "nodejs";
61− binaries = [ pkgs.nodejs-16_x ];
38+ binaries = [ pkgs.nodejs-12_x ];
6239 };
6340
6441 prybar-python2 = buildPrybar {
@@ -68,12 +45,7 @@
6845
6946 prybar-python3 = buildPrybar {
7047 language = "python3";
71− buildInputs = [ pkgs.libxcrypt pkgs.python38Full ];
72− };
73−
74− prybar-python310 = buildPrybar {
75− language = "python310";
76− buildInputs = [ pkgs.libxcrypt python310Full ];
48+ buildInputs = [ pkgs.python38Full ];
7749 };
7850
7951 prybar-lua = buildPrybar {
@@ -94,11 +66,11 @@
9466 # This has to be in the build inputs so it set-ups the library paths before the check phase
9567 # It will not be copied over to the final package.
9668 buildInputs = [
97− opam
98− ocaml
99− findlib
100− topkg
101− reason
69+ pkgs.opam
70+ pkgs.ocaml
71+ pkgs.ocamlPackages.findlib
72+ pkgs.ocamlPackages.topkg
73+ pkgs.ocamlPackages.reason
10274 ];
10375 };
10476
@@ -133,41 +105,6 @@
133105
134106 };
135107
136−
137− devShells.default = pkgs.mkShell {
138− nativeBuildInputs = [
139− pkgs.pkg-config
140− ];
141− buildInputs = [
142− pkgs.libxcrypt
143− pkgs.R
144− pkgs.nodejs-16_x
145− pkgs.python2
146− pkgs.python38Full
147− pkgs.python310Full
148− pkgs.lua5_1
149− pkgs.readline
150− clojureWithCP
151− pkgs.jdk11_headless
152− opam
153− ocaml
154− findlib
155− topkg
156− reason
157− julia
158− pkgs.zlib
159− pkgs.ruby
160− pkgs.sqlite
161− pkgs.tcl
162− pkgs.expect
163− ];
164− shellHook = ''
165− export CGO_LDFLAGS_ALLOW="-Wl,--compress-debug-sections=zlib"
166− export DISABLE_GO_TESTS=1
167− '';
168− };
169−
170−
171108 });
172109}
173110
languages/julia/main.go+1−1
@@ -3,7 +3,7 @@ package main
33// USING_CGO
44
55/*
6−#cgo pkg-config: julia
6+#cgo CFLAGS: -I/usr/include/julia
77#cgo LDFLAGS: -ljulia
88#include "pry.h"
99*/
languages/python310/.gitignoredeleted−3
@@ -1,3 +0,0 @@
1−main.go
2−pry_python3.c
3−pry_python3.h
languages/python310/compiledeleted−9
@@ -1,9 +0,0 @@
1−#!/usr/bin/env bash
2−
3−COMPILE_DIR="$(dirname "$0")"
4−
5−cp $COMPILE_DIR/../python3/* $COMPILE_DIR/
6−
7−sed -i "s/python-3.8-embed/python-3.10-embed/g" $COMPILE_DIR/main.go
8−
9−bash $COMPILE_DIR/../../scripts/inject.sh python310
run_tests+2−3
@@ -9,8 +9,7 @@ for t in ${tests}; do
99 if [[ $t != *.exp ]]; then
1010 echo "$t:"
1111
12− if [[ $t == 'nodejs' && $DISABLE_GO_TESTS != 1 ]]; then
13−
12+ if [[ $t == 'nodejs' ]]; then
1413 go test ./tests/nodejs
1514 fi
1615
@@ -21,7 +20,7 @@ for t in ${tests}; do
2120
2221 echo -n "... $name"
2322
24− test_out=$(timeout 15 expect "./tests/$t" 2>&1)
23+ test_out=$(timeout 15 "./tests/$t" 2>&1)
2524 if [[ $? != 0 ]]; then
2625 echo -e "\n========== \"$t\" failed =========="
2726 echo $test_out
run_tests_language+3−2
@@ -4,6 +4,7 @@ stty cols 80
44stty rows 20
55
66language=$1
7+expect_path=$2
78tests=$(find "./tests/${language}" ! -name '*.go' -printf '%P\n')
89
910for t in ${tests}; do
@@ -15,9 +16,9 @@ for t in ${tests}; do
1516 name=$(echo -n $t | sed -s 's/.*\/\(.*\).exp/\1/' | sed -s 's/_/ /g')
1617
1718 echo -n "... ${language} $name"
18−
1919
20− test_out=$(timeout 15 expect -f "./tests/${language}/$t" 2>&1)
20+ sed -i "s;#!/usr/bin/expect;#!${expect_path}/expect;" "./tests/${language}/$t"
21+ test_out=$(timeout 15 "./tests/${language}/$t" 2>&1)
2122 if [[ $? != 0 ]]; then
2223 echo -e "\n========== \"$t\" failed =========="
2324 echo "$test_out"
scripts/docker-install.sh−14
@@ -41,19 +41,13 @@ rlwrap
4141
4242"
4343
44−
4544export DEBIAN_FRONTEND=noninteractive
4645apt-get update
47−apt install software-properties-common -y
4846apt-get install -y curl
4947curl -sL https://deb.nodesource.com/setup_14.x | bash -
5048apt-get install -y $(grep -v "^#" <<< "$packages")
5149rm -rf /var/lib/apt/lists/*
5250
53−printf "\n" | add-apt-repository ppa:deadsnakes/ppa
54−apt install python3.10 -y
55−apt install python3.10-dev -y
56−
5751go_version=1.16.5
5852wget "https://dl.google.com/go/go${go_version}.linux-amd64.tar.gz"
5953tar -xvf "go${go_version}.linux-amd64.tar.gz"
@@ -76,14 +70,6 @@ cp -R julia-*/lib/* /usr/lib/
7670cp -R julia-*/share/* /usr/share/
7771rm -rf julia-*
7872
79−cat > /usr/lib/x86_64-linux-gnu/pkgconfig/julia.pc <<- EOM
80− Name: julia
81− Cflags: -I/usr/include/julia
82− Version: 1.5.4
83− Description: it's julia
84− Libs: -L/usr/lib -ljulia
85−EOM
86−
8773wget -nv https://downloads.lightbend.com/scala/2.13.1/scala-2.13.1.tgz
8874tar -xf *.tgz
8975cp -R scala-*/bin/* /usr/local/bin/
tests/nodejs/err.exp+1−1
@@ -5,6 +5,6 @@ spawn ./prybar-nodejs -i -q
55match_max 100000
66expect -exact "\[1G\[0J--> \[5G"
77send -- "x\r"
8−expect -e "ReferenceError: x is not defined"
8+expect -e "\[31mReferenceError: x is not defined\[0m\r"
99send -- ""
1010expect eof
tests/nodejs/prompt_no_tty.exp+1−1
@@ -1,7 +1,7 @@
11#!/usr/bin/expect -f
22set timeout -1
33set stty_init raw
4−spawn bash ./run_no_pty ./prybar-nodejs -q -i
4+spawn ./run_no_pty ./prybar-nodejs -q -i
55match_max 100000
66expect -exact "--> "
77