Skip to content

module 'os' has no attribute 'O_NOFOLLOW' #583

@kgonia

Description

@kgonia

After command

mvn org.graalvm.python:graalpy-maven-plugin:lock-packages

build failed because module 'os' has no attribute 'O_NOFOLLOW'

on graalpython

>>> import os
>>> open_flags = os.O_RDWR | os.O_TRUNC | os.O_NOFOLLOW
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'os' has no attribute 'O_NOFOLLOW'

on CPython executes without error:

>>> import os
>>> open_flags = os.O_RDWR | os.O_TRUNC | os.O_NOFOLLOW

build logs:

Collecting safetensors>=0.3.1 (from diffusers==0.36.0)
  Downloading safetensors-0.7.0.tar.gz (200 kB)
  Looking for GraalPy patches for safetensors
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'
[ERROR]   error: subprocess-exited-with-error
[ERROR]   
[ERROR]   × Preparing metadata (pyproject.toml) did not run successfully.
[ERROR]   │ exit code: 1
[ERROR]   ╰─> [68 lines of output]
[ERROR]       WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
[ERROR]       WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime (file:/home/ubuntu/.m2/repository/org/graalvm/truffle/truffle-runtime/25.0.1/truffle-runtime-25.0.1.jar)
[ERROR]       WARNING: Please consider reporting this to the maintainers of class com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime
[ERROR]       WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[ERROR]       Checking for Rust toolchain....
[ERROR]       Rust not found, installing into a temporary directory
[ERROR]       Python reports SOABI: graalpy250-312-native-x86_64-linux
[ERROR]       Computed rustc target triple: x86_64-unknown-linux-gnu
[ERROR]       Installation directory: /home/ubuntu/.cache/puccinialin
[ERROR]       Downloading rustup-init from https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init
[ERROR]       
[ERROR]       Downloading rustup-init:   0%|          | 0.00/20.9M [00:00<?, ?B/s]
[ERROR]       Downloading rustup-init:   1%|          | 188k/20.9M [00:00<00:10, 1.88MB/s]
[ERROR]       Downloading rustup-init:   2%|▏         | 377k/20.9M [00:00<00:14, 1.46MB/s]
[ERROR]       Downloading rustup-init:   3%|▎         | 606k/20.9M [00:00<00:11, 1.76MB/s]
[ERROR]       Downloading rustup-init:   4%|▍         | 926k/20.9M [00:00<00:08, 2.26MB/s]
[ERROR]       Downloading rustup-init:   6%|▌         | 1.17M/20.9M [00:00<00:08, 2.23MB/s]
[ERROR]       Downloading rustup-init:   7%|▋         | 1.54M/20.9M [00:00<00:07, 2.68MB/s]
[ERROR]       Downloading rustup-init:   9%|▊         | 1.82M/20.9M [00:00<00:07, 2.61MB/s]WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
[ERROR]       WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime (file:/home/ubuntu/.m2/repository/org/graalvm/truffle/truffle-runtime/25.0.1/truffle-runtime-25.0.1.jar)
[ERROR]       WARNING: Please consider reporting this to the maintainers of class com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime
[ERROR]       WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[ERROR]       
[ERROR]       Downloading rustup-init:  10%|█         | 2.09M/20.9M [00:00<00:08, 2.20MB/s]
[ERROR]       Downloading rustup-init:  12%|█▏        | 2.45M/20.9M [00:01<00:07, 2.55MB/s]
[ERROR]       Downloading rustup-init:  14%|█▎        | 2.87M/20.9M [00:01<00:06, 2.98MB/s]
[ERROR]       Downloading rustup-init:  15%|█▌        | 3.19M/20.9M [00:01<00:06, 2.75MB/s]
[ERROR]       Downloading rustup-init:  18%|█▊        | 3.69M/20.9M [00:01<00:05, 3.32MB/s]
[ERROR]       Downloading rustup-init:  19%|█▉        | 4.04M/20.9M [00:01<00:05, 3.34MB/s]
[ERROR]       Downloading rustup-init:  21%|██▏       | 4.44M/20.9M [00:01<00:04, 3.53MB/s]
[ERROR]       Downloading rustup-init:  24%|██▍       | 5.05M/20.9M [00:01<00:03, 4.23MB/s]
[ERROR]       Downloading rustup-init:  27%|██▋       | 5.74M/20.9M [00:01<00:03, 5.00MB/s]
[ERROR]       Downloading rustup-init:  30%|██▉       | 6.26M/20.9M [00:01<00:03, 4.58MB/s]
[ERROR]       Downloading rustup-init:  33%|███▎      | 6.95M/20.9M [00:02<00:02, 5.21MB/s]
[ERROR]       Downloading rustup-init:  37%|███▋      | 7.76M/20.9M [00:02<00:02, 6.01MB/s]
[ERROR]       Downloading rustup-init:  41%|████▏     | 8.62M/20.9M [00:02<00:01, 6.73MB/s]
[ERROR]       Downloading rustup-init:  45%|████▍     | 9.36M/20.9M [00:02<00:01, 6.90MB/s]
[ERROR]       Downloading rustup-init:  48%|████▊     | 10.1M/20.9M [00:02<00:01, 6.47MB/s]
[ERROR]       Downloading rustup-init:  53%|█████▎    | 11.0M/20.9M [00:02<00:01, 7.36MB/s]
[ERROR]       Downloading rustup-init:  57%|█████▋    | 11.9M/20.9M [00:02<00:01, 7.81MB/s]
[ERROR]       Downloading rustup-init:  62%|██████▏   | 13.0M/20.9M [00:02<00:00, 8.54MB/s]
[ERROR]       Downloading rustup-init:  69%|██████▉   | 14.5M/20.9M [00:02<00:00, 10.4MB/s]
[ERROR]       Downloading rustup-init:  76%|███████▋  | 16.0M/20.9M [00:02<00:00, 11.7MB/s]
[ERROR]       Downloading rustup-init:  82%|████████▏ | 17.1M/20.9M [00:03<00:00, 10.8MB/s]
[ERROR]       Downloading rustup-init:  88%|████████▊ | 18.4M/20.9M [00:03<00:00, 11.1MB/s]
[ERROR]       Downloading rustup-init:  93%|█████████▎| 19.5M/20.9M [00:03<00:00, 10.3MB/s]
[ERROR]       Downloading rustup-init:  98%|█████████▊| 20.6M/20.9M [00:03<00:00, 10.4MB/s]
[ERROR]       Downloading rustup-init: 100%|██████████| 20.9M/20.9M [00:03<00:00, 5.95MB/s]
[ERROR]       Traceback (most recent call last):
[ERROR]         File "/home/ubuntu/IdeaProjects/imageo/target/classes/org.graalvm.python.vfs/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
[ERROR]           main()
[ERROR]         File "/home/ubuntu/IdeaProjects/imageo/target/classes/org.graalvm.python.vfs/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
[ERROR]           json_out['return_val'] = hook(**hook_input['kwargs'])
[ERROR]         File "/home/ubuntu/IdeaProjects/imageo/target/classes/org.graalvm.python.vfs/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
[ERROR]           return hook(metadata_directory, config_settings)
[ERROR]         File "/tmp/pip-build-env-h2mefv0v/overlay/lib/python3.12/site-packages/maturin/__init__.py", line 190, in prepare_metadata_for_build_wheel
[ERROR]           output = subprocess.check_output(["cargo", "--version"], env=_get_env()).decode("utf-8", "ignore")
[ERROR]         File "/tmp/pip-build-env-h2mefv0v/overlay/lib/python3.12/site-packages/maturin/__init__.py", line 75, in _get_env
[ERROR]           extra_env = setup_rust()
[ERROR]         File "/tmp/pip-build-env-h2mefv0v/normal/lib/python3.12/site-packages/puccinialin/_setup_rust.py", line 130, in setup_rust
[ERROR]           with lock:
[ERROR]         File "/tmp/pip-build-env-h2mefv0v/normal/lib/python3.12/site-packages/filelock/_api.py", line 376, in __enter__
[ERROR]           self.acquire()
[ERROR]         File "/tmp/pip-build-env-h2mefv0v/normal/lib/python3.12/site-packages/filelock/_api.py", line 332, in acquire
[ERROR]           self._acquire()
[ERROR]         File "/tmp/pip-build-env-h2mefv0v/normal/lib/python3.12/site-packages/filelock/_unix.py", line 41, in _acquire
[ERROR]           open_flags = os.O_RDWR | os.O_TRUNC | os.O_NOFOLLOW
[ERROR]       AttributeError: module 'os' has no attribute 'O_NOFOLLOW'
[ERROR]       [end of output]
[ERROR]   
[ERROR]   note: This error originates from a subprocess, and is likely not a problem with pip.
[ERROR] error: metadata-generation-failed

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions