From 05b25cef96136a3b88a97ae92812037c9ddfcea5 Mon Sep 17 00:00:00 2001 From: "Travis A. Everett" Date: Mon, 26 Feb 2024 15:32:53 -0700 Subject: [PATCH] update from oil 0.19 to 0.20 Main change here is replacing py-yajl with an internal extension called fastfunc. Also some small output shifts, and some general cleanup to roll more changes back into oildev patches. --- Makefile | 2 +- demos.md | 130 +++++++++++++++++++++---------------------- nixpkgs/README.md | 5 +- nixpkgs/oildev.nix | 48 ++++------------ tests/behavior.bats | 10 ++-- timings.md | 132 ++++++++++++++++++++++---------------------- 6 files changed, 152 insertions(+), 175 deletions(-) diff --git a/Makefile b/Makefile index c57cb39..6eeea29 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ result-ci: *.nix flake.lock nixpkgs/*.nix setup.cfg setup.py test.sh demo tests/ ci: result-ci clean: - rm nix-result-ci result-ci/* nixpkgs/README.md + rm -rf nix-result-ci result-ci nixpkgs/README.md result-ci/test.txt result-ci/demo.txt result-ci/nix-demo.txt: result-ci diff --git a/demos.md b/demos.md index ba71efb..f16bcb8 100644 --- a/demos.md +++ b/demos.md @@ -36,7 +36,7 @@ $ demo ============================= resholve demo =================================== 1..15 ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < which_simple.sh (exit: 3) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < which_simple.sh (exit: 3) ] Original: >>> # no inputs provide which @@ -45,12 +45,12 @@ Original: Output: >>> which resholve >>> ^~~~~ ->>> [ stdinNone ]:3: Couldn't resolve command 'which' +>>> [ stdin ]:3: Couldn't resolve command 'which' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 1 'which' needs to be in RESHOLVE_PATH in 355ms +ok 1 'which' needs to be in RESHOLVE_PATH in 394ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < command_in_function.sh (exit: 3) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < command_in_function.sh (exit: 3) ] Original: >>> source file_simple.sh @@ -62,14 +62,14 @@ Original: Output: >>> command which "$@" >>> ^~~~~ ->>> [ stdinNone ]:5: Couldn't resolve command 'which' ->>> #!/nix/store/...-bash-5.2-p15/bin/bash +>>> [ stdin ]:5: Couldn't resolve command 'which' +>>> #!/nix/store/...-bash-5.2-p21/bin/bash >>> source /private/tmp/nix-build-resholve-test.drv-0/source/tests/file_simple.sh ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 2 Even in a function, 'which' needs to be in RESHOLVE_PATH in 366ms +ok 2 Even in a function, 'which' needs to be in RESHOLVE_PATH in 371ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < absolute_path.sh (exit: 5) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < absolute_path.sh (exit: 5) ] Original: >>> /usr/bin/which resholve @@ -77,14 +77,14 @@ Original: Output: >>> /usr/bin/which resholve >>> ^~~~~~~~~~~~~~ ->>> [ stdinNone ]:2: Unexpected absolute command path. +>>> [ stdin ]:2: Unexpected absolute command path. >>> >>> Next step: keep, fix, or pre-patch/substitute it. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 3 Absolute executable paths need exemptions in 366ms +ok 3 Absolute executable paths need exemptions in 374ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < absolute_path_nested.sh (exit: 5) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < absolute_path_nested.sh (exit: 5) ] Original: >>> find . -name resholve -exec /usr/bin/file {} + @@ -92,16 +92,16 @@ Original: Output: >>> find . -name resholve -exec /usr/bin/file {} + >>> ^~~~~~~~~~~~~ ->>> [ stdinNone ]:2: Unexpected absolute command path. +>>> [ stdin ]:2: Unexpected absolute command path. >>> >>> Next step: keep, fix, or pre-patch/substitute it. ->>> #!/nix/store/...-bash-5.2-p15/bin/bash +>>> #!/nix/store/...-bash-5.2-p21/bin/bash >>> /nix/store/...-findutils-4.9.0/bin/find ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 4 Even nested-executable paths need exemptions in 367ms +ok 4 Even nested-executable paths need exemptions in 373ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < source_var_pwd.sh (exit: 6) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < source_var_pwd.sh (exit: 6) ] Original: >>> # fails because $PWD requires a dynamic parse @@ -114,18 +114,18 @@ Original: Output: >>> source $PWD/file_simple.sh >>> ^~~~ ->>> [ stdinNone ]:6: Can't resolve dynamic argument in 'source' +>>> [ stdin ]:6: Can't resolve dynamic argument in 'source' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 5 Source, among others, needs an exemption for arguments containing variables in 369ms +ok 5 Source, among others, needs an exemption for arguments containing variables in 376ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < file_simple.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < file_simple.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,3 +1,7 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> # resolves file from inputs >>> -file resholver >>> -"file" resholver @@ -136,16 +136,16 @@ Diff: >>> +# resholve: keep /nix/store/...-file-5.45/bin/file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 6 Resolves unqualified 'file' to absolute path from RESHOLVE_PATH in 368ms +ok 6 Resolves unqualified 'file' to absolute path from RESHOLVE_PATH in 374ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < file_in_function.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < file_in_function.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,5 +1,10 @@ >>> -source which_simple.sh ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> +source /private/tmp/nix-build-resholve-test.drv-0/source/tests/which_simple.sh >>> which() { >>> # resolves file here too @@ -158,9 +158,9 @@ Diff: >>> +# resholve: keep source:/private/tmp/nix-build-resholve-test.drv-0/source/tests/which_simple.sh ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 7 Even in a function, resolves unqualified 'file' to absolute path from RESHOLVE_PATH in 370ms +ok 7 Even in a function, resolves unqualified 'file' to absolute path from RESHOLVE_PATH in 382ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < file_home_source_pwd.sh (exit: 6) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < file_home_source_pwd.sh (exit: 6) ] Original: >>> # $HOME not blocking here; vars currently only checked in: @@ -172,18 +172,18 @@ Original: Output: >>> source $PWD/file_simple.sh >>> ^~~~ ->>> [ stdinNone ]:6: Can't resolve dynamic argument in 'source' +>>> [ stdin ]:6: Can't resolve dynamic argument in 'source' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 8 Only some commands ('source' but NOT 'file', here) are checked for variable arguments. in 361ms +ok 8 Only some commands ('source' but NOT 'file', here) are checked for variable arguments. in 378ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash --keep 'source:$PWD' < file_home_source_pwd.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash --keep 'source:$PWD' < file_home_source_pwd.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,5 +1,10 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> # $HOME not blocking here; vars currently only checked in: >>> # alias command eval exec source|. sudo env >>> -file $HOME/file_simple.sh @@ -196,15 +196,15 @@ Diff: >>> +# resholve: keep source:$PWD ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 9 Add an exemption with --keep : in 372ms +ok 9 Add an exemption with --keep : in 375ms ---[ RESHOLVE_KEEP='source:$PWD' resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < file_home_source_pwd.sh (exit: 0) ] +--[ RESHOLVE_KEEP='source:$PWD' resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < file_home_source_pwd.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,5 +1,10 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> # $HOME not blocking here; vars currently only checked in: >>> # alias command eval exec source|. sudo env >>> -file $HOME/file_simple.sh @@ -217,9 +217,9 @@ Diff: >>> +# resholve: keep source:$PWD ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 10 Add an exemption with RESHOLVE_ALLOW=source:$PWD in 373ms +ok 10 Add an exemption with RESHOLVE_ALLOW=source:$PWD in 387ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < source_missing_target.sh (exit: 4) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < source_missing_target.sh (exit: 4) ] Original: >>> # fails to resolve this (from inputs, or relative to directory) @@ -228,18 +228,18 @@ Original: Output: >>> source doesnt_exist.sh >>> ^~~~~~~~~~~~~~~ ->>> [ stdinNone ]:3: Unable to resolve source target 'doesnt_exist.sh' to a known file +>>> [ stdin ]:3: Unable to resolve source target 'doesnt_exist.sh' to a known file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 11 'source' targets also need to be in RESHOLVE_PATH in 361ms +ok 11 'source' targets also need to be in RESHOLVE_PATH in 369ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < source_present_target.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < source_present_target.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,3 +1,7 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> # resolves gettext from inputs >>> -source gettext.sh >>> -. gettext.sh @@ -250,15 +250,15 @@ Diff: >>> +# resholve: keep source:/nix/store/...-gettext-0.21.1/bin/gettext.sh ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 12 Resolves unqualified 'source' to absolute path from RESHOLVE_PATH in 402ms +ok 12 Resolves unqualified 'source' to absolute path from RESHOLVE_PATH in 423ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash --fix aliases < alias_riddle.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash --fix aliases < alias_riddle.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,16 +1,22 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> # don't try to run me; I'll probably crash or hang or something >>> # I'm just a succinct test for complex resolution logic... >>> alias file="file -n" # the function @@ -286,15 +286,15 @@ Diff: >>> +# resholve: keep /nix/store/...-file-5.45/bin/file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 13 Has (naive) context-specific resolution rules in 456ms +ok 13 Has (naive) context-specific resolution rules in 460ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash < nested_execer.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash < nested_execer.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,27 +1,35 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> fargs(){ >>> - echo "nice $(type -ap file) you got there" >>> + echo "nice $(type -ap /nix/store/...-file-5.45/bin/file) you got there" @@ -320,13 +320,13 @@ Diff: >>> # semi-nonsense, but should resolve bash, gettext, file, bash, file >>> -bash \ >>> - -c "source gettext.sh" \ ->>> +/nix/store/...-bash-5.2-p15/bin/bash \ +>>> +/nix/store/...-bash-5.2-p21/bin/bash \ >>> + -c "source /nix/store/...-gettext-0.21.1/bin/gettext.sh" \ >>> "bop" \ >>> - -c "command file" \ >>> - -c "bash -c file" >>> + -c "command /nix/store/...-file-5.45/bin/file" \ ->>> + -c "/nix/store/...-bash-5.2-p15/bin/bash -c /nix/store/...-file-5.45/bin/file" +>>> + -c "/nix/store/...-bash-5.2-p21/bin/bash -c /nix/store/...-file-5.45/bin/file" >>> >>> -if type -p find; then >>> - type -p find @@ -339,22 +339,22 @@ Diff: >>> fi >>> + >>> +### resholve directives (auto-generated) ## format_version: 3 +>>> +# resholve: keep /nix/store/...-bash-5.2-p21/bin/bash >>> +# resholve: keep /nix/store/...-findutils-4.9.0/bin/find >>> +# resholve: keep /nix/store/...-findutils-4.9.0/bin/xargs ->>> +# resholve: keep /nix/store/...-bash-5.2-p15/bin/bash >>> +# resholve: keep /nix/store/...-file-5.45/bin/file >>> +# resholve: keep source:/nix/store/...-gettext-0.21.1/bin/gettext.sh ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 14 Has (rudimentary) support for resolving executable arguments in 520ms +ok 14 Has (rudimentary) support for resolving executable arguments in 543ms ---[ resholve --interpreter /nix/store/...-bash-5.2-p15/bin/bash --fix '$FILE_CMD:file' < file_var.sh (exit: 0) ] +--[ resholve --interpreter /nix/store/...-bash-5.2-p21/bin/bash --fix '$FILE_CMD:file' < file_var.sh (exit: 0) ] Diff: >>> --- original >>> +++ resolved >>> @@ -1,12 +1,17 @@ ->>> +#!/nix/store/...-bash-5.2-p15/bin/bash +>>> +#!/nix/store/...-bash-5.2-p21/bin/bash >>> FILE_CMD="$HOME/.local/bin/file" >>> >>> -$FILE_CMD resholver @@ -383,7 +383,7 @@ Diff: >>> +# resholve: keep /nix/store/...-file-5.45/bin/file ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -ok 15 Can substitute a variable used as a command in 460ms +ok 15 Can substitute a variable used as a command in 461ms ``` ## Nix demo @@ -423,20 +423,20 @@ nothing up my sleeve /nix/store/...-testmod3-unreleased/bin/conjure.sh: line 7: type: openssl: not found +++++ set +x test_openssl -+++++ /nix/store/...-openssl-3.0.10-bin/bin/openssl version -OpenSSL 3.0.10 1 Aug 2023 (Library: OpenSSL 3.0.10 1 Aug 2023) ++++++ /nix/store/...-openssl-3.0.12-bin/bin/openssl version +OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023) +++++ /nix/store/...-testmod2-unreleased/libexec/invokeme -OpenSSL 3.0.10 1 Aug 2023 (Library: OpenSSL 3.0.10 1 Aug 2023) +OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023) +++++ /nix/store/...-testmod2-unreleased/libexec/invokeme -OpenSSL 3.0.10 1 Aug 2023 (Library: OpenSSL 3.0.10 1 Aug 2023) +OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023) +++++ set +x test_libressl -+++++ /nix/store/...-jq-1.6-bin/bin/jq -n --arg greeting world '{"hello":$greeting}' ++++++ /nix/store/...-jq-1.7.1-bin/bin/jq -n --arg greeting world '{"hello":$greeting}' { "hello": "world" } -+++++ /nix/store/...-libressl-3.7.3-bin/bin/openssl version -LibreSSL 3.7.3 ++++++ /nix/store/...-libressl-3.8.2-bin/bin/openssl version +LibreSSL 3.8.2 +++++ set +x Ran 3 tests. @@ -445,7 +445,7 @@ OK ───────┬──────────────────────────────────────────────────────────────────────── │ File: /nix/store/...-testmod3-unreleased/bin/conjure.sh ───────┼──────────────────────────────────────────────────────────────────────── - 1 │ #!/nix/store/...-bash-5.2-p15/bin/bash + 1 │ #!/nix/store/...-bash-5.2-p21/bin/bash 2 │ test_future_perfection() { 3 │ echo "nothing up my sleeve" 4 │ @@ -478,18 +478,18 @@ OK ───────┼──────────────────────────────────────────────────────────────────────── 1 │ openssl_sh() { 2 │ set -x - 3 │ /nix/store/...-openssl-3.0.10-bin/bin/openssl version + 3 │ /nix/store/...-openssl-3.0.12-bin/bin/openssl version 4 │ /nix/store/...-testmod2-unreleased/libexec/invokeme 5 │ /nix/store/...-testmod2-unreleased/libexec/invokeme 6 │ set +x 7 │ } - 8 │ alias blah=/nix/store/...-openssl-3.0.10-bin/bin/openssl + 8 │ alias blah=/nix/store/...-openssl-3.0.12-bin/bin/openssl 9 │ 10 │ source /nix/store/...-shunit2-2.1.8/bin/shunit2 11 │ 12 │ ### resholve directives (auto-generated) ## format_version: 3 13 │ # resholve: fix aliases - 14 │ # resholve: keep /nix/store/...-openssl-3.0.10-bin/bin/openssl + 14 │ # resholve: keep /nix/store/...-openssl-3.0.12-bin/bin/openssl 15 │ # resholve: keep /nix/store/...-testmod2-unreleased/libexec/invokeme 16 │ # resholve: keep source:/nix/store/...-shunit2-2.1.8/bin/shunit2 17 │ @@ -501,8 +501,8 @@ OK 2 │ 3 │ libressl_sh() { 4 │ set -x - 5 │ /nix/store/...-jq-1.6-bin/bin/jq -n --arg greeting world '{"hello":$greeting}' - 6 │ /nix/store/...-libressl-3.7.3-bin/bin/openssl version + 5 │ /nix/store/...-jq-1.7.1-bin/bin/jq -n --arg greeting world '{"hello":$greeting}' + 6 │ /nix/store/...-libressl-3.8.2-bin/bin/openssl version 7 │ set +x 8 │ } 9 │ @@ -511,8 +511,8 @@ OK 12 │ source /nix/store/...-testmod2-unreleased/bin/openssl.sh 13 │ 14 │ ### resholve directives (auto-generated) ## format_version: 3 - 15 │ # resholve: keep /nix/store/...-jq-1.6-bin/bin/jq - 16 │ # resholve: keep /nix/store/...-libressl-3.7.3-bin/bin/openssl + 15 │ # resholve: keep /nix/store/...-libressl-3.8.2-bin/bin/openssl + 16 │ # resholve: keep /nix/store/...-jq-1.7.1-bin/bin/jq 17 │ # resholve: keep source:/nix/store/...-testmod2-unreleased/bin/openssl.sh 18 │ # resholve: keep source:/nix/store/...-testmod1-unreleased/submodule/helper.sh 19 │ diff --git a/nixpkgs/README.md b/nixpkgs/README.md index 439e4ea..6538b59 100644 --- a/nixpkgs/README.md +++ b/nixpkgs/README.md @@ -52,13 +52,13 @@ Here's a simple example of how `resholve.mkDerivation` is already used in nixpkg resholve.mkDerivation rec { pname = "dgoss"; - version = "0.4.1"; + version = "0.4.2"; src = fetchFromGitHub { owner = "goss-org"; repo = "goss"; rev = "refs/tags/v${version}"; - hash = "sha256-dpMTUBMEG5tDi7E6ZRg1KHqIj5qDlvwfwJEgq/5z7RE="; + hash = "sha256-FDn1OETkYIpMenk8QAAHvfNZcSzqGl5xrD0fAZPVmRM="; }; dontConfigure = true; @@ -87,6 +87,7 @@ resholve.mkDerivation rec { license = licenses.asl20; platforms = platforms.linux; maintainers = with maintainers; [ hyzual anthonyroussel ]; + mainProgram = "dgoss"; }; } ``` diff --git a/nixpkgs/oildev.nix b/nixpkgs/oildev.nix index e1152bd..53e5c64 100644 --- a/nixpkgs/oildev.nix +++ b/nixpkgs/oildev.nix @@ -6,8 +6,6 @@ , makeWrapper , # re2c deps autoreconfHook -, # py-yajl deps - git , # oil deps file , pkgsBuildBuild @@ -32,24 +30,6 @@ rec { ''; }; - py-yajl = python27.pkgs.buildPythonPackage rec { - pname = "oil-pyyajl-unstable"; - version = "2022-09-01"; - src = fetchFromGitHub { - owner = "oilshell"; - repo = "py-yajl"; - rev = "72686b0e2e9d13d3ce5fefe47ecd607c540c90a3"; - hash = "sha256-H3GKN0Pq1VFD5+SWxm8CXUVO7zAyj/ngKVmDaG/aRT4="; - fetchSubmodules = true; - }; - patches = [ - # Fixes several incompatible function pointer conversions, which are errors in clang 16. - ./0014-clang_incompatible_function_pointer_conversions.patch - ]; - # just for submodule IIRC - nativeBuildInputs = [ git ]; - }; - /* Upstream isn't interested in packaging this as a library (or accepting all of the patches we need to do so). @@ -57,14 +37,14 @@ rec { */ oildev = python27.pkgs.buildPythonPackage rec { pname = "oildev-unstable"; - version = "2021-07-14"; + version = "2024-02-26"; src = fetchFromGitHub { owner = "oilshell"; repo = "oil"; - # rev == present HEAD of release/0.19.0 - rev = "4d56470f97da2f55f33ad9e4d89d103c3b9436ee"; - hash = "sha256-TODO-via-fixup"; + # rev == present HEAD of release/0.20.0 + rev = "f730c79e2dcde4bc08e85a718951cfa42102bd01"; + hash = "sha256-HBj3Izh1gD63EzbgZ/9If5vihR5L2HhnyCyMah6rMg4="; /* It's not critical to drop most of these; the primary target is @@ -83,20 +63,21 @@ rec { patchSrc = fetchFromGitHub { owner = "abathur"; repo = "nix-py-dev-oil"; - rev = "v0.14.0.1"; - hash = "sha256-47+986+SohdtoNzTYAgF2vPPWgakyg0VCmR+MgxMzTk="; + rev = "v0.20.0.0"; + hash = "sha256-qoA54rnzAdnFZ3k4kRzQWEdgtEjraCT5+NFw8AWnRDk="; }; + patches = [ "${patchSrc}/0001-add_setup_py.patch" "${patchSrc}/0002-add_MANIFEST_in.patch" - "${patchSrc}/0004-disable-internal-py-yajl-for-nix-built.patch" + "${patchSrc}/0006-disable_failing_libc_tests.patch" "${patchSrc}/0007-namespace_via_init.patch" "${patchSrc}/0009-avoid_nix_arch64_darwin_toolchain_bug.patch" "${patchSrc}/0010-disable-line-input.patch" "${patchSrc}/0011-disable-fanos.patch" - # "${patchSrc}/0012-disable-doc-cmark.patch" - # DOING: this patch needs to get fixed, but for now I'm just adding a sub + "${patchSrc}/0012-disable-doc-cmark.patch" "${patchSrc}/0013-fix-pyverify.patch" + "${patchSrc}/0015-fix-compiled-extension-import-paths.patch" ]; configureFlags = [ @@ -105,7 +86,7 @@ rec { nativeBuildInputs = [ re2c file makeWrapper ]; - propagatedBuildInputs = [ six typing py-yajl ]; + propagatedBuildInputs = [ six typing ]; doCheck = true; @@ -115,15 +96,9 @@ rec { postPatch = '' patchShebangs asdl build core doctools frontend pyext oil_lang ysh - substituteInPlace pyext/fastlex.c --replace '_gen/frontend' '../_gen/frontend' - substituteInPlace core/main_loop.py --replace 'import fanos' '# import fanos' rm cpp/stdlib.h # keep modules from finding the wrong stdlib? # work around hard parse failure documented in oilshell/oil#1468 substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False' - # disable fragile libc tests - substituteInPlace build/py.sh \ - --replace "py-ext-test pyext/libc_test.py" "#py-ext-test pyext/libc_test.py" \ - --replace "build/doc.sh all-help" "#build/doc.sh all-help" ''; # See earlier note on glibcLocales TODO: verify needed? @@ -138,6 +113,7 @@ rec { "oil._devbuild" "oil._devbuild.gen.id_kind_asdl" "oil._devbuild.gen.syntax_asdl" + "oil.osh" "oil.tools.ysh_ify" ]; diff --git a/tests/behavior.bats b/tests/behavior.bats index 2ea3cc9..c548529 100644 --- a/tests/behavior.bats +++ b/tests/behavior.bats @@ -9,9 +9,9 @@ quoted_eval="FEEDBACK WANTED: Letting quoted 'eval' through" @test "verify warnings are thrown for quoted evals" { require <({ status 0 - line 3 contains "eval_quoted.sh':4: $quoted_eval" - line 7 contains "eval_quoted.sh':7: $quoted_eval" - line 11 contains "eval_quoted.sh':12: $quoted_eval" + line 3 contains "eval_quoted.sh:4: $quoted_eval" + line 7 contains "eval_quoted.sh:7: $quoted_eval" + line 11 contains "eval_quoted.sh:12: $quoted_eval" }) } <: in 340ms -ok 60 Add an exemption with RESHOLVE_ALLOW=source:$PWD in 345ms -ok 61 'source' targets also need to be in RESHOLVE_PATH in 340ms -ok 62 Resolves unqualified 'source' to absolute path from RESHOLVE_PATH in 397ms -ok 63 Has (naive) context-specific resolution rules in 440ms -ok 64 Has (rudimentary) support for resolving executable arguments in 530ms -ok 65 Can substitute a variable used as a command in 455ms -ok 66 modern resholve versions reject v1 files in 362ms -ok 67 exercise built-in syntax parsers in 805ms +ok 40 resholve fails when scripts have untriaged dynamic elements in 678ms +ok 41 resholve fails when 'keep' directives are misformatted in 996ms +ok 42 resholve fails when triage directive doesn't specify the right thing in 2329ms +ok 43 resholve succeeds when 1x 'keep' directives are correct in 1043ms +ok 44 resholve succeeds when 2x 'keep' directives are correct in 1726ms +ok 45 resholve accepts empty directives in 374ms +ok 46 don't resolve aliases without '--fix aliases' in 431ms +ok 47 inject before and after script in 693ms +ok 48 inject before/after in multiple scripts in 388ms +ok 49 fail with bad lore argument in 359ms +ok 50 accept good lore argument in 347ms +ok 51 'which' needs to be in RESHOLVE_PATH in 349ms +ok 52 Even in a function, 'which' needs to be in RESHOLVE_PATH in 355ms +ok 53 Absolute executable paths need exemptions in 349ms +ok 54 Even nested-executable paths need exemptions in 354ms +ok 55 Source, among others, needs an exemption for arguments containing variables in 355ms +ok 56 Resolves unqualified 'file' to absolute path from RESHOLVE_PATH in 361ms +ok 57 Even in a function, resolves unqualified 'file' to absolute path from RESHOLVE_PATH in 373ms +ok 58 Only some commands ('source' but NOT 'file', here) are checked for variable arguments. in 362ms +ok 59 Add an exemption with --keep : in 348ms +ok 60 Add an exemption with RESHOLVE_ALLOW=source:$PWD in 356ms +ok 61 'source' targets also need to be in RESHOLVE_PATH in 361ms +ok 62 Resolves unqualified 'source' to absolute path from RESHOLVE_PATH in 399ms +ok 63 Has (naive) context-specific resolution rules in 452ms +ok 64 Has (rudimentary) support for resolving executable arguments in 535ms +ok 65 Can substitute a variable used as a command in 435ms +ok 66 modern resholve versions reject v1 files in 373ms +ok 67 exercise built-in syntax parsers in 904ms ```