Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Ryu0118
Copy link
Collaborator

@Ryu0118 Ryu0118 commented Jul 22, 2025

I added an environment parameter to ProcessExecutor to support executing processes with custom environment variables.
This change enables use of ScipioKit in custom build pipelines that require specific environment configurations.

@Ryu0118 Ryu0118 requested a review from giginet July 22, 2025 10:06
Comment on lines +125 to +127
if let environment {
process.environment = environment
}
Copy link
Owner

Choose a reason for hiding this comment

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

[nits] It's enough to be

Suggested change
if let environment {
process.environment = environment
}
process.environment = environment

Copy link
Collaborator

@ikesyo ikesyo Aug 1, 2025

Choose a reason for hiding this comment

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

I don't think so. Setting the property explicitly to nil will not mean ineheriting the current process environment, rather it may clear out the environment. We should be careful about this behavior.

If this method isn’t used, the environment is inherited from the process that created the receiver.

Copy link
Collaborator

@ikesyo ikesyo Aug 1, 2025

Choose a reason for hiding this comment

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

I checked the implementation in swift-corelibs-foundation. If the property is nil ProcessInfo.processInfo.environment is used, so setting nil explicitly will be safe.

https://github.com/swiftlang/swift-corelibs-foundation/blob/d576c7596b718e1fc41e7902e4623c44eac31945/Sources/Foundation/Process.swift#L588-L593

However, I still prefer not to set the property if it's not needed.

@Ryu0118 Ryu0118 requested review from giginet and ikesyo August 1, 2025 07:10
@Ryu0118 Ryu0118 merged commit 07c313d into giginet:main Aug 4, 2025
2 checks passed
@Ryu0118 Ryu0118 deleted the support-environment branch August 4, 2025 06:12
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.

3 participants