Skip to content

zkvm/args: fix wrong os_string import #123971

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

marijanp
Copy link
Contributor

@marijanp marijanp commented Apr 15, 2024

$ cargo build -Z build-std --target riscv32im-risc0-zkvm-elf
   Compiling std v0.0.0 (/nix/store/7b93qrzs6dxkhqrzbi8adhdpyqxf95xs-rust-default-1.79.0-nightly-2024-04-15/lib/rustlib/src/rust/library/std)
error[E0433]: failed to resolve: could not find `os_str` in `super`
  --> /nix/store/7b93qrzs6dxkhqrzbi8adhdpyqxf95xs-rust-default-1.79.0-nightly-2024-04-15/lib/rustlib/src/rust/library/std/src/sys/pal/zkvm/../zkvm/args.rs:36:37
   |
36 |         OsString::from_inner(super::os_str::Buf { inner: arg_bytes.to_vec() })
   |                                     ^^^^^^ could not find `os_str` in `super`
   |
help: consider importing one of these items
   |
1  + use crate::ffi::os_str;
   |
1  + use crate::sys::os_str;
   |
help: if you import `os_str`, refer to it directly
   |
36 -         OsString::from_inner(super::os_str::Buf { inner: arg_bytes.to_vec() })
36 +         OsString::from_inner(os_str::Buf { inner: arg_bytes.to_vec() })

@rustbot
Copy link
Collaborator

rustbot commented Apr 15, 2024

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 15, 2024
@marijanp
Copy link
Contributor Author

r? @joboet

@rustbot rustbot assigned joboet and unassigned workingjubilee Apr 15, 2024
@marijanp
Copy link
Contributor Author

marijanp commented Apr 15, 2024

Duplicate of #123970

@marijanp marijanp closed this Apr 15, 2024
@marijanp marijanp deleted the zkvm-use-os-string branch April 15, 2024 16:45
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-tidy failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Getting action download info
Download action repository 'msys2/setup-msys2@v2.22.0' (SHA:cc11e9188b693c2b100158c3322424c4cc1dadea)
Download action repository 'actions/checkout@v4' (SHA:b4ffde65f46336ab88eb53be808477a3936bae11)
Download action repository 'actions/upload-artifact@v4' (SHA:5d5d22a31266ced268874388b861e4b58bb5c2f3)
Complete job name: PR - mingw-check-tidy
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
---
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt \
    && pip3 install virtualenv
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
           --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---

#12 [5/8] COPY host-x86_64/mingw-check/reuse-requirements.txt /tmp/
#12 DONE 0.0s

#13 [6/8] RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-requirements.txt     && pip3 install virtualenv
#13 0.404   Downloading binaryornot-0.4.4-py2.py3-none-any.whl (9.0 kB)
#13 0.415 Collecting boolean-py==4.0
#13 0.418   Downloading boolean.py-4.0-py3-none-any.whl (25 kB)
#13 0.430 Collecting chardet==5.1.0
---
#13 3.419 Building wheels for collected packages: reuse
#13 3.420   Building wheel for reuse (pyproject.toml): started
#13 3.745   Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.748   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#13 3.748   Stored in directory: /tmp/pip-ephem-wheel-cache-p5mpx_q_/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#13 3.750 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#13 3.772   Attempting uninstall: setuptools
#13 3.773     Found existing installation: setuptools 59.6.0
#13 3.774     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#13 3.774     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
#13 3.774     Can't uninstall 'setuptools'. No files were found to uninstall.
#13 4.440 Successfully installed binaryornot-0.4.4 boolean-py-4.0 chardet-5.1.0 jinja2-3.1.2 license-expression-30.0.0 markupsafe-2.1.1 python-debian-0.1.49 reuse-1.1.0 setuptools-66.0.0
#13 4.440 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#13 4.940 Collecting virtualenv
#13 4.976   Downloading virtualenv-20.25.1-py3-none-any.whl (3.8 MB)
#13 5.022      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 86.2 MB/s eta 0:00:00
#13 5.070 Collecting platformdirs<5,>=3.9.1
#13 5.073   Downloading platformdirs-4.2.0-py3-none-any.whl (17 kB)
#13 5.102 Collecting filelock<4,>=3.12.2
#13 5.106   Downloading filelock-3.13.4-py3-none-any.whl (11 kB)
#13 5.121 Collecting distlib<1,>=0.3.7
#13 5.124   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 5.130      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 119.0 MB/s eta 0:00:00
#13 5.215 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 5.376 Successfully installed distlib-0.3.8 filelock-3.13.4 platformdirs-4.2.0 virtualenv-20.25.1
#13 DONE 5.4s

#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k:      235456 kB
DirectMap2M:     9201664 kB
DirectMap1G:     9437184 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test            --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint
    Finished `dev` profile [unoptimized] target(s) in 0.03s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/84e729a59f216cc64755788a470f165429a731f4/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-84e729a59f216cc64755788a470f165429a731f4-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
   Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
    Finished `release` profile [optimized] target(s) in 25.73s
##[endgroup]
fmt check
##[error]Diff in /checkout/library/std/src/sys/pal/zkvm/args.rs at line 1:
 use super::{abi, WORD_SIZE};
 use crate::ffi::OsString;
 use crate::fmt;
