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

Feature/terminal simulation for windows #21

Closed
wants to merge 108 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
1b2dd29
config terminal simulation for specific stdios only
cre4ture Mar 24, 2024
a62669c
somewhat working
cre4ture Mar 27, 2024
c55123a
works stable with uutils sleep
cre4ture Mar 27, 2024
d83c8f9
move files
cre4ture Mar 27, 2024
7875ad3
works :-)
cre4ture Mar 29, 2024
647b7b8
re-enable and extent tests of stty
cre4ture Mar 29, 2024
f43163a
Merge remote-tracking branch 'origin/main' into feature/terminal_simu…
cre4ture Mar 30, 2024
c175be7
cleanups
cre4ture Mar 30, 2024
438836a
cargo fmt
cre4ture Mar 30, 2024
538e784
unix fixes
cre4ture Mar 30, 2024
dfb629b
feature: env argv0 overwrite (unix only)
cre4ture Mar 30, 2024
78b8f94
adapt to new conpty API
cre4ture Mar 31, 2024
85e156f
add usefull print_outputs helper function
cre4ture Mar 31, 2024
6bb3fdc
make unix green and add platform independent tests
cre4ture Mar 31, 2024
6608a0d
overrides_with("argv0")
cre4ture Mar 31, 2024
b26c94e
use conpty from personal branch as long as its not merged yet
cre4ture Mar 31, 2024
08ac736
fix tty tests for unix
cre4ture Mar 31, 2024
f14b396
cleanup
cre4ture Mar 31, 2024
355f87d
chore(deps): update nick-fields/retry action to v3
renovate[bot] Mar 31, 2024
1bb5111
Merge pull request #6168 from uutils/renovate/nick-fields-retry-3.x
cakebaker Apr 1, 2024
518bfc6
clear mixups with argv0
cre4ture Apr 1, 2024
5223847
Merge remote-tracking branch 'origin/main' into feature/terminal_simu…
cre4ture Apr 1, 2024
814d704
dos2unix
cre4ture Apr 1, 2024
4f352cb
Merge branch 'feature/env_argv0_overwrite_unix' into feature/terminal…
cre4ture Apr 1, 2024
0db8288
fi printing of original args
cre4ture Apr 1, 2024
5927966
activate line discipline output on all unix
cre4ture Apr 1, 2024
006b3e4
exclude check for iuclc on android
cre4ture Apr 1, 2024
208be2b
revert c_line OS selection change
cre4ture Apr 1, 2024
d851a38
fix tests
cre4ture Apr 2, 2024
e6b17c5
fix tests
cre4ture Apr 2, 2024
4a92d35
fix freebsd
cre4ture Apr 3, 2024
0f0b3d6
fix macos
cre4ture Apr 3, 2024
9110513
fix windows
cre4ture Apr 3, 2024
a510be6
fix macos build
cre4ture Apr 4, 2024
54afb77
remove dead code on windows
cre4ture Apr 4, 2024
868c0f4
fmt
cre4ture Apr 4, 2024
334b7c6
prevent interference console start in parallel threads
cre4ture Apr 6, 2024
eaf40c6
adapt END_OF_TRANSMISSION_SEQUENCE for windows to send ctrl+Z
cre4ture Apr 6, 2024
3f64ce1
fully works
cre4ture Apr 6, 2024
635e259
refactored - works on windows
cre4ture Apr 6, 2024
931bc9a
fmt + clippy
cre4ture Apr 6, 2024
3128093
make unix compile and tests green; cleanup+doc
cre4ture Apr 6, 2024
7a4b3a8
cspell
cre4ture Apr 6, 2024
08af6f5
doc
cre4ture Apr 6, 2024
1f058d7
cleanup dead code
cre4ture Apr 6, 2024
a27c2f0
cleanup
cre4ture Apr 6, 2024
b01f9f1
doc
cre4ture Apr 6, 2024
f206be2
Merge branch 'main' into feature/terminal_simulation_for_windows
cre4ture Apr 6, 2024
3ff3872
use windows crate instead of windows_sys
cre4ture Apr 6, 2024
c684346
Merge remote-tracking branch 'uutils/main' into feature/terminal_simu…
cre4ture Apr 7, 2024
b868c8d
taplo fmt (toml)
cre4ture Apr 7, 2024
6fe0308
configure echo mode via stty
cre4ture Apr 7, 2024
e61b2de
it works now also with nextest!! Huray!!
cre4ture Apr 7, 2024
a216341
cleanup
cre4ture Apr 7, 2024
e7e362d
documentation
cre4ture Apr 7, 2024
2523138
add getter for echo mode to stty
cre4ture Apr 7, 2024
50de0bc
ignore error of attaching to console of parent
cre4ture Apr 7, 2024
c8c8b96
fmt
cre4ture Apr 7, 2024
5de294c
taplo toml fmt
cre4ture Apr 7, 2024
2911a8a
clippy windows
cre4ture Apr 7, 2024
4cc8376
refactoring
cre4ture Apr 9, 2024
ae4f95f
seems to be stable
cre4ture Apr 9, 2024
2d25786
cleanup
cre4ture Apr 9, 2024
ac01968
fmt
cre4ture Apr 9, 2024
738d968
clippy
cre4ture Apr 9, 2024
820432c
cleanup
cre4ture Apr 10, 2024
3d35208
fix deny step
cre4ture Apr 10, 2024
99d2683
rework unix terminal simulation to use only one terminal and echo
cre4ture Apr 10, 2024
ac658fd
additional rework
cre4ture Apr 10, 2024
714051f
remote shell debugging
cre4ture Apr 11, 2024
bde32c6
windows: only disable echo when requested
cre4ture Apr 11, 2024
7e52270
replace inspect with if let Some()
cre4ture Apr 11, 2024
d356d7c
try if --no-capture and serial execution has same blocking issue on CI
cre4ture Apr 11, 2024
e1bbfe2
try again --no-capture; tmate for coverage
cre4ture Apr 11, 2024
287f55e
use latest conpty with reduced deps
cre4ture Apr 11, 2024
5655ce6
add logs
cre4ture Apr 12, 2024
6d5ef97
logging of commands
cre4ture Apr 12, 2024
6d2d4df
fix missing feature argument at two places
cre4ture Apr 12, 2024
78539e2
indent comments to avoid confusion of VSCode plugin
cre4ture Apr 12, 2024
6bab36d
enable remote console
cre4ture Apr 13, 2024
7b17614
replace conpty with portable pty
cre4ture Apr 13, 2024
7feb699
disable tmate
cre4ture Apr 13, 2024
ccd9981
remove dependencies as possible
cre4ture Apr 13, 2024
79c8812
crlf
cre4ture Apr 13, 2024
bdc8dbe
add stty to makefile of unix
cre4ture Apr 13, 2024
90917df
add tty and stty to common core
cre4ture Apr 13, 2024
d7b6b15
disable echo by default
cre4ture Apr 13, 2024
b28e083
fix macos and freebsd
cre4ture Apr 13, 2024
2232365
switch echo off for terminal_simulation(true)
cre4ture Apr 14, 2024
f08bdef
fix build of stty for redox os
cre4ture Apr 14, 2024
08f6601
fix echo test for macos and freebsd
cre4ture Apr 14, 2024
ad8be97
install tmate for MinRustV
cre4ture Apr 14, 2024
67961e1
consider disabled echo for default tests
cre4ture Apr 14, 2024
4ad03af
fix \x08 vs. \u{8}
cre4ture Apr 14, 2024
02c6413
disable tmate
cre4ture Apr 14, 2024
75f1194
cleanup and makefile fix
cre4ture Apr 14, 2024
d4f0049
fix makefile
cre4ture Apr 14, 2024
d2f4c2d
fix cspell
cre4ture Apr 14, 2024
73780fc
crln -> ln
cre4ture Apr 14, 2024
1cb3712
fmt
cre4ture Apr 14, 2024
800ea38
ensure u32 for pointer type
cre4ture Apr 14, 2024
51682f4
add tmake build step
cre4ture Apr 14, 2024
97b0ad5
re-order matrix values for better readability on build overview
cre4ture Apr 14, 2024
0b082d6
disable wrong check
cre4ture Apr 14, 2024
d048601
use own implementaion for conpty based on conpty but refactored
cre4ture Apr 16, 2024
a6be42c
tries to fix initial approach
cre4ture Apr 18, 2024
47c2bc3
use nightly features
cre4ture Apr 20, 2024
a95fe00
cleanup
cre4ture Apr 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 40 additions & 27 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CICD
# spell-checker:ignore (abbrev/names) CICD CodeCOV MacOS MinGW MSVC musl taiki
# spell-checker:ignore (env/flags) Awarnings Ccodegen Coverflow Cpanic Dwarnings RUSTDOCFLAGS RUSTFLAGS Zpanic CARGOFLAGS
# spell-checker:ignore (jargon) SHAs deps dequote softprops subshell toolchain fuzzers
# spell-checker:ignore (people) Peltoche rivy dtolnay
# spell-checker:ignore (people) Peltoche rivy dtolnay mxschmitt
# spell-checker:ignore (shell/tools) choco clippy dmake dpkg esac fakeroot fdesc fdescfs gmake grcov halium lcov libssl mkdir popd printf pushd rsync rustc rustfmt rustup shopt utmpdump xargs
# spell-checker:ignore (misc) aarch alnum armhf bindir busytest coreutils defconfig DESTDIR gecos gnueabihf issuecomment maint multisize nullglob onexitbegin onexitend pell runtest Swatinem tempfile testsuite toybox uutils

