Make split modules own their dependency imports

This commit is contained in:
ms2k 2026-07-19 05:28:45 +09:00
commit 76de24c75c
3 changed files with 123 additions and 91 deletions

View file

@ -1,40 +1,17 @@
use std::io;
use std::os::fd::AsRawFd;
use std::os::unix::ffi::OsStrExt;
use std::path::Path;
use std::time::{Duration, Instant};
use lazaret_core::configuration::{ConfinedPathType, ResolvedDomainConfiguration};
use lazaret_core::identity::{
ConfigurationFingerprint, DomainId, GenerationId, HostPath, MountIdentity, NamespaceIdentity,
PidfsProcessIdentityV1,
};
use lazaret_core::records::{
ArtifactLease, DurableDecision, Generation, Participant, ParticipantOwnership, ParticipantRole,
ParticipantState, PersistedHostProcessOwnership, SessionPhase,
Generation, Participant, ParticipantOwnership, ParticipantRole, ParticipantState,
PersistedHostProcessOwnership,
};
use lazaret_linux::filesystem::{current_mount_identity, mount_identity};
use lazaret_linux::process::{
PidfsRecoveryMatch, RetainedProcess, TargetCommand, child_broker, match_recovery_process,
};
use lazaret_prepared_lower::PreparedLowerStore;
use lazaret_state_anchor::StateAnchorLayout;
use lazaret_storage_catalog::{Catalog, CatalogError};
use rustix::fs::{AtFlags, Mode, OFlags, fstat, openat, statat, unlinkat};
use rustix::io::{FdFlags, fcntl_setfd};
use lazaret_linux::process::RetainedProcess;
use rustix::process::Signal;
use crate::control::{
CONTROL_SOCKET_NAME, PUBLICATION_IDENTITY_NAME, STAGED_CONTROL_SOCKET_NAME,
STAGED_PUBLICATION_IDENTITY_NAME,
};
use crate::domain_store::{DomainStoreMutation, HostCoordinatorDomainStore};
use crate::runtime::StateAnchorAbsenceObservation;
use crate::state_anchor::{
StateAnchorCoordinator, StateAnchorCoordinatorError, StateAnchorRecoveryOwner,
};
use crate::state_maintenance::recover_state_reset;
const PROCESS_EXIT_TIMEOUT: Duration = Duration::from_secs(5);
#[derive(Clone, Copy, Debug, Eq, PartialEq)]

View file

@ -1,16 +1,38 @@
use std::io;
use std::os::fd::AsRawFd;
use std::os::unix::ffi::OsStrExt;
use std::path::Path;
use lazaret_core::configuration::{ConfinedPathType, ResolvedDomainConfiguration};
use lazaret_core::identity::{GenerationId, HostPath, MountIdentity, PidfsProcessIdentityV1};
use lazaret_core::records::{
ArtifactLease, DurableDecision, Generation, Participant, ParticipantOwnership, ParticipantRole,
ParticipantState, SessionPhase,
};
use lazaret_linux::filesystem::{current_mount_identity, mount_identity};
use lazaret_linux::process::{
PidfsRecoveryMatch, TargetCommand, child_broker, match_recovery_process,
};
use lazaret_prepared_lower::PreparedLowerStore;
use lazaret_state_anchor::StateAnchorLayout;
use lazaret_storage_catalog::{Catalog, CatalogError};
use rustix::fs::{AtFlags, Mode, OFlags, fstat, openat, statat, unlinkat};
use rustix::io::{FdFlags, fcntl_setfd};
use crate::control::{
CONTROL_SOCKET_NAME, PUBLICATION_IDENTITY_NAME, STAGED_CONTROL_SOCKET_NAME,
STAGED_PUBLICATION_IDENTITY_NAME,
};
use crate::domain_store::{DomainStoreMutation, HostCoordinatorDomainStore};
use crate::runtime::StateAnchorAbsenceObservation;
use crate::state_anchor::{
StateAnchorCoordinator, StateAnchorCoordinatorError, StateAnchorRecoveryOwner,
};
use crate::state_maintenance::recover_state_reset;
use super::{
ArtifactLease, AsRawFd, AtFlags, CONTROL_SOCKET_NAME, Catalog, CatalogError, ConfinedPathType,
DomainStoreMutation, DurableDecision, FdFlags, Generation, GenerationId,
HostCoordinatorDomainStore, HostPath, Mode, MountIdentity, OFlags, OsStrExt,
PUBLICATION_IDENTITY_NAME, Participant, ParticipantOwnership, ParticipantRole,
ParticipantState, Path, PidfsProcessIdentityV1, PidfsRecoveryMatch, PreparedLowerStore,
ResolvedDomainConfiguration, RuntimeOwnersAbsent, RuntimeProcessRole, RuntimeRecoveryOwnership,
STAGED_CONTROL_SOCKET_NAME, STAGED_PUBLICATION_IDENTITY_NAME, SealedProcessMatch,
SealedProcessOwner, SealedRuntimeOwners, SessionPhase, StateAnchorAbsenceObservation,
StateAnchorCoordinator, StateAnchorCoordinatorError, StateAnchorLayout,
StateAnchorRecoveryOwner, TargetCommand, child_broker, current_mount_identity, fcntl_setfd,
fstat, io, match_recovery_process, mount_identity, openat, recover_state_reset,
runtime_recovery_ownership, statat, unlinkat,
RuntimeOwnersAbsent, RuntimeProcessRole, RuntimeRecoveryOwnership, SealedProcessMatch,
SealedProcessOwner, SealedRuntimeOwners, runtime_recovery_ownership,
};
#[must_use]