+use crate::sys::os_string;
 use crate::sys_common::FromInner;
 use crate::sys_common::FromInner;
 
 pub struct Args {
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/rustfmt/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/library/std/src/sys/pal/windows/os/tests.rs" "/checkout/library/std/src/sys/pal/windows/stdio/tests.rs" "/checkout/library/std/src/sys/pal/windows/thread.rs" "/checkout/library/std/src/sys/pal/sgx/thread_parking.rs" "/checkout/library/std/src/sys/pal/sgx/time.rs" "/checkout/library/std/src/sys/pal/sgx/fd.rs" "/checkout/library/std/src/sys/pal/sgx/net.rs" "/checkout/library/std/src/sys/pal/sgx/mod.rs" "/checkout/library/std/src/sys/pal/sgx/args.rs" "/checkout/library/std/src/sys/pal/sgx/abi/usercalls/tests.rs" "/checkout/library/std/src/sys/pal/sgx/abi/usercalls/raw.rs" "/checkout/library/std/src/sys/pal/sgx/abi/usercalls/mod.rs" "/checkout/library/std/src/sys/pal/sgx/abi/usercalls/alloc.rs" "/checkout/library/std/src/sys/pal/sgx/abi/reloc.rs" "/checkout/library/std/src/sys/pal/sgx/abi/tls/sync_bitset.rs" "/checkout/library/std/src/sys/pal/sgx/abi/tls/mod.rs" "/checkout/library/std/src/sys/pal/sgx/abi/tls/sync_bitset/tests.rs" "/checkout/library/std/src/sys/pal/sgx/abi/mod.rs" "/checkout/library/std/src/sys/pal/sgx/abi/mem.rs" "/checkout/library/std/src/sys/pal/sgx/abi/panic.rs" "/checkout/library/std/src/sys/pal/sgx/abi/thread.rs" "/checkout/library/std/src/sys/pal/sgx/alloc.rs" "/checkout/library/std/src/sys/pal/sgx/env.rs" "/checkout/library/std/src/sys/pal/sgx/thread_local_key.rs" "/checkout/library/std/src/sys/pal/sgx/stdio.rs" "/checkout/library/std/src/sys/pal/sgx/os.rs" "/checkout/library/std/src/sys/pal/sgx/waitqueue/unsafe_list.rs" "/checkout/library/std/src/sys/pal/sgx/waitqueue/tests.rs" "/checkout/library/std/src/sys/pal/sgx/waitqueue/mod.rs" "/checkout/library/std/src/sys/pal/sgx/waitqueue/spin_mutex.rs" "/checkout/library/std/src/sys/pal/sgx/waitqueue/spin_mutex/tests.rs" "/checkout/library/std/src/sys/pal/sgx/waitqueue/unsafe_list/tests.rs" "/checkout/library/std/src/sys/pal/sgx/thread.rs" "/checkout/library/std/src/sys/pal/zkvm/abi.rs" "/checkout/library/std/src/sys/pal/zkvm/mod.rs" "/checkout/library/std/src/sys/pal/zkvm/args.rs" "/checkout/library/std/src/sys/pal/zkvm/alloc.rs" "/checkout/library/std/src/sys/pal/zkvm/env.rs" "/checkout/library/std/src/sys/pal/zkvm/thread_local_key.rs" "/checkout/library/std/src/sys/pal/zkvm/stdio.rs" "/checkout/library/std/src/sys/pal/zkvm/os.rs" "/checkout/library/std/src/sys/pal/itron/thread_parking.rs" "/checkout/library/std/src/sys/pal/itron/time.rs" "/checkout/library/std/src/sys/pal/itron/abi.rs" "/checkout/library/std/src/sys/pal/itron/time/tests.rs" "/checkout/library/std/src/sys/pal/itron/task.rs" "/checkout/library/std/src/sys/pal/itron/error.rs" "/checkout/library/std/src/sys/pal/itron/spin.rs" "/checkout/library/std/src/sys/pal/itron/thread.rs" "/checkout/library/std/src/sys/pal/uefi/tests.rs" "/checkout/library/std/src/sys/pal/uefi/time.rs" "/checkout/library/std/src/sys/pal/uefi/mod.rs" "/checkout/library/std/src/sys/pal/uefi/args.rs" "/checkout/library/std/src/sys/pal/uefi/alloc.rs" "/checkout/library/std/src/sys/pal/uefi/helpers.rs" "/checkout/library/std/src/sys/pal/uefi/env.rs" "/checkout/library/std/src/sys/pal/uefi/stdio.rs" "/checkout/library/std/src/sys/pal/uefi/os.rs" "/checkout/library/std/src/sys/pal/uefi/thread.rs" "/checkout/library/std/src/sys/pal/unix/kernel_copy/tests.rs" "/checkout/library/std/src/sys/pal/unix/time.rs" "/checkout/library/std/src/sys/pal/unix/fd.rs" "/checkout/library/std/src/sys/pal/unix/net.rs" "/checkout/library/std/src/sys/pal/windows/thread_local_dtor.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.
  local time: Mon Apr 15 16:45:36 UTC 2024
  network time: Mon, 15 Apr 2024 16:45:36 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants