레이블이 bat인 게시물을 표시합니다. 모든 게시물 표시
레이블이 bat인 게시물을 표시합니다. 모든 게시물 표시

rust unstable library error

# wsl 환경에서 cargo 로 bat 설치(빌드)시 
cargo install bat

# 다음과 같은 에러가 발생한다.
error[E0658]: use of unstable library feature 'is_terminal'
/home/ysoftman/.cargo/registry/src/github.com-1ecc6299db9ec823/grep-cli-0.1.8/src/lib.rs:238:23
std::io::stderr().is_terminal()

# rust 버전은 다음과 같다.
rustc --version
rustc 1.66.1 (90743e729 2023-01-10) (built from a source tarball)

# 메시지의 링크를 보면 이슈가 있다.

# unstable 상태가 에러가 아니라면 계속 진행하는 옵션을 줘도 실패한다.
cargo install -Z unstable-option --keep-going bat

# mac 에선 cargo 로 bat 설치시 똑같은 grep-cli v0.1.8 버전을 사용해 빌드하는데 잘된다.
# mac 에 설치된 grep-cli library 버전
cargo search grep-cli
grep-cli = "0.1.8"    # Utilities for search oriented command line applications.

# rustup 을 설치해서 rustc/cargo 버전을 올려보자.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# cargo 가 제대로 동작하지 않는다면 다음과 같이 삭제 후 재설치한다.
rustup uninstall stable && rustup install stable

# 최신 버전 확인
cargo --version
cargo 1.71.0 (cfd3bbd8f 2023-06-08)

# 이제 빌드 에러 없이 설치된다.
cargo install bat

rust cli tools


####

# rust 관련 유용한 사이트
https://rinthel.github.io/rust-lang-book-ko/ch00-00-introduction.html -->  한국어본 (최신판은 아니지만 한글이라 보기 편함)
https://play.rust-lang.org/  --> 테스트 해볼 수 있는 사이트
https://github.com/Dhghomon/easy_rust/  --> 러스트 강의 유튜버
https://www.youtube.com/watch?v=aW7wK4-2Dwc&list=PLdvEO-IMMcPvfiBkVwgIwDf4AuTjI2aeG  --> 간단하게 핵심만 보기(빠르게 파악 가능)
https://github.com/rust-unofficial/awesome-rust  --> 유명한 rust 코드/앱

스크립트로 매트릭스(Matrix) 화면 만들기

콘솔 창에서 매트릭스 화면을 위해 스크립트를 작성해 보자.

[윈도우 .bat]
@rem ysoftman
@rem cmd 창에서 매트릭스효과 내기

@echo off
color 0a
mode 1000

:matrix
echo %random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%%random%

goto matrix

[리눅스]
shell script

[맥]
http://www.asty.org/cmatrix/
brew install cmatrix

Prev