Skip to content

Commit 60ee8da

Browse files
committed
sync
1 parent 7b3ecef commit 60ee8da

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

Linux/rbuilder.sh

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# bash <(curl -qfsSL 'https://github.com/pkgforge/devscripts/raw/refs/heads/main/Linux/rbuilder.sh')
23
# rbuilder - A minimal alternative to cross-rs/cross
34
# Usage: rbuilder [+toolchain] <cargo-subcommand> [options...]
45

@@ -599,7 +600,12 @@ elif [[ -n "\${CONTAINER_RUSTFLAGS}" ]]; then
599600
else
600601
echo "No custom RUSTFLAGS specified"
601602
fi
602-
603+
export CARGO_BUILD_JOBS="\$(nproc)"
604+
export CARGO_INCREMENTAL="1"
605+
export CARGO_NET_RETRY="10"
606+
export CARGO_NET_TIMEOUT="300"
607+
export RUST_BACKTRACE="0"
608+
export CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"
603609
echo "=== Container Setup Complete ==="
604610
echo "Running cargo command..."
605611
echo ""
@@ -743,10 +749,17 @@ run_container() {
743749
"--platform=${CONTAINER_PLATFORM}"
744750
"--workdir=${DEFAULT_WORKSPACE}"
745751
"--cpus=$(nproc)"
746-
"--memory=$(calculate_memory_limit)"
747-
"--shm-size=1g"
748-
"--ulimit=nofile=65536:65536"
749-
"--security-opt=seccomp=unconfined"
752+
"--dns=1.1.1.1"
753+
"--dns=8.8.8.8"
754+
"--ipc=host"
755+
"--log-driver=none"
756+
"--memory-swappiness=1"
757+
"--oom-kill-disable=true"
758+
"--security-opt=seccomp=unconfined"
759+
"--shm-size=2g"
760+
"--ulimit=memlock=-1:-1"
761+
"--ulimit=nofile=1048576:1048576"
762+
"--ulimit=nproc=32768:32768"
750763
)
751764

752765
# Add mount arguments

0 commit comments

Comments
 (0)