Skip to content

Commit

Permalink
update from oil 0.19 to 0.20
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abathur committed Feb 28, 2024
1 parent e59c8c6 commit 0bb2ff3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 41 deletions.
48 changes: 12 additions & 36 deletions nixpkgs/oildev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
, makeWrapper
, # re2c deps
autoreconfHook
, # py-yajl deps
git
, # oil deps
file
, pkgsBuildBuild
Expand All @@ -32,39 +30,21 @@ 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).
This creates one without disturbing upstream too much.
*/
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
Expand All @@ -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 = [
Expand All @@ -105,7 +86,7 @@ rec {

nativeBuildInputs = [ re2c file makeWrapper ];

propagatedBuildInputs = [ six typing py-yajl ];
propagatedBuildInputs = [ six typing ];

doCheck = true;

Expand All @@ -115,15 +96,9 @@ rec {

postPatch = ''
patchShebangs asdl build core doctools frontend pyext oil_lang
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?
Expand All @@ -138,6 +113,7 @@ rec {
"oil._devbuild"
"oil._devbuild.gen.id_kind_asdl"
"oil._devbuild.gen.syntax_asdl"
"oil.osh"
"oil.tools.ysh_ify"
];

Expand Down
10 changes: 5 additions & 5 deletions tests/behavior.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
})
} <<CASES
resholve --interpreter $INTERP eval_quoted.sh
Expand Down Expand Up @@ -248,8 +248,8 @@ builtin_overridden="FEEDBACK WANTED: Essential builtin overridden by"
@test "verify warnings are thrown for overridden builtins" {
require <({
status 0
line 3 contains "builtin_overridden.sh':6: $builtin_overridden alias"
line 7 contains "builtin_overridden.sh':7: $builtin_overridden function"
line 3 contains "builtin_overridden.sh:6: $builtin_overridden alias"
line 7 contains "builtin_overridden.sh:7: $builtin_overridden function"
})
} <<CASES
resholve --interpreter $INTERP builtin_overridden.sh
Expand Down

0 comments on commit 0bb2ff3

Please sign in to comment.