๋ฌธ์
์ ๋ cdylib
์ ํฌ๋ ์ดํธ ์ ํ์ด ํ์ํ Python๊ณผ ํจ๊ป ์๋ํด์ผ ํ๋ ์ฝ๋๋ฅผ ๊ฐ๋ฐ ์ค์
๋๋ค. tests
๋๋ ํ ๋ฆฌ๋ฅผ ์ฌ์ฉํ๋ผ๋ ๊ถ์ฅ ์ฌํญ์ ๋ฐ๋ฅผ ๋ ๋๋ ํ ๋ฆฌ ๋ด์ ์ฝ๋๊ฐ ํฌ๋ ์ดํธ๋ฅผ ์ฐพ์ง ๋ชปํ๊ณ ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ์ ํจ๊ป ์คํจํ๋ ๊ฒ์ผ๋ก ๋ํ๋ฌ์ต๋๋ค.
Compiling cargo_issue_6659 v0.1.0 (/home/cfkaran2/Desktop/cargo_issue_6659)
Running `rustc --edition=2018 --crate-name tester tests/tester.rs --color always --emit=dep-info,link -C debuginfo=2 --test -C metadata=0525a91fc572753f -C extra-filename=-0525a91fc572753f --out-dir /home/cfkaran2/Desktop/cargo_issue_6659/target/debug/deps -C incremental=/home/cfkaran2/Desktop/cargo_issue_6659/target/debug/incremental -L dependency=/home/cfkaran2/Desktop/cargo_issue_6659/target/debug/deps`
Running `rustc --edition=2018 --crate-name cargo_issue_6659 src/lib.rs --color always --emit=dep-info,link -C debuginfo=2 --test -C metadata=b9fa70b838dfddae -C extra-filename=-b9fa70b838dfddae --out-dir /home/cfkaran2/Desktop/cargo_issue_6659/target/debug/deps -C incremental=/home/cfkaran2/Desktop/cargo_issue_6659/target/debug/incremental -L dependency=/home/cfkaran2/Desktop/cargo_issue_6659/target/debug/deps`
error[E0463]: can't find crate for `rustc_issue_report_cdylib`
--> tests/tester.rs:1:1
|
1 | extern crate rustc_issue_report_cdylib;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: Could not compile `cargo_issue_6659`.
Caused by:
process didn't exit successfully: `rustc --edition=2018 --crate-name tester tests/tester.rs --color always --emit=dep-info,link -C debuginfo=2 --test -C metadata=0525a91fc572753f -C extra-filename=-0525a91fc572753f --out-dir /home/cfkaran2/Desktop/cargo_issue_6659/target/debug/deps -C incremental=/home/cfkaran2/Desktop/cargo_issue_6659/target/debug/incremental -L dependency=/home/cfkaran2/Desktop/cargo_issue_6659/target/debug/deps` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
๋จ๊ณ
README.md
์ ์ง์นจ์ ๋ฐ๋ฅด์ญ์์ค.๊ฐ๋ฅํ ํด๊ฒฐ์ฑ )
์๋ ค์ง ๋ฐ ์์.
๋ ธํธ
$ cargo -V -vvv
cargo 1.32.0 (8610973aa 2019-01-02)
release: 1.32.0
commit-hash: 8610973aaf48615ba7dc9a38a9a2795ba6f36a31
commit-date: 2019-01-02
$ rustc -Vv
rustc 1.32.0 (9fda7c223 2019-01-16)
binary: rustc
commit-hash: 9fda7c2237db910e41d6a712e9a2139b352e558b
commit-date: 2019-01-16
host: x86_64-unknown-linux-gnu
release: 1.32.0
LLVM version: 8.0
$ uname -a
Linux EMANE 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release --all
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
rlib
(๋๋ lib
)๋ฅผ crate-type
๋ชฉ๋ก์ ์ถ๊ฐํ๋ฉด ์๋ํฉ๋๋ค. ํ
์คํธ๋ cdylib์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค.
BTW, ๊ทํ์ ์์๋ ์คํ๊ฐ ์์ต๋๋ค. tests/tester.rs
์๋ extern crate cargo_issue_6659;
๊ฐ ์์ด์ผ ํฉ๋๋ค.
์ ์ฃ์กํฉ๋๋ค. ์ด์์ ๋์ผํ ์ด๋ฆ์ ๊ฐ์ง repo๋ฅผ ์์ฑํ๋ ์ฌ์ด์ ์นํจ & ์๊ทธ ๋ฌธ์ ๊ฐ ์๊ธฐ ๋๋ฌธ์ ๋๋๋ก ์ด๋ฆ์ ๋ณ๊ฒฝํ๋ ๊ฒ์ ์์ต๋๋ค. ์ด์ ์์ ๋์์ต๋๋ค.
rlib
๋๋ lib
๋ก ์ค์ ํ๋ ๊ฒ๊ณผ ๊ด๋ จํ์ฌ ๋ฌธ์ ๋ pyo3 ์ ์ฌ์ฉํ๊ณ ์๋ค๋ ๊ฒ์
๋๋ค. ์ด๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ ํ์ cdylib
์ค์ ํด์ผ ํ๋ฉฐ ๋ด ํตํฉ ํ
์คํธ ์์
์ ๋์๊ฒ ๋๋ผ์ด ์ผ์ด์์ต๋๋ค. ํ
์คํธ๊ฐ cdylib
์ ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ์ฐ๊ฒฐํ ์ ์๋ค๋ ๊ฒ์ด ์๋ ค์ง ๊ฒฝ์ฐ ์ด ์ฌ์ค์ ๋ฐ์ํ๊ธฐ ์ํด cargo
(๋๋ rustc
) ๋ฌธ์๋ฅผ ์
๋ฐ์ดํธํ ๊ฐ์น๊ฐ ์์ต๋๋ค. .
์, ํฌ๋ ์ดํธ ์ ํ์ ๋ํ ๋ฌธ์๋ ์ผ๋ฐ์ ์ผ๋ก ํ์คํ ๊ฐ์ ๋ ์ ์์ต๋๋ค.
๋ค๋ฅธ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ฉด ์ฌ๊ธฐ์ ๋ ๋ง์ ์๊ฒฌ์ ๋จ๊ฒจ์ฃผ์ธ์. ๊ทธ๋ ์ง ์์ผ๋ฉด ๋ฌธ์ ๋ฌธ์ ๋ก ์ด๊ฒ์ ์ด์ด ๋๊ฒ ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
rlib
(๋๋lib
)๋ฅผcrate-type
๋ชฉ๋ก์ ์ถ๊ฐํ๋ฉด ์๋ํฉ๋๋ค. ํ ์คํธ๋ cdylib์ ์ฐ๊ฒฐํ ์ ์์ต๋๋ค.BTW, ๊ทํ์ ์์๋ ์คํ๊ฐ ์์ต๋๋ค.
tests/tester.rs
์๋extern crate cargo_issue_6659;
๊ฐ ์์ด์ผ ํฉ๋๋ค.