Expand Down Expand Up @@ -54,8 +54,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
## note: requires 'nightly' toolchain b/c `cargo-udeps` uses the `rustc` '-Z save-analysis' option
## * ... ref: <https://github.com/est31/cargo-udeps/issues/73>
## note: requires 'nightly' toolchain b/c `cargo-udeps` uses the `rustc` '-Z save-analysis' option
## * ... ref: <https://github.com/est31/cargo-udeps/issues/73>
- uses: taiki-e/install-action@cargo-udeps
- uses: Swatinem/rust-cache@v2
- name: Initialize workflow variables
Expand Down Expand Up @@ -98,11 +98,11 @@ jobs:
matrix:
job:
- { os: ubuntu-latest , features: feat_os_unix }
# for now, don't build it on mac & windows because the doc is only published from linux
# + it needs a bunch of duplication for build
# and I don't want to add a doc step in the regular build to avoid long builds
# - { os: macos-latest , features: feat_os_macos }
# - { os: windows-latest , features: feat_os_windows }
# for now, don't build it on mac & windows because the doc is only published from linux
# + it needs a bunch of duplication for build
# and I don't want to add a doc step in the regular build to avoid long builds
# - { os: macos-latest , features: feat_os_macos }
# - { os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -215,6 +215,12 @@ jobs:
env:
RUSTFLAGS: "-Awarnings"
RUST_BACKTRACE: "1"
- name: Setup tmate session
if: false
uses: mxschmitt/action-tmate@v3
env:
RUSTFLAGS: "-Awarnings"
RUST_BACKTRACE: "1"

