-
-
Notifications
You must be signed in to change notification settings - Fork 369
Description
Bug Description
When directories exist in the project root that the user is not able to read, maturin build immediately gives up.
Your maturin version (maturin --version)
1.8.3
Your Python version (python -V)
python 3.11
Your pip version (pip -V)
25.0.1
What bindings you're using
pyo3
Does cargo build work?
- Yes, it works
If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?
- Yes
Steps to Reproduce
For example if in any project you run the following commands:
mkdir bogus_dir
chmod 700 bogus_dir
sudo chown root bogus_dirThen running maturin build in this project fails with
💥 maturin failed
Caused by: Failed to add the files to the wheel
Caused by: Failed to add the python module to the package
Caused by: /$PROJECT_ROOT/bogus_dir: IO error for operation on /$PROJECT_ROOT/bogus_dir: Permission
This seems to be caused by this question mark here.
I found this from a ci run with sccache were somehow someway some subdirectories in the cache are not readable for the build user.
Here is the full log if you are interested.
ci log
�[0KRunning with gitlab-runner 18.4.0~pre.115.gb2218bab (b2218bab)�[0;m
�[0K on blue-5.saas-linux-small-amd64.runners-manager.gitlab.com/default -AzERasQr, system ID: s_4cb09cee29e2�[0;m
�[0K�[36;1mResolving secrets�[0;m�[0;m
section_start:1760535276:prepare_executor
�[0K�[0K�[36;1mPreparing the "docker+machine" executor�[0;m�[0;m
�[0KUsing Docker executor with image registry.gitlab.com/sli-lib/sli/ci:latest ...�[0;m
�[0KUsing effective pull policy of [always] for container registry.gitlab.com/sli-lib/sli/ci:latest�[0;m
�[0KAuthenticating with credentials from job payload (GitLab Registry)�[0;m
�[0KPulling docker image registry.gitlab.com/sli-lib/sli/ci:latest ...�[0;m
�[0KUsing docker image sha256:5bf229686f4cf4d9d368536b3db440bc5a31bff730495fba2d277fdd4ad67b4d for registry.gitlab.com/sli-lib/sli/ci:latest with digest registry.gitlab.com/sli-lib/sli/ci@sha256:5eb1c6e5dfd220df2f9dbe7d9af22a69080ba36bfd83bc21419864e5df4e9e2a ...�[0;m
section_end:1760535369:prepare_executor
�[0Ksection_start:1760535369:prepare_script
�[0K�[0K�[36;1mPreparing environment�[0;m�[0;m
�[0KUsing effective pull policy of [always] for container sha256:50733dcc3ce8c279ea9f60f0373c517efc76682c8867d74ae7720e9502d848e2�[0;m
Running on runner--azerasqr-project-52004375-concurrent-0 via runner-azerasqr-s-l-s-amd64-1760535228-8d91b8d3...
section_end:1760535374:prepare_script
�[0Ksection_start:1760535374:get_sources
�[0K�[0K�[36;1mGetting source from Git repository�[0;m�[0;m
�[32;1mGitaly correlation ID: a386fab166524a449416ac59e52cbfaf�[0;m
�[32;1mFetching changes with git depth set to 20...�[0;m
Initialized empty Git repository in /builds/sli-lib/SLI/.git/
�[32;1mCreated fresh repository.�[0;m
�[32;1mChecking out 63a706b0 as detached HEAD (ref is feat-python-api2)...�[0;m
�[32;1mSkipping Git submodules setup�[0;m
�[32;1m$ git remote set-url origin "${CI_REPOSITORY_URL}" || echo 'Not a git repository; skipping'�[0;m
section_end:1760535375:get_sources
�[0Ksection_start:1760535375:restore_cache
�[0K�[0K�[36;1mRestoring cache�[0;m�[0;m
�[32;1mChecking cache for default-4-non_protected...�[0;m
Downloading cache from https://storage.googleapis.com/gitlab-com-runners-cache/project/52004375/default-4-non_protected�[0;m ETag�[0;m="118a8864408a32b834203cbaaf1e1e90"
�[32;1mSuccessfully extracted cache�[0;m
section_end:1760535389:restore_cache
�[0Ksection_start:1760535389:step_script
�[0K�[0K�[36;1mExecuting "step_script" stage of the job script�[0;m�[0;m
�[0KUsing effective pull policy of [always] for container registry.gitlab.com/sli-lib/sli/ci:latest�[0;m
�[0KUsing docker image sha256:5bf229686f4cf4d9d368536b3db440bc5a31bff730495fba2d277fdd4ad67b4d for registry.gitlab.com/sli-lib/sli/ci:latest with digest registry.gitlab.com/sli-lib/sli/ci@sha256:5eb1c6e5dfd220df2f9dbe7d9af22a69080ba36bfd83bc21419864e5df4e9e2a ...�[0;m
�[32;1m$ export CARGO_HOME="${PWD}/.cargo_home"�[0;m
�[32;1m$ echo $CARGO_HOME�[0;m
/builds/sli-lib/SLI/.cargo_home
�[32;1m$ just test-python-ci�[0;m
maturin build
📦 Including license file "/builds/sli-lib/SLI/LICENSE"
🍹 Building a mixed python/rust project
🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.11
🐍 Not using a specific python interpreter
📡 Using build options features from pyproject.toml
Compiling proc-macro2 v1.0.86
Compiling unicode-ident v1.0.16
Compiling memchr v2.7.4
Compiling quote v1.0.38
Compiling shlex v1.3.0
Compiling syn v2.0.87
Compiling glob v0.3.1
Compiling clang-sys v1.8.1
Compiling target-lexicon v0.13.3
Compiling cfg-if v1.0.0
Compiling libc v0.2.155
Compiling cc v1.2.21
Compiling either v1.13.0
Compiling regex-syntax v0.8.5
Compiling bitflags v2.6.0
Compiling equivalent v1.0.1
Compiling minimal-lexical v0.2.1
Compiling nom v7.1.3
Compiling regex-automata v0.4.9
Compiling pyo3-build-config v0.26.0
Compiling libloading v0.8.4
Compiling cexpr v0.6.0
Compiling regex v1.11.1
Compiling itertools v0.12.1
Compiling autocfg v1.5.0
Compiling serde v1.0.219
Compiling hashbrown v0.15.2
Compiling serde_json v1.0.140
Compiling indexmap v2.7.1
Compiling itoa v1.0.15
Compiling rustix v0.38.34
Compiling ryu v1.0.20
Compiling bindgen v0.72.0
Compiling rustc-hash v2.1.1
Compiling prettyplease v0.2.20
Compiling log v0.4.22
Compiling linux-raw-sys v0.4.14
Compiling tree-sitter v0.25.9
Compiling num-traits v0.2.19
Compiling bindgen v0.69.4
Compiling home v0.5.9
Compiling version_check v0.9.4
Compiling heck v0.5.0
Compiling pkg-config v0.3.32
Compiling proc-macro2-diagnostics v0.10.1
Compiling which v4.4.2
Compiling croaring-sys v4.3.10
Compiling aho-corasick v1.1.3
Compiling z3-sys v0.9.8 (https://github.com/prove-rs/z3.rs.git?rev=310b3fe871df77bcd53fcfa2cf3f7e59f90763ab#310b3fe8)
Compiling lazy_static v1.5.0
Compiling allocator-api2 v0.2.21
Compiling rustc-hash v1.1.0
Compiling lazycell v1.3.0
Compiling foldhash v0.1.5
Compiling crossbeam-utils v0.8.21
Compiling pyo3-macros-backend v0.26.0
Compiling pyo3-ffi v0.26.0
Compiling unicode-segmentation v1.12.0
Compiling yansi v1.0.1
Compiling paste v1.0.15
Compiling convert_case v0.6.0
Compiling num-integer v0.1.46
Compiling tree-sitter-fodot v0.0.1 (https://gitlab.com/sli-lib/tree-sitter-fodot?rev=8671c0c412ee2a1630def6101c92fa28c7d21590#8671c0c4)
Compiling memoffset v0.9.1
Compiling tree-sitter-language v0.1.5
Compiling allocator-api2 v0.3.1
Compiling comp-core v0.1.0 (/builds/sli-lib/SLI/sli/comp-core)
Compiling unicode-xid v0.2.6
Compiling streaming-iterator v0.1.9
Compiling const_format_proc_macros v0.2.33
Compiling croaring v2.4.0
Compiling sli-collections v0.1.0 (/builds/sli-lib/SLI/sli/sli-collections)
Compiling z3-mid v0.13.3 (https://gitlab.com/EAVISE/sli/z3.rs?rev=45bf6cb12e08712ad4d7792c05c2ff416962932d#45bf6cb1)
Compiling num-rational v0.4.2
Compiling duplicate v2.0.0
Compiling algebraic-errors v0.1.0 (https://gitlab.com/sli-lib/algebraic-errors?rev=1ee3a1a205628470d9804db417d3678e2b43d6ad#1ee3a1a2)
Compiling pyo3 v0.26.0
Compiling sli-lib v0.1.0 (/builds/sli-lib/SLI/sli/sli-lib)
Compiling typed-index-collections v3.1.0
Compiling pyo3-macros v0.26.0
Compiling const_format v0.2.33
Compiling unindent v0.2.4
Compiling indoc v2.0.6
Compiling once_cell v1.21.3
Compiling unicode-width v0.2.1
Compiling pysli-lib v0.1.0 (/builds/sli-lib/SLI/sli/pysli-lib)
Finished dev profile [unoptimized + debuginfo] target(s) in 1m 31s
🖨 Copied external shared libraries to package sli_lib.libs directory:
/nix/store/v92375kcxc50qzjnxr3ibv0389k79hg8-z3-4.15.0-lib/lib/libz3.so
💥 maturin failed
Caused by: Failed to add the files to the wheel
Caused by: Failed to add the python module to the package
Caused by: /builds/sli-lib/SLI/.cache/sccache/3/c: IO error for operation on /builds/sli-lib/SLI/.cache/sccache/3/c: Permission denied (os error 13)
error: Recipe build-python-api failed on line 76 with exit code 1
section_end:1760535491:step_script
�[0Ksection_start:1760535491:upload_artifacts_on_failure
�[0K�[0K�[36;1mUploading artifacts for failed job�[0;m�[0;m
�[32;1mUploading artifacts...�[0;m
�[0;33mWARNING: target/pytest/junit.xml: no matching files. Ensure that the artifact path is relative to the working directory (/builds/sli-lib/SLI)�[0;m
�[31;1mERROR: No files to upload �[0;m
section_end:1760535492:upload_artifacts_on_failure
�[0Ksection_start:1760535492:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1760535493:cleanup_file_variables
�[0K�[31;1mERROR: Job failed: exit code 1
�[0;m