Skip to content

Commit

Permalink
3.130.0 (#3027)
Browse files Browse the repository at this point in the history
* 3.130.0

* Fixed mirrord ext

* Fix on macos
  • Loading branch information
Razz4780 authored Jan 21, 2025
1 parent 63bd257 commit b99ea5f
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 58 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,40 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang

<!-- towncrier release notes start -->

## [3.130.0](https://github.com/metalbear-co/mirrord/tree/3.130.0) - 2025-01-21


### Added

- Added support for `rmdir`, `unlink` and `unlinkat`.
[#2221](https://github.com/metalbear-co/mirrord/issues/2221)


### Changed

- Updated `configuration.md` and improved `.feature.env.mapping` doc.


### Fixed

- Stopped mirrord entering a crash loop when trying to load into some processes
like VSCode's `watchdog.js` when the user config contained a call to
`get_env()`, which occurred due to missing env - the config is now only
rendered once and set into an env var.
[#2936](https://github.com/metalbear-co/mirrord/issues/2936)
- Fixed an issue where HTTP requests stolen with a filter would hang with a
single-threaded local HTTP server.
Improved handling of incoming connections on the local machine (e.g
introduces reuse of local HTTP connections).
[#3013](https://github.com/metalbear-co/mirrord/issues/3013)
- Moved to an older builder base image for aarch64 to support centos-7 libc.
[#3024](https://github.com/metalbear-co/mirrord/issues/3024)


### Internal

- Extended `mirrord-protocol` with info logs from the agent.

## [3.129.0](https://github.com/metalbear-co/mirrord/tree/3.129.0) - 2025-01-14


Expand Down
56 changes: 28 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resolver = "2"

# latest commits on rustls suppress certificate verification
[workspace.package]
version = "3.129.0"
version = "3.130.0"
edition = "2021"
license = "MIT"
readme = "README.md"
Expand Down
1 change: 0 additions & 1 deletion changelog.d/+added-log-leve.internal.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/+improve-env-config-docs.changed.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/2221.added.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/2936.fixed.md

This file was deleted.

2 changes: 0 additions & 2 deletions changelog.d/3013.fixed.md

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/3024.fixed.md

This file was deleted.

9 changes: 5 additions & 4 deletions mirrord/cli/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
use mirrord_analytics::{AnalyticsError, AnalyticsReporter, Reporter};
use mirrord_config::{
config::ConfigError, feature::env::mapper::EnvVarsRemapper,
internal_proxy::MIRRORD_INTPROXY_CONNECT_TCP_ENV, LayerConfig,
internal_proxy::MIRRORD_INTPROXY_CONNECT_TCP_ENV, LayerConfig, MIRRORD_RESOLVED_CONFIG_ENV,
};
use mirrord_intproxy::agent_conn::AgentConnectInfo;
use mirrord_operator::client::OperatorSession;
Expand Down Expand Up @@ -269,7 +269,7 @@ impl MirrordExecution {

let stdout = proxy_process.stdout.take().expect("stdout was piped");

let address: SocketAddr = BufReader::new(stdout)
let intproxy_address: SocketAddr = BufReader::new(stdout)
.lines()
.next_line()
.await
Expand All @@ -288,9 +288,10 @@ impl MirrordExecution {
))
})?;

// Provide details for layer to connect to agent via internal proxy
config.connect_tcp = Some(format!("127.0.0.1:{}", address.port()));
config.connect_tcp.replace(intproxy_address.to_string());
config.update_env_var()?;
let config_as_env = config.to_env_var()?;
env_vars.insert(MIRRORD_RESOLVED_CONFIG_ENV.to_string(), config_as_env);

// Fixes <https://github.com/metalbear-co/mirrord/issues/1745>
// by disabling the fork safety check in the Objective-C runtime.
Expand Down
20 changes: 6 additions & 14 deletions mirrord/cli/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use mirrord_analytics::{AnalyticsError, AnalyticsReporter, Reporter};
use mirrord_config::{LayerConfig, MIRRORD_CONFIG_FILE_ENV};
use mirrord_progress::{JsonProgress, Progress, ProgressTracker};

use crate::{config::ExtensionExecArgs, error::CliError, execution::MirrordExecution, CliResult};
use crate::{config::ExtensionExecArgs, execution::MirrordExecution, CliResult};

/// Actually facilitate execution after all preparations were complete
async fn mirrord_exec<P>(
Expand Down Expand Up @@ -40,23 +40,15 @@ where
pub(crate) async fn extension_exec(args: ExtensionExecArgs, watch: drain::Watch) -> CliResult<()> {
let progress = ProgressTracker::try_from_env("mirrord preparing to launch")
.unwrap_or_else(|| JsonProgress::new("mirrord preparing to launch").into());
let mut env: HashMap<String, String> = HashMap::new();

// Set environment required for `LayerConfig::from_env_with_warnings`.
if let Some(config_file) = args.config_file.as_ref() {
// Set canoncialized path to config file, in case forks/children are in different
// working directories.
let full_path = std::fs::canonicalize(config_file)
.map_err(|e| CliError::CanonicalizeConfigPathFailed(config_file.into(), e))?;
std::env::set_var(MIRRORD_CONFIG_FILE_ENV, full_path.clone());
env.insert(
MIRRORD_CONFIG_FILE_ENV.into(),
full_path.to_string_lossy().into(),
);
std::env::set_var(MIRRORD_CONFIG_FILE_ENV, config_file);
}
if let Some(target) = args.target.as_ref() {
std::env::set_var("MIRRORD_IMPERSONATED_TARGET", target.clone());
env.insert("MIRRORD_IMPERSONATED_TARGET".into(), target.to_string());
}

let (config, mut context) = LayerConfig::from_env_with_warnings()?;

let mut analytics = AnalyticsReporter::only_error(config.telemetry, Default::default(), watch);
Expand All @@ -69,14 +61,14 @@ pub(crate) async fn extension_exec(args: ExtensionExecArgs, watch: drain::Watch)
#[cfg(target_os = "macos")]
let execution_result = mirrord_exec(
args.executable.as_deref(),
env,
Default::default(),
config,
progress,
&mut analytics,
)
.await;
#[cfg(not(target_os = "macos"))]
let execution_result = mirrord_exec(env, config, progress, &mut analytics).await;
let execution_result = mirrord_exec(Default::default(), config, progress, &mut analytics).await;

if execution_result.is_err() && !analytics.has_error() {
analytics.set_error(AnalyticsError::Unknown);
Expand Down
Loading

0 comments on commit b99ea5f

Please sign in to comment.