Skip to content

atomic_write silently changes manifest file permissions and inode on every write operation #6295

Closed

Description

@millsks

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

Commands I ran and their output:

$ pixi project version set 1.2.3.4
Updated workspace version to 1.2.3.4

pixi.toml/pyproject.toml file that reproduces my issue:

[workspace]
name        = "idp-app"
description = "Integrated Developer Portal — FastAPI backend + React frontend"
authors     = ["Kevin Mills <[email protected]>"]
channels    = ["conda-forge"]
platforms   = ["linux-64", "linux-aarch64", "osx-arm64", "osx-64"]
# Enable pixi-build so `pixi build` can produce conda packages.
# backend/pixi.toml is the package manifest (required by pixi's workspace
# model); all other pixi config lives here in the root pixi.toml.
preview     = ["pixi-build"]
# Supply-chain cool-down: ignore any package version (conda-forge and PyPI)
# published less than 5 days ago.  Mirrors the `minimumReleaseAge: "5 days"`
# setting in .github/renovate.json so the same guard applies whether a
# dependency is updated by Renovate or by a developer running `pixi update`
# locally.  Relative time support requires pixi ≥ 0.67.0.
exclude-newer = "5d"

# ---------------------------------------------------------------------------
# PyPI resolver options (applies to all [pypi-dependencies] sections)
# ---------------------------------------------------------------------------
# The workspace-level exclude-newer above is enforced by the conda (rattler)
# resolver.  PyPI packages are resolved by a separate uv process that needs
# its own equivalent gate.  Setting the same "5d" value here ensures that
# ---------------------------------------------------------------------------
# Workspace-level dependencies (available in every environment)
# ---------------------------------------------------------------------------
[dependencies]
python     = ">=3.12,<3.14"
nodejs     = ">=24,<25"
git-cliff  = ">=2.8.0,<3"
pre-commit = ">=4.0.0,<5"
pre-commit-hooks = ">=5.0.0,<6"

# ---------------------------------------------------------------------------
# Backend runtime dependencies
# Extras notation (e.g. [redis], [standard]) is PyPI-only and does not apply
# to conda packages — the equivalent packages are listed explicitly below.
# ---------------------------------------------------------------------------
[feature.backend.dependencies]
fastapi           = ">=0.115.0,<1"
uvicorn           = ">=0.32.0,<1"   # uvicorn[standard] extras via httptools + websockets
httptools         = ">=0.6.0"        # faster HTTP parsing for uvicorn
websockets        = ">=13.0"         # WebSocket support for uvicorn
sqlalchemy        = ">=2.0.0,<3"
alembic           = ">=1.14.0,<2"
celery            = ">=5.4.0,<6"    # celery[redis] extras via redis-py
redis-py          = ">=5.2.0,<6"    # Celery broker & result backend
psycopg2          = ">=2.9.0,<3"
asyncpg           = ">=0.30.0,<1"    # async PostgreSQL driver for SQLAlchemy
pydantic          = ">=2.10.0,<3"
pydantic-settings = ">=2.6.0,<3"
python-multipart  = ">=0.0.12"
pyjwt             = ">=2.9.0,<3"    # JWT encode/decode (inline types — no stubs needed)
pwdlib            = ">=0.3.0,<1"    # password hashing (inline types — no stubs needed)
bcrypt            = ">=4.2.0,<5"     # bcrypt hasher backend for pwdlib
httpx             = ">=0.27.0,<1"

[feature.backend.pypi-dependencies]
# Editable install so backend/src is importable during development.
# hatchling (declared in backend/pyproject.toml) is the Python build backend.
# pixi-build-python (declared in backend/pixi.toml) wraps the wheel into a
# conda package when `pixi run backend-build` is executed.
idp-app = { path = "backend", editable = true }

# ---------------------------------------------------------------------------
# Backend development / tooling dependencies
# ---------------------------------------------------------------------------
[feature.backend-dev.dependencies]
pytest         = ">=8.3.0,<9"
pytest-cov     = ">=6.0.0,<7"
pytest-asyncio = ">=0.24.0,<1"
mypy           = ">=1.11.0,<2"
ruff           = ">=0.9.0,<1"
bandit         = ">=1.8.0,<2"
python-build   = ">=1.2.0,<2"    # provides `python -m build` for wheel/sdist packaging
aiosqlite      = ">=0.20.0,<1"   # async SQLite driver used by the test suite
types-redis    = ">=4.6.0,<5"    # mypy stubs for redis-py

