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

Windowsで動かなさそう #1

Closed
Narazaka opened this issue Jan 23, 2025 · 13 comments
Closed

Windowsで動かなさそう #1

Narazaka opened this issue Jan 23, 2025 · 13 comments

Comments

@Narazaka
Copy link

Windows環境のcodeで拡張機能が動かなさそうです。
WSL2上のcodeでは正常に動作します。

Windowsでcargo owlSTATUS_DLL_NOT_FOUNDを吐く故かと思われますが、定かではありません。

以下を試すと

git clone [email protected]:cordx56/rustowl.git
cd rustowl/rustowl
cargo install --path . --locked
cargo owl

STATUS_DLL_NOT_FOUNDとエラーが出ます。

error: process didn't exit successfully: `C:\Users\narazaka\.cargo\bin\rustowlc C:\Users\narazaka\.rustup\toolchains\nightly-2024-10-31-x86_64-pc-windows-msvc\bin\rustc.exe -vV` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)
null

これはビルドして直接exeを叩いたときのエラーと同様です。

git clone [email protected]:cordx56/rustowl.git
cd rustowl/rustowl
cargo build
.\target\debug\cargo-owl.exe
error: process didn't exit successfully: `D:\make\devel\rustowl\rustowl\target\debug\rustowlc C:\Users\narazaka\.rustup\toolchains\nightly-2024-10-31-x86_64-pc-windows-msvc\bin\rustc.exe -vV` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)
null

しかしcargo runすると動いているように見えます。

git clone [email protected]:cordx56/rustowl.git
cd rustowl/rustowl
cargo build
cargo run

Windows Sandboxでも試しましたが同様です。
WSL2ではどの事例でもエラーが出ず正常に実行されている(nullではないJSONが吐かれる)ように見えました。

@cordx56
Copy link
Owner

cordx56 commented Jan 23, 2025

.rustup/toolchains 以下のDLLを検索できていないようです。 rustowlc を当該DLLのあるディレクトリに移動したところ、実行はできました。
動的リンクライブラリの検索ディレクトリ設定はUnix系の cargo では行われますが、Windowsでは行われていないようです。
対策を考えています。

@cordx56
Copy link
Owner

cordx56 commented Feb 3, 2025

@wx257osn2 私Windowsに詳しくないのですが、この行の追加で実行がうまく行ったり行かなかったりするという状況です。
https://github.com/cordx56/rustowl/blob/main/rustowl/src/main.rs#L18

助言をいただけるとありがたいです。

@cordx56
Copy link
Owner

cordx56 commented Feb 4, 2025

@Narazaka @wx257osn2 https://github.com/cordx56/rustowl/tree/b190ebfc8289e025f62a898cb0d0a840238c0776 のコミットでWindowsをサポートしたと思います。(手元で複数のRustワークスペースでの動作を確認しました)
ご確認ください。もしこれで問題なさそうであれば、このIssueは閉じるので、反応をいただけると助かります。

@wx257osn2
Copy link
Contributor

@cordx56 現状だとstableターゲットのプロジェクトで動かないので,少し手直しをします.労働にかまけて何もできなくてすまんという気持ちです

@cordx56
Copy link
Owner

cordx56 commented Feb 4, 2025

@wx257osn2 おや、動かなかったですか?(手元だとStableに対しても動いていたので)
同じエラーですかね?

@wx257osn2
Copy link
Contributor

はい,同じエラー(DLLないよ)ですね(私はVSCode使ってないので cargo owl の動作確認を取っていて,コードを見る限り cargo owlsp は動くけど cargo owl は動かんみたいなことはあるかもしれない)

Image

@wx257osn2
Copy link
Contributor

@cordx56 #2 を直したので確認お願いします(たぶんstable環境でも cargo owl が通るようになったはず)

@cordx56
Copy link
Owner

cordx56 commented Feb 4, 2025

あー、cargo owlsp じゃないと動かないですね……( cargo owlsp から rustup run nightly… でnightlyのlibへのパスを環境変数にセットして cargo owl を起動 → cargo owlrustowlc のためにnightlyのlibへのパスを解決して cargo check を起動 → cargo check で呼び出される rustowlc にパスが渡る、という流れになってます)

@wx257osn2
Copy link
Contributor

あーなるほど そもそも cargo owl 単体での動作をサポートする気がないということであればそれはそれで全然選択としては良い気はしていて,あとは現行とりあえず LD_LIBRARY_PATH の中身を全部 ../bin として読んでいるのがセキュリティ的に問題ないか,ぐらいが懸念ですかね

@cordx56
Copy link
Owner

cordx56 commented Feb 4, 2025

うーむなるほど、確かにパス通る範囲が制御できないのは微妙そうですね。
PR確認しました、何ヶ所か気になる点があるので、確認して追って返信します。

@wx257osn2
Copy link
Contributor

🙇

@cordx56
Copy link
Owner

cordx56 commented Feb 5, 2025

#2 で動作を確認したので、closeします。
@Narazaka もしよければ動作確認してみてください。引き続き動かないようであれば、Reopenしてください。

@cordx56 cordx56 closed this as completed Feb 5, 2025
@Narazaka
Copy link
Author

Narazaka commented Feb 5, 2025

@cordx56 無事こちらのWindows環境でも動きました!対応ありがとうございました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants