@@ -651,17 +651,6 @@ jobs:
651
651
*-pc-windows-msvc) STRIP="" ;;
652
652
esac;
653
653
outputs STRIP
654
- - name : Install/setup prerequisites
655
- shell : bash
656
- run : |
657
- ## Install/setup prerequisites
658
- case '${{ matrix.job.target }}' in
659
- arm-unknown-linux-gnueabihf) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
660
- aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
661
- esac
662
- case '${{ matrix.job.os }}' in
663
- macos-latest) brew install coreutils ;; # needed for testing
664
- esac
665
654
- name : Create all needed build/work directories
666
655
shell : bash
667
656
run : |
@@ -680,6 +669,21 @@ jobs:
680
669
case '${{ matrix.job.os }}' in
681
670
macos-latest) brew install coreutils ;; # needed for testing
682
671
esac
672
+ case '${{ matrix.job.os }}' in
673
+ ubuntu-*)
674
+ # pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
675
+ # In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands. The account also has empty gecos fields.
676
+ # To work around this for pinky tests, we create a fake login entry for the GH runner account...
677
+ FAKE_UTMP='[7] [999999] [tty2] [runner] [tty2] [] [0.0.0.0] [2022-02-22T22:22:22,222222+00:00]'
678
+ # ... by dumping the login records, adding our fake line, then reverse dumping ...
679
+ (utmpdump /var/run/utmp ; echo $FAKE_UTMP) | sudo utmpdump -r -o /var/run/utmp
680
+ # ... and add a full name to each account with a gecos field but no full name.
681
+ sudo sed -i 's/:,/:runner name,/' /etc/passwd
682
+ # We also create a couple optional files pinky looks for
683
+ touch /home/runner/.project
684
+ echo "foo" > /home/runner/.plan
685
+ ;;
686
+ esac
683
687
- name : rust toolchain ~ install
684
688
uses : actions-rs/toolchain@v1
685
689
with :
@@ -949,6 +953,21 @@ jobs:
949
953
case '${{ matrix.job.os }}' in
950
954
macos-latest) brew install coreutils ;; # needed for testing
951
955
esac
956
+ case '${{ matrix.job.os }}' in
957
+ ubuntu-latest)
958
+ # pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
959
+ # In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands. The account also has empty gecos fields.
960
+ # To work around this for pinky tests, we create a fake login entry for the GH runner account...
961
+ FAKE_UTMP='[7] [999999] [tty2] [runner] [tty2] [] [0.0.0.0] [2022-02-22T22:22:22,222222+00:00]'
962
+ # ... by dumping the login records, adding our fake line, then reverse dumping ...
963
+ (utmpdump /var/run/utmp ; echo $FAKE_UTMP) | sudo utmpdump -r -o /var/run/utmp
964
+ # ... and add a full name to each account with a gecos field but no full name.
965
+ sudo sed -i 's/:,/:runner name,/' /etc/passwd
966
+ # We also create a couple optional files pinky looks for
967
+ touch /home/runner/.project
968
+ echo "foo" > /home/runner/.plan
969
+ ;;
970
+ esac
952
971
- name : rust toolchain ~ install
953
972
uses : actions-rs/toolchain@v1
954
973
with :
0 commit comments