# ---------------------------------------------------------------------------
# Environments
# ---------------------------------------------------------------------------
[environments]
# Default environment: full backend development toolchain
default = { features = ["backend", "backend-dev"], solve-group = "default" }
backend = { features = ["backend", "backend-dev"], solve-group = "default" }

# ---------------------------------------------------------------------------
# Tasks — Backend
# All backend tool tasks run with cwd="backend" so they pick up
# the tool configurations declared in backend/pyproject.toml.
# ---------------------------------------------------------------------------
[tasks]

# --- linting & formatting ---
backend-lint         = { cmd = "ruff check src tests",           cwd = "backend", description = "Lint backend Python code" }
backend-lint-fix     = { cmd = "ruff check --fix src tests",     cwd = "backend", description = "Lint and auto-fix backend Python code" }
backend-format       = { cmd = "ruff format src tests",          cwd = "backend", description = "Format backend Python code" }
backend-format-check = { cmd = "ruff format --check src tests",  cwd = "backend", description = "Check backend Python formatting (CI)" }

# --- type checking ---
backend-typecheck = { cmd = "mypy --config-file backend/pyproject.toml", description = "Type-check backend Python with mypy" }

# --- security ---
backend-security        = { cmd = "bandit -r src -ll -f screen",                             cwd = "backend", description = "Security-scan backend Python code" }
backend-security-report = { cmd = "bandit -r src -ll -f json -o bandit-report.json || true", cwd = "backend", description = "Generate bandit JSON security report" }

# --- testing ---
backend-test          = { cmd = "pytest",                            cwd = "backend", description = "Run backend test suite" }
backend-test-coverage = { cmd = "pytest --cov-report=html:htmlcov", cwd = "backend", description = "Run backend tests with HTML coverage" }

# --- composite check ---
backend-check = { depends-on = ["backend-lint", "backend-format-check", "backend-typecheck", "backend-test", "backend-security"], description = "Run all backend quality checks" }

# --- runtime ---
backend-run    = { cmd = "uvicorn idp_app.main:app --reload --host 0.0.0.0 --port 8000", description = "Start backend dev server (hot-reload)" }
backend-worker = { cmd = "celery -A idp_app.tasks.worker worker --loglevel=info --concurrency=4", description = "Start Celery worker" }
backend-beat   = { cmd = "celery -A idp_app.tasks.worker beat   --loglevel=info",                 description = "Start Celery beat scheduler" }
backend-flower = { cmd = "celery -A idp_app.tasks.worker flower --port=5555",                      description = "Start Celery Flower monitoring UI" }

# --- database migrations ---
backend-migrate      = { cmd = "alembic upgrade head",            cwd = "backend", description = "Apply all pending Alembic migrations" }
backend-migrate-down = { cmd = "alembic downgrade -1",            cwd = "backend", description = "Roll back one Alembic migration" }
backend-migration    = { cmd = "alembic revision --autogenerate", cwd = "backend", description = "Auto-generate new migration (add -m 'message')" }
backend-db-history   = { cmd = "alembic history --verbose",       cwd = "backend", description = "Show Alembic migration history" }
backend-db-current   = { cmd = "alembic current",                 cwd = "backend", description = "Show current Alembic migration state" }

# --- build ---
# backend-build-wheel  → Python wheel (.whl) via hatchling + python -m build
# backend-build-conda  → conda package (.conda) via pixi-build-python
#                        (backend/pixi.toml is the package manifest pixi requires;
#                         pixi-build-python calls hatchling internally)
# backend-build        → both artifacts; used by release-artifacts
backend-build-wheel = { cmd = "python -m build --wheel --outdir ../dist/backend", cwd = "backend", description = "Build backend Python wheel via hatchling" }
backend-build-conda = { cmd = "pixi publish --path backend/pixi.toml --target-dir dist/backend", description = "Build backend conda package via pixi-build-python" }
backend-build       = { depends-on = ["backend-build-wheel", "backend-build-conda"], description = "Build all backend artifacts (wheel + conda package)" }

# ---------------------------------------------------------------------------
# Tasks — Frontend
# All frontend tasks delegate to npm scripts; cwd="frontend" so configs
# in frontend/ (package.json, eslint.config.js, etc.) are used automatically.
# ---------------------------------------------------------------------------
frontend-install       = { cmd = "npm install",          cwd = "frontend", description = "Install frontend npm dependencies" }
frontend-install-ci    = { cmd = "npm ci",               cwd = "frontend", description = "Clean install frontend npm deps (CI)" }
frontend-lint          = { cmd = "npm run lint",          cwd = "frontend", description = "Lint frontend code with ESLint" }
frontend-lint-fix      = { cmd = "npm run lint:fix",      cwd = "frontend", description = "Lint and auto-fix frontend code" }
frontend-format        = { cmd = "npm run format",        cwd = "frontend", description = "Format frontend code with Prettier" }
frontend-format-check  = { cmd = "npm run format:check",  cwd = "frontend", description = "Check frontend formatting (CI)" }
frontend-typecheck     = { cmd = "npm run typecheck",     cwd = "frontend", description = "Type-check frontend TypeScript" }
frontend-test          = { cmd = "npm run test",          cwd = "frontend", description = "Run frontend Vitest suite (single-run)" }
frontend-test-watch    = { cmd = "npm run test:watch",    cwd = "frontend", description = "Run frontend tests in watch mode" }
frontend-test-coverage = { cmd = "npm run test:coverage", cwd = "frontend", description = "Run frontend tests with coverage" }
frontend-security      = { cmd = "npm run security",      cwd = "frontend", description = "Audit frontend npm deps for vulnerabilities" }
frontend-build         = { cmd = "npm run build",         cwd = "frontend", description = "Build frontend production bundle (Vite → dist/)" }
frontend-preview       = { cmd = "npm run preview",       cwd = "frontend", description = "Preview production frontend build locally" }
frontend-dev           = { cmd = "npm run dev",           cwd = "frontend", description = "Start frontend Vite dev server" }
frontend-check         = { depends-on = ["frontend-lint", "frontend-format-check", "frontend-typecheck", "frontend-test", "frontend-security"], description = "Run all frontend quality checks" }

# Archive the Vite production bundle for upload to GitHub releases.
# Creates dist/idp-frontend-<version>.tar.gz from frontend/dist/.
frontend-archive = { cmd = "mkdir -p dist && tar -czf dist/idp-frontend-$(git describe --tags --always).tar.gz -C frontend dist", description = "Archive built frontend bundle for release upload" }

# ---------------------------------------------------------------------------
# Tasks — Monorepo-level
# ---------------------------------------------------------------------------
lint   = { depends-on = ["backend-lint",   "frontend-lint"],   description = "Lint all code (backend + frontend)" }
format = { depends-on = ["backend-format", "frontend-format"], description = "Format all code (backend + frontend)" }
test   = { depends-on = ["backend-test",   "frontend-test"],   description = "Run all tests (backend + frontend)" }
check  = { depends-on = ["backend-check",  "frontend-check"],  description = "Run all quality checks (backend + frontend)" }

# Build all release artifacts: backend conda package + frontend bundle archive.
# Run quality checks first, then build. Output lands in dist/.
release-artifacts = { depends-on = ["backend-check", "frontend-check", "frontend-build", "backend-build", "frontend-archive"], description = "Build and archive all release artifacts into dist/" }

# ---------------------------------------------------------------------------
# Tasks — Changelog & releases
# ---------------------------------------------------------------------------
changelog            = { cmd = "git-cliff --config cliff.toml --output CHANGELOG.md",           description = "Regenerate full CHANGELOG.md" }
changelog-unreleased = { cmd = "git-cliff --config cliff.toml --unreleased --prepend CHANGELOG.md", description = "Prepend unreleased commits to CHANGELOG.md" }