View file

@ -1,11 +1,15 @@
use std::collections::BTreeMap;
use std::fs::{self, File, OpenOptions};
use std::os::fd::AsRawFd;
use std::os::unix::ffi::OsStrExt;
use std::os::unix::fs::symlink;
use std::os::unix::fs::{FileTypeExt, MetadataExt};
use std::os::unix::net::UnixListener;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use lazaret_core::configuration::{ConfigurationLoadRequest, load_trusted_configuration};
use lazaret_core::configuration::{
ConfigurationLoadRequest, ResolvedDomainConfiguration, load_trusted_configuration,
};
use lazaret_core::identity::{
BootId, BundleDigest, ContainerId, CoordinatorId, DeviceId, HostPidLocator, IdMapDigest,
InodeId, MountId, NetworkSidecarId, PidfsDeviceId, PidfsInodeId, PidfsProcessAuthorityV1,
@ -13,14 +17,24 @@ use lazaret_core::identity::{
SelectedManifestDigest, SourceIdentity,
};
use lazaret_core::records::{
ArtifactState, DurableDecision, GitRoutingOwnership, HelperOwnership, PrepareOperation,
PrepareStageState, PreparedArtifact, PreparedLowerOwnership, PublicationOwnership,
SandboxOwnership, StateAnchorOwnership,
ArtifactLease, ArtifactState, DurableDecision, GitRoutingOwnership, HelperOwnership,
PrepareOperation, PrepareStageState, PreparedArtifact, PreparedLowerOwnership,
PublicationOwnership, SandboxOwnership, StateAnchorOwnership,
};
use lazaret_linux::filesystem::try_exclusive_flock;
use lazaret_linux::filesystem::{current_mount_identity, try_exclusive_flock};
use lazaret_linux::process::{PidfsRecoveryMatch, match_recovery_process};
use lazaret_prepared_lower::PreparedLowerStore;
use lazaret_runtime_supervisor::sandbox::default_sandbox_layout;
use lazaret_state_anchor::StateAnchorLayout;
use lazaret_storage_catalog::Catalog;
use rustix::fs::{AtFlags, unlinkat};
use super::*;
use crate::control::{
CONTROL_SOCKET_NAME, PUBLICATION_IDENTITY_NAME, STAGED_CONTROL_SOCKET_NAME,
STAGED_PUBLICATION_IDENTITY_NAME,
};
use crate::domain_store::{DomainStoreMutation, HostCoordinatorDomainStore};
fn process(value: u64) -> PidfsProcessIdentityV1 {
PidfsProcessIdentityV1::new(