Skip to content

prek fails to install pnpm in monorepo mode #973

@jscheffl

Description

@jscheffl

Summary

Happy user of prek and we attempt to split our huge .pre-commit-config.yaml into subfolders as of the very cool monorepo-support.

It seems a hook fails installing in a special condition if not contained in the root definition. And only when running inside a docker to build the toolchain via hatch. Error message:

  error: Failed to install hook `compile-ui-assets`
    caused by: command `npm install` exited with an error:
  
  [status]
  exit status: 127
  
  [stderr]
  node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directory
  
  Traceback (most recent call last):
    File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
      exec(code, run_globals)
    File "/opt/airflow/files/home/.local/share/hatch/env/virtual/apache-airflow-core/r60Q_0Y8/apache-airflow-core-build/lib/python3.10/site-packages/hatchling/__main__.py", line 6, in <module>
      sys.exit(hatchling())
    File "/opt/airflow/files/home/.local/share/hatch/env/virtual/apache-airflow-core/r60Q_0Y8/apache-airflow-core-build/lib/python3.10/site-packages/hatchling/cli/__init__.py", line 26, in hatchling
      command(**kwargs)
    File "/opt/airflow/files/home/.local/share/hatch/env/virtual/apache-airflow-core/r60Q_0Y8/apache-airflow-core-build/lib/python3.10/site-packages/hatchling/cli/build/__init__.py", line 82, in build_impl
      for artifact in builder.build(
    File "/opt/airflow/files/home/.local/share/hatch/env/virtual/apache-airflow-core/r60Q_0Y8/apache-airflow-core-build/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
      artifact = version_api[version](directory, **build_data)
    File "/opt/airflow/airflow-core/hatch_build.py", line 70, in build_standard
      run(cmd, cwd=work_dir.as_posix(), check=True)
    File "/usr/local/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['prek', 'run', '--hook-stage', 'manual', 'compile-ui-assets', '--all-files']' returned non-zero exit status 2.

Link to pipeline run: https://github.com/apache/airflow/actions/runs/18822017185/job/53699249745?pr=57310
Link to PR and affecting hook ID: https://github.com/apache/airflow/pull/57310/files#diff-d6698f4828e1e3da01891773fed58a2b7bad2bcbee35fd42337203f3fdac5b80R100
Affected PR Commit: 24c8e7c47ccd98d6e389a1385d756ee85ee41e18

Working "standalone" command/call: prek run --hook-stage manual compile-ui-assets --all-files
Not working when called via docker by: breeze release-management prepare-airflow-distributions --distribution-format wheel

Any triaging help is welcome and we are also very happy to contribute back if we know the reason.

Platform

Ubuntu Linux 24.04 / Prek in Docker

Version

0.2.11

.pre-commit-config.yaml

  - id: compile-ui-assets
    name: Compile ui assets (manual)
    language: node
    stages: ['manual']
    types_or: [javascript, ts, tsx]
    files:
      (?x)
      ^src/airflow/ui/|
      ^src/airflow/api_fastapi/auth/managers/simple/ui/
    entry: ../scripts/ci/prek/compile_ui_assets.py
    pass_filenames: false
    additional_dependencies: ['pnpm@9.7.1']

Log file

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions