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

scubainit: Use nightly flag -Zon-broken-pipe=inherit to fix SIGPIPE #253

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions run_full_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def test1():
f.write(in_data)

subprocess.check_call(["scuba", "/bin/sh", "-c", "cat file.in >> file.out"])
subprocess.check_call(["scuba", "/bin/sh", "-c", "yes '' | echo 'test'"])

with open("file.out", "rt") as f:
out_data = f.read()
Expand Down
5 changes: 3 additions & 2 deletions scubainit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ TARGET=x86_64-unknown-linux-musl

# Enable static linking
STATIC_RUSTFLAGS=-C relocation-model=static
NIGHTLY_RUSTFLAGS=-Zon-broken-pipe=inherit

export RUSTFLAGS

Expand All @@ -43,15 +44,15 @@ fmt:

.PHONY: scubainit-debug # always build
scubainit-debug: PROFILE=debug
scubainit-debug: RUSTFLAGS=$(STATIC_RUSTFLAGS)
scubainit-debug: RUSTFLAGS=$(STATIC_RUSTFLAGS) $(NIGHTLY_RUSTFLAGS)
scubainit-debug: setup
@/bin/echo -e "\nBuilding scubainit ($(PROFILE)) with RUSTFLAGS=\"$$RUSTFLAGS\""
cargo build --target $(TARGET)
cp target/x86_64-unknown-linux-musl/$(PROFILE)/scubainit $@

.PHONY: scubainit # always build
scubainit: PROFILE=release
scubainit: RUSTFLAGS=$(STATIC_RUSTFLAGS)
scubainit: RUSTFLAGS=$(STATIC_RUSTFLAGS) $(NIGHTLY_RUSTFLAGS)
scubainit: setup
@/bin/echo -e "\nBuilding scubainit ($(PROFILE)) with RUSTFLAGS=\"$$RUSTFLAGS\""
cargo build --target $(TARGET) --release
Expand Down
3 changes: 3 additions & 0 deletions scubainit/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "nightly-2024-05-07"
targets = ["x86_64-unknown-linux-musl"]