Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysdig: fix bash-completion location #105684

Merged
merged 1 commit into from Dec 3, 2020

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Dec 2, 2020

Motivation for this change

In order to support auto-loading, the bash-completion scripts should
live in $out/share/bash-completion.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

In order to support auto-loading, the bash-completion scripts should
live in $out/share/bash-completion.
@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 105684 run on x86_64-darwin 1

1 package marked as broken and skipped:
  • sysdig

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 105684 run on x86_64-linux 1

4 packages marked as broken and skipped:
  • linuxPackages_4_4.sysdig
  • linuxPackages_4_9.sysdig
  • linuxPackages_hardkernel_4_14.sysdig
  • linuxPackages_hardkernel_latest.sysdig
16 packages built:
  • linuxPackages-libre.sysdig
  • linuxPackages.sysdig (linuxPackages_5_4.sysdig)
  • linuxPackages_4_14.sysdig
  • linuxPackages_4_19.sysdig
  • linuxPackages_5_8.sysdig
  • linuxPackages_5_9.sysdig (linuxPackages_latest.sysdig)
  • linuxPackages_hardened.sysdig
  • linuxPackages_latest-libre.sysdig
  • linuxPackages_latest_hardened.sysdig
  • linuxPackages_latest_xen_dom0.sysdig
  • linuxPackages_latest_xen_dom0_hardened.sysdig
  • linuxPackages_testing_bcachefs.sysdig
  • linuxPackages_xen_dom0.sysdig
  • linuxPackages_xen_dom0_hardened.sysdig
  • linuxPackages_zen.sysdig
  • sysdig

''
# Fix the bash completion location
installShellCompletion --bash $out/etc/bash_completion.d/sysdig
rm $out/etc/bash_completion.d/sysdig
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use rm -rf here, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a check that exactly one file is removed (and some directories), which makes sense for something as generic as $out/etc

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was the purpose. If a new file gets added in future releases, we want to know about it.

make install_driver
kernel_dev=${kernel.dev}
kernel_dev=''${kernel_dev#/nix/store/}
kernel_dev=''${kernel_dev%%-linux*dev*}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it enough to ${kernel_dev%%-*}?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. This PR just indents that code so I think it's out of scope.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah indeed, I do not read the red lines attentively most of the time.

kernel_dev=''${kernel_dev#/nix/store/}
kernel_dev=''${kernel_dev%%-linux*dev*}
if test -f "$out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko"; then
sed -i "s#$kernel_dev#................................#g" $out/lib/modules/${kernel.modDirVersion}/extra/sysdig-probe.ko
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line of dots is intended to be actually equal to ${kernel_dev//?/.}, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@7c6f434c 7c6f434c merged commit 752ad7a into NixOS:master Dec 3, 2020
@zimbatm zimbatm deleted the sysdig-bash-completion branch December 3, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants