Skip to content

Commit

Permalink
WIP fix cross
Browse files Browse the repository at this point in the history
  • Loading branch information
abathur committed Mar 6, 2024
1 parent 78dcef8 commit 444407c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
19 changes: 1 addition & 18 deletions nixpkgs/oildev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
, callPackage
, fetchFromGitHub
, makeWrapper
, # re2c deps
autoreconfHook
, re2c
, # oil deps
file
, pkgsBuildBuild
Expand All @@ -14,22 +13,6 @@
}:

rec {
re2c = stdenv.mkDerivation rec {
pname = "re2c";
version = "1.0.3";
sourceRoot = "${src.name}/re2c";
src = fetchFromGitHub {
owner = "skvadrik";
repo = "re2c";
rev = version;
sha256 = "0grx7nl9fwcn880v5ssjljhcb9c5p2a6xpwil7zxpmv0rwnr3yqi";
};
nativeBuildInputs = [ autoreconfHook ];
preCheck = ''
patchShebangs run_tests.sh
'';
};

/*
Upstream isn't interested in packaging this as a library
(or accepting all of the patches we need to do so).
Expand Down
5 changes: 5 additions & 0 deletions nixpkgs/resholve.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
, version
, oildev
, configargparse
, pkgsBuildBuild
, binlore
, resholve
, resholve-utils
Expand All @@ -24,6 +25,10 @@ python27.pkgs.buildPythonApplication {
configargparse
];

makeWrapperArgs = with pkgsBuildBuild; [
"--prefix PATH : ${lib.makeBinPath [ gnused gawk ]}"
];

postPatch = ''
for file in setup.cfg _resholve/version.py; do
substituteInPlace $file --subst-var-by version ${version}
Expand Down
4 changes: 3 additions & 1 deletion resholve
Original file line number Diff line number Diff line change
Expand Up @@ -3693,6 +3693,7 @@ class RecordCommandlike(object):
"Somehow I ended up trying to look for a sed `e` command in %r when sed isn't even present. Oops! Please report this @ https://github.com/abathur/resholve",
expr,
)
logger.debug("about to popen '%r' to check '%r'", sed, expr)
p = Popen(
[sed, "--sandbox", expr],
shell=False,
Expand All @@ -3701,8 +3702,9 @@ class RecordCommandlike(object):
stderr=PIPE,
close_fds=True,
)
logger.debug("successfully popened?")
stdout, stderr = p.communicate(input="something cute")
#
logger.debug("successfully communicated?")
if p.returncode == 1 and "commands disabled in sandbox mode" in stderr:
# gnused e/r/w command present
# ['sed', '', '-e', 'expression', '#1,', 'char', '1', '', 'e/r/w', 'commands', 'disabled', 'in', 'sandbox', 'mode', '']
Expand Down
1 change: 1 addition & 0 deletions tests/parse_sed.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
echo heh > infile
sed -e 's/e/a/' infile
echo bleh | sed 's/e/a/g'
echo blah | sed 's/.*:/,/;s/$/,/'
# throw away status because /mnt/etc
# won't be available for the test
sed -i "1p" /mnt/etc || true

0 comments on commit 444407c

Please sign in to comment.