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 7, 2024
1 parent 78dcef8 commit 35f1ac7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ jobs:
run: nix-shell --run ./demo
- name: validate new CLI demo
run: nix develop --command ./demo
cross-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
# DOING: figure out how to run the equivalent of this with the development resholve we're using here
- run: nix flake check
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@
${pkgs.ansifilter}/bin/ansifilter -o $out/nix-demo.txt --text nix-demo.ansi
'';
};
checks = pkgs.callPackages nixpkgs/test.nix {
inherit (pkgs) resholve;
rSrc = pkgs.lib.cleanSource self;
# checks = pkgs.callPackages nixpkgs/test.nix {
# inherit (pkgs) resholve;
# rSrc = pkgs.lib.cleanSource self;
# };
checks = pkgs.pkgsCross.armv7l-hf-multiplatform.callPackages nixpkgs/test.nix {
inherit (pkgs.pkgsCross.armv7l-hf-multiplatform) resholve;
rSrc = pkgs.pkgsCross.armv7l-hf-multiplatform.lib.cleanSource self;
};
devShells = let
resolveTimeDeps = [ pkgs.bash pkgs.coreutils pkgs.file pkgs.findutils pkgs.gettext ];
Expand Down
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 35f1ac7

Please sign in to comment.