Skip to content

Allow providing custom --env variables to be used in the container#171

Merged
euanh merged 1 commit intoapple:mainfrom
Joannis:jo/propagate-custom-env
Feb 2, 2026
Merged

Allow providing custom --env variables to be used in the container#171
euanh merged 1 commit intoapple:mainfrom
Joannis:jo/propagate-custom-env

Conversation

@Joannis
Copy link
Contributor

@Joannis Joannis commented Jan 31, 2026

This is needed for swift-backtrace #154 . Following PR should be able to address that once we figure out https://forums.swift.org/t/where-to-source-swift-backtrace-binaries/84499

Motivation

#154 ability to see backtraces for swift binaries. But generally it's also useful to set environment variables in containers for certain use cases.

Modifications

Allow passing in --env, so you can direct SWIFT_BACKTRACE.

Result

Swift backtrace is possible on the end-user side. Example: wendylabsinc/wendy-agent#290

Test Plan

I did manual testing already in wendy-agent. You can trivially test this by passing --env and reading it out in a swift app with the following code:

import Foundation

print(ProcessInfo.processInfo.environment)

This is needed for swift-backtrace.

# Conflicts:
#	Sources/containertool/containertool.swift
@euanh euanh self-requested a review February 2, 2026 09:21
@euanh euanh added kind/enhancement New feature or request semver/minor Adds new public API. labels Feb 2, 2026
@euanh euanh merged commit 2af8579 into apple:main Feb 2, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

containertool should be able to set or override a container image's environment variables

2 participants