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

Import upstream changes of TSC.Process #460

Merged
merged 1 commit into from
May 20, 2024

Conversation

omochi
Copy link
Contributor

@omochi omochi commented May 20, 2024

#458CartonHelpers.Process で実装しようとしたところ、
プロセスの ワーキングディレクトリを設定する機能が実装されていませんでした。
最新の TSC.Process であれば実装されていたので、
ソースコードをコピペして追従します。

ただ、新たに TSCLibcTSCclibc モジュールへの参照が追加されていたので、
これらの追加も追従します。
また、依存として TSC.Thread も必要になっていたので、これも移植します。

TSC.Process は以下のバージョンと一致させています。

https://github.com/apple/swift-tools-support-core/blob/990afca47e75cce136d2f59e464577e68a164035/Sources/TSCBasic/Process/Process.swift

このファイルのコミットヒストリーによればこれが最新です。

https://github.com/apple/swift-tools-support-core/commits/990afca47e75cce136d2f59e464577e68a164035/Sources/TSCBasic/Process/Process.swift


カレントディレクトリ設定が必要になるロジックはこの部分です。

process.currentDirectoryURL = packageDirectory

// to handle the case where the posix_spawn_file_actions_addchdir_np method is unavailable. This check only
// exists here to make the compiler happy.
if #available(macOS 10.15, *) {
posix_spawn_file_actions_addchdir_np(&fileActions, workingDirectory)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このあたりが追加実装されているワーキングディレクトリを設定するコードです。
Linux版の実装では TSCclibc の関数が使われています。

@kateinoigakukun kateinoigakukun changed the title TSC.Process を最新版に追従する Merge upstream changes of TSC.Process May 20, 2024
@kateinoigakukun kateinoigakukun changed the title Merge upstream changes of TSC.Process Import upstream changes of TSC.Process May 20, 2024
@kateinoigakukun kateinoigakukun merged commit 7613683 into swiftwasm:main May 20, 2024
4 checks passed
@omochi omochi deleted the update-tsc-process branch May 20, 2024 12:02
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

Successfully merging this pull request may close these issues.

2 participants