# ---------------------------------------------------------------------------
# Tasks — Docker Compose
# ---------------------------------------------------------------------------
docker-build  = { cmd = "docker compose build",                             description = "Build all Docker images" }
docker-up     = { cmd = "docker compose up -d",                             description = "Start all services (detached)" }
docker-up-log = { cmd = "docker compose up",                                description = "Start all services with logs" }
docker-down   = { cmd = "docker compose down",                              description = "Stop and remove containers" }
docker-down-v = { cmd = "docker compose down -v",                           description = "Stop containers AND remove volumes" }
docker-logs   = { cmd = "docker compose logs -f",                           description = "Follow all service logs" }
docker-ps     = { cmd = "docker compose ps",                                description = "Show running containers" }
docker-migrate= { cmd = "docker compose exec -w /app backend python -m alembic upgrade head", description = "Run DB migrations inside Docker" }
docker-shell  = { cmd = "docker compose exec backend bash",                 description = "Open shell in backend container" }

# ---------------------------------------------------------------------------
# Tasks — Pre-commit
# ---------------------------------------------------------------------------
hooks-install     = { cmd = "pre-commit install --install-hooks",        description = "Install pre-commit hooks" }
hooks-install-msg = { cmd = "pre-commit install --hook-type commit-msg", description = "Install commit-msg hook (conventional commits)" }
hooks-run         = { cmd = "pre-commit run --all-files",                description = "Run all pre-commit hooks on every file" }
hooks-update      = { cmd = "pre-commit autoupdate",                     description = "Update pre-commit hook versions to latest" }

# ---------------------------------------------------------------------------
# Tasks — One-time setup (run after clone)
# ---------------------------------------------------------------------------
setup = { depends-on = ["hooks-install", "hooks-install-msg", "frontend-install"], description = "One-time project setup: hooks + frontend deps" }

[pypi-dependencies]
conventional-pre-commit = ">=4.4.0, <5"

pixi info output:

System
------------
       Pixi version: 0.70.1
        TLS backend: rustls
           Platform: osx-arm64
   Virtual packages: __unix=0=0
                   : __osx=26.2=0
                   : __archspec=1=m4
          Cache dir: /Users/millsks/Library/Caches/rattler/cache
       Auth storage: /Users/millsks/.rattler/credentials.json
   Config locations: No config files found

Global
------------
            Bin dir: /Users/millsks/.pixi/bin
    Environment dir: /Users/millsks/.pixi/envs
       Manifest dir: /Users/millsks/.pixi/manifests/pixi-global.toml

Workspace
------------
               Name: idp-app
            Version: 1.2.3.4
      Manifest file: /Users/millsks/UserLocal/apps/src/code/Public-Git/millsks/idp-app/pixi.toml
       Last updated: 25-05-2026 16:27:21