deps:
name: Dependencies
Expand Down Expand Up @@ -308,8 +314,10 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Test
run: cargo nextest run --hide-progress-bar --profile ci ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
run: cargo nextest run --hide-progress-bar --profile ci --features ${{ matrix.job.features }}
env:
RUST_BACKTRACE: "1"

Expand All @@ -336,7 +344,7 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Test
run: cargo nextest run --hide-progress-bar --profile ci ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }}
run: cargo nextest run --hide-progress-bar --profile ci --features ${{ matrix.job.features }}
env:
RUST_BACKTRACE: "1"

Expand Down Expand Up @@ -466,21 +474,21 @@ jobs:
fail-fast: false
matrix:
job:
# - { os , target , cargo-options , features , use-cross , toolchain, skip-tests }
- { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf, features: feat_os_unix_gnueabihf, use-cross: use-cross, skip-tests: true }
- { os: ubuntu-latest , target: aarch64-unknown-linux-gnu , features: feat_os_unix_gnueabihf , use-cross: use-cross , skip-tests: true }
- { os: ubuntu-latest , target: aarch64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross , skip-tests: true }
# - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: feat_selinux , use-cross: use-cross }
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross }
- { os: ubuntu-latest , target: i686-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: feat_os_unix , use-cross: use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross }
- { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
- { os: macos-14 , target: aarch64-apple-darwin , features: feat_os_macos } # M1 CPU
- { os: macos-latest , target: x86_64-apple-darwin , features: feat_os_macos }
- { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows }
- { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows }
- { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }
# - { target , os , cargo-options , features , use-cross , toolchain, skip-tests }
- {target: arm-unknown-linux-gnueabihf , os: ubuntu-latest , features: feat_os_unix_gnueabihf, use-cross: use-cross, skip-tests: true }
- {target: aarch64-unknown-linux-gnu , os: ubuntu-latest , features: feat_os_unix_gnueabihf , use-cross: use-cross , skip-tests: true }
- {target: aarch64-unknown-linux-musl , os: ubuntu-latest , features: feat_os_unix_musl , use-cross: use-cross , skip-tests: true }
# - {target: x86_64-unknown-linux-gnu , os: ubuntu-latest , features: feat_selinux , use-cross: use-cross }
- {target: i686-unknown-linux-gnu , os: ubuntu-latest , features: feat_os_unix , use-cross: use-cross }
- {target: i686-unknown-linux-musl , os: ubuntu-latest , features: feat_os_unix_musl , use-cross: use-cross }
- {target: x86_64-unknown-linux-gnu , os: ubuntu-latest , features: feat_os_unix , use-cross: use-cross }
- {target: x86_64-unknown-linux-musl , os: ubuntu-latest , features: feat_os_unix_musl , use-cross: use-cross }
- {target: x86_64-unknown-redox , os: ubuntu-latest , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true }
- {target: aarch64-apple-darwin , os: macos-14 , features: feat_os_macos } # M1 CPU
- {target: x86_64-apple-darwin , os: macos-latest , features: feat_os_macos }
- {target: i686-pc-windows-msvc , os: windows-latest , features: feat_os_windows }
- {target: x86_64-pc-windows-gnu , os: windows-latest , features: feat_os_windows }
- {target: x86_64-pc-windows-msvc , os: windows-latest , features: feat_os_windows }
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -705,6 +713,9 @@ jobs:
${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
env:
RUST_BACKTRACE: "1"
- name: Setup tmate session
if: failure()
uses: mxschmitt/action-tmate@v3
- name: Archive executable artifacts
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -945,8 +956,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
# - name: Reattach HEAD ## may be needed for accurate code coverage info
# run: git checkout ${{ github.head_ref }}
# - name: Reattach HEAD ## may be needed for accurate code coverage info
# run: git checkout ${{ github.head_ref }}
- name: Initialize workflow variables
id: vars
shell: bash
Expand Down Expand Up @@ -1007,6 +1018,8 @@ jobs:
UTILITY_LIST="$(./util/show-utils.sh ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }})"
CARGO_UTILITY_LIST_OPTIONS="$(for u in ${UTILITY_LIST}; do echo -n "-puu_${u} "; done;)"
outputs CARGO_UTILITY_LIST_OPTIONS
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Test
run: cargo nextest run --profile ci --hide-progress-bar ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} -p uucore -p coreutils
env:
Expand Down
55 changes: 28 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ feat_common_core = [
"sort",
"split",
"sum",
"stty",
"tac",
"tail",
"tee",
Expand All @@ -118,6 +119,7 @@ feat_common_core = [
"truncate",
"tsort",
"touch",
"tty",
"unexpand",
"uniq",
"unlink",
Expand Down Expand Up @@ -156,6 +158,8 @@ feat_os_unix = [
# "feat_os_windows" == set of utilities which can be built/run on modern/usual windows platforms
feat_os_windows = [
"feat_Tier1", ## == "feat_os_windows_legacy" + "hostname"
"stty",
"tty",
]
## (secondary platforms) feature sets
# "feat_os_unix_gnueabihf" == set of utilities which can be built/run on the "arm-unknown-linux-gnueabihf" target (ARMv6 Linux [hardfloat])
Expand Down Expand Up @@ -330,7 +334,7 @@ unicode-width = "0.1.11"
utf-8 = "0.7.6"
walkdir = "2.5"
winapi-util = "0.1.6"
windows-sys = { version = "0.48.0", default-features = false }
windows-sys = { version = "0.48.0", default-features = false, features = ["Win32_Foundation", "Win32_Security", "Win32_System_Pipes"]}
xattr = "1.3.1"
zip = { version = "0.6.6", default-features = false, features = ["deflate"] }

Expand Down Expand Up @@ -501,6 +505,8 @@ rlimit = "0.10.1"
rand_pcg = "0.3"
xattr = { workspace = true }

[target.'cfg(windows)'.dev-dependencies]

[build-dependencies]
phf_codegen = { workspace = true }

Expand Down
4 changes: 4 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ PROGS := \
sleep \
sort \
split \
stty \
sum \
sync \
tac \
Expand Down Expand Up @@ -150,6 +151,7 @@ UNIX_PROGS := \
sleep \
stat \
stdbuf \
stty \
timeout \
touch \
tty \
Expand Down Expand Up @@ -227,6 +229,7 @@ TEST_PROGS := \
split \
stat \
stdbuf \
stty \
sum \
tac \
tail \
Expand All @@ -236,6 +239,7 @@ TEST_PROGS := \
true \
truncate \
tsort \
tty \
uname \
unexpand \
uniq \
Expand Down
Loading
Loading