windows support - #3
Merged
Merged
Conversation
Oracleのシミュレータキットは実行ファイル名がOSごとに異なるため (Linux: jcsl / Windows: jcsw.exe、.so → legacy.dll・libssl-3.dll・libcrypto-3.dll)、 vendorアーカイブの選択・展開・実行の各段でOSを判定するようにした。 - prepare-java-card-tools: OSごとにvendorアーカイブと実行ファイル名を選択。 Windows版はzip、Linux版はtar.gzなので展開方法も切り替える。チェックサムは vendor/に存在するキットのみ検証するため、他OS向けキットは無くてもよい。 - Util: simulatorExecutableName() と simulatorRuntimeLibraryNames() を追加。 - JcreSimAdapter: 実行ファイルの探索パスとJAR同梱ランタイムの展開をOS対応。 - SimulatorProcess: 共有ライブラリの検索パスをWindowsではPATH(;区切り)に設定。 - extract_vendor.sh は両OSのキットに対応。Windows向けにextract_vendor.ps1を追加。 あわせて、Windowsで顕在化した既存の不具合を2件修正した。 1. SimulatorProcess がシミュレータプロセスを終了させない場合があった。 reset() でチャネルが無効化されたあとの再接続時に isSimulatorReachable() が trueになり、自分で起動したプロセスを外部管理と誤判定して所有権を放棄していた。 InstallPhase が必ずresetするため毎回発生する。Windowsでは実行中の.exeを 削除できないため、次のビルドが build/cinpo-cache の削除に失敗して落ちる。 2. JAR同梱シミュレータの展開が固定パスへの上書きコピーだった。Windowsでは 前回のjcsw.exeが掴まれているとAccessDeniedExceptionになる。展開済みで サイズが一致すれば再利用し、書き込めない場合はこのJVM専用の一時ディレクトリ にフォールバックする。
CinpoRunTaskのトークナイザがバックスラッシュを常にエスケープ文字として 扱っていたため、--profile=C:\Users\... のようなWindowsパスが C:Users... に潰れていた。警告なく別のパスになる。 エスケープが意味を持つ文字(バックスラッシュ、引用符、空白)の前に 限ってエスケープとして解釈するようにした。OS判定は入れず全環境で同じ規則。 既存の C:\\Users のような書き方は従来どおり単一のバックスラッシュになる。 scripts/bootstrap.ps1 を追加。bootstrap.shの4フェーズをそのまま移植し、 依存はgitのみ。sparse checkoutを core.autocrlf=false で行い、gradlewを git update-index --chmod=+x で実行可能にすることで、Windowsで生成した プロジェクトがLinuxでもそのまま動く。
verify-template.ymlをverify-linux/verify-windowsの2ジョブに分割し、 Windowsネイティブ環境での検証を追加した。matrix+if分岐ではなく ジョブを分けることで、各ジョブが条件分岐なしで一直線に読める。 workflow_callの契約(inputs/secrets)は変えていないので呼び出し側は無改修。 Windows側はextract_vendor.ps1 -> bootstrap.ps1 -> cinpoRun --test -> cinpoJar -> java -jar の順で、jcsw.exeの起動、PATHへのDLLパス注入、 PEバイナリへのキー注入、fat JARへのランタイム同梱までを実際に通す。 cinpoRunにはrunner.tempのバックスラッシュ絶対パスを--profileで渡し、 CinpoRunTaskのトークナイザの回帰も併せて検知する。 vendor.zipにjava_card_devkit_simulator-win-binを追加(既存2ファイルは 内容不変)。Windowsではjcslが無く、これが無いとWindowsジョブは vendor展開の時点で失敗する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.