Environments
------------
        Environment: default
           Features: backend, backend-dev, default
        Solve group: default
           Channels: conda-forge
   Dependency count: 31
       Dependencies: fastapi, uvicorn, httptools, websockets, sqlalchemy, alembic, celery, redis-py, psycopg2, asyncpg, pydantic, pydantic-settings, python-multipart, pyjwt, pwdlib, bcrypt, httpx, pytest, pytest-cov, pytest-asyncio, mypy, ruff, bandit, python-build, aiosqlite, types-redis, python, nodejs, git-cliff, pre-commit, pre-commit-hooks
  PyPI Dependencies: idp-app, conventional-pre-commit
   Target platforms: osx-arm64, osx-64, linux-aarch64, linux-64
    Prefix location: /Users/millsks/UserLocal/apps/src/code/Public-Git/millsks/idp-app/.pixi/envs/default
              Tasks: format, docker-up-log, backend-format-check, frontend-archive, docker-migrate, docker-up, hooks-update, backend-build-wheel, backend-security-report, frontend-check, frontend-lint, frontend-build, check, backend-test-coverage, docker-build, hooks-install-msg, backend-migrate, backend-typecheck, backend-lint, docker-down, hooks-install, backend-migration, frontend-install-ci, backend-security, backend-build, backend-run, test, changelog-unreleased, backend-db-current, backend-migrate-down, release-artifacts, lint, hooks-run, docker-shell, frontend-format, backend-build-conda, frontend-install, changelog, frontend-format-check, backend-test, setup, frontend-lint-fix, backend-beat, frontend-preview, docker-logs, frontend-security, docker-ps, backend-flower, backend-db-history, frontend-test-watch, frontend-dev, frontend-test, backend-lint-fix, backend-format, backend-check, frontend-typecheck, backend-worker, docker-down-v, frontend-test-coverage

        Environment: backend
           Features: backend, backend-dev, default
        Solve group: default
           Channels: conda-forge
   Dependency count: 31
       Dependencies: fastapi, uvicorn, httptools, websockets, sqlalchemy, alembic, celery, redis-py, psycopg2, asyncpg, pydantic, pydantic-settings, python-multipart, pyjwt, pwdlib, bcrypt, httpx, pytest, pytest-cov, pytest-asyncio, mypy, ruff, bandit, python-build, aiosqlite, types-redis, python, nodejs, git-cliff, pre-commit, pre-commit-hooks
  PyPI Dependencies: idp-app, conventional-pre-commit
   Target platforms: linux-aarch64, linux-64, osx-arm64, osx-64
    Prefix location: /Users/millsks/UserLocal/apps/src/code/Public-Git/millsks/idp-app/.pixi/envs/backend
              Tasks: format, docker-up-log, backend-format-check, frontend-archive, docker-migrate, docker-up, hooks-update, backend-build-wheel, backend-security-report, frontend-check, frontend-lint, frontend-build, check, backend-test-coverage, docker-build, hooks-install-msg, backend-migrate, backend-typecheck, backend-lint, docker-down, hooks-install, backend-migration, frontend-install-ci, backend-security, backend-build, backend-run, test, changelog-unreleased, backend-db-current, backend-migrate-down, release-artifacts, lint, hooks-run, docker-shell, frontend-format, backend-build-conda, frontend-install, changelog, frontend-format-check, backend-test, setup, frontend-lint-fix, backend-beat, frontend-preview, docker-logs, frontend-security, docker-ps, backend-flower, backend-db-history, frontend-test-watch, frontend-dev, frontend-test, backend-lint-fix, backend-format, backend-check, frontend-typecheck, backend-worker, docker-down-v, frontend-test-coverage

Other files (e.g. script files, source files, etc.):

Issue description

Starting with version 0.66 there seems to be an atomic rewrite of the pixi.toml when the pixi project version set command is executed. The permissions of the file was 644 before the command was executed and then 600 after the command was executed. While troubleshooting I used the stat command and noticed the inode of the file was changing too. I was able to recreate this issue on each version from 0.66 to 0.70.1 and on both Linux and MacOS.

❯ pixi --version
pixi 0.70.1

❯ stat -x pixi.toml
  File: "pixi.toml"
  Size: 15099        FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (  501/ millsks)  Gid: (   20/   staff)
Device: 1,17   Inode: 69392473    Links: 1
Access: Sat Jun  6 13:27:06 2026
Modify: Sat Jun  6 13:27:04 2026
Change: Sat Jun  6 13:29:26 2026
 Birth: Sat Jun  6 13:27:04 2026

❯ pixi project version set 1.2.3.4
✔ Updated workspace version to '1.2.3.4'.

❯ stat -x pixi.toml
  File: "pixi.toml"
  Size: 15099        FileType: Regular File
  Mode: (0600/-rw-------)         Uid: (  501/ millsks)  Gid: (   20/   staff)
Device: 1,17   Inode: 69408074    Links: 1
Access: Sat Jun  6 13:29:44 2026
Modify: Sat Jun  6 13:29:43 2026
Change: Sat Jun  6 13:29:43 2026
 Birth: Sat Jun  6 13:29:43 2026

Expected behavior

Whenever a pixi command is executed the permissions of the pixi.toml/pyproject.toml persist.

Activity

  1. added
    bug
    on Jun 6, 2026
  2. changed the title [-]Pixi 's `project version set` command recreates pixi.toml with new permissions[/-] [+]atomic_write silently changes manifest file permissions and inode on every write operation[/+] on Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions