by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Noah
    @coolreader18
    You could in theory construct a PySuper object with zelf and Self::class(vm), and then get an attribute of it, but I'm not sure what the rust API of PySuper is looking like right now
    Karel L. Kubat
    @KaiserKarel
    That did the trick @coolreader18! Thanks for the help.
    Karel L. Kubat
    @KaiserKarel
    I feel like I keep asking stupid questions; but I am getting a couldn't init zipimport panic, originating from a ModuleNotFoundError: No module named 'io' in the initialize method of vm. I've copied the root level Lib from rustpython; and set the env variable RUSTPYTHONPATH=/path/to/lib
    James Webber
    @jamestwebber
    hello! on the topic of possibly-stupid questions: I'm not sure what's wrong but cargo run demo.py is failing for me with compilation errors
    fresh install of rust 1.40.0 and python 3.8 in a new conda env on Ubuntu 20.04
    most popular error is error[E0658]: custom attributes cannot be applied to modules
    Jeong YunWon
    @youknowone
    @jamestwebber Try to update rust to most recent version
    rustup update will work when you used rustup
    James Webber
    @jamestwebber
    ahh i used conda to install rust, didn't realize it was out of date
    James Webber
    @jamestwebber
    it works :tada:
    James Webber
    @jamestwebber
    is there a way to run a specific cpython test?
    cargo run Lib/test/test_whatever.py will run a whole file which takes a while
    James Webber
    @jamestwebber
    okay now i'm struggling debugging a test that should fail with python exception but is panicking with "no more blocks to pop"
    tried copying test_pickle.py and friends into the project
    James Webber
    @jamestwebber
    ^ dug a little deeper, it seems like a particular type of bad input caused this, b'V...'. there are a bunch of other errors in the tests but they at least run once i commented out those specific cases
    Noah
    @coolreader18
    @jamestwebber you can do something like cargo run --release -- -m test.test_whatever -k test_name
    @KaiserKarel I'm not sure why zipimport isn't working, but I think that should just be a warning, not a panic?
    James Webber
    @jamestwebber
    ah close, it was cargo run -- -m unittest test.test_pickle.PyPickleTests.test_callapi
    or least that worked
    i'm more used to pytest
    Jeong YunWon
    @youknowone
    -k option is searching as same as pytest
    James Webber
    @jamestwebber
    it didn't seem to work when i tried, not sure why
    was running everything
    Aurelien Montmejat
    @aurelien-m

    Hi everyone, I have the following error, do you know if this can run on a Raspberry Pi/ARM processor ?

    error[E0277]: the trait bound i32: std::convert::From<u32> is not satisfied
    --> vm/src/stdlib/time_module.rs:23:37
    |
    23 | tv_nsec: dur.subsec_nanos().into(),
    | ^^^^ the trait std::convert::From<u32> is not implemented for i32
    |
    = help: the following implementations were found:
    <i32 as std::convert::From<bool>>
    <i32 as std::convert::From<dns_lookup::types::AddrFamily>>
    <i32 as std::convert::From<dns_lookup::types::Protocol>>
    <i32 as std::convert::From<dns_lookup::types::SockType>>
    and 9 others
    = note: required because of the requirements on the impl of std::convert::Into<i32> for u32

    error: aborting due to previous error

    For more information about this error, try rustc --explain E0277.
    error: could not compile rustpython-vm.

    Noah
    @coolreader18
    Hmm, if that's the only error it shouldn't be too hard to fix, try just replacing the .into() with as _ and see if that works? I wouldn't be too surprised if there's runtime errors as well, but there might not be.
    James Webber
    @jamestwebber
    what model RPi is it?
    it looks like rust thinks isize is 32 bit, which maybe implies the processor is 32-bit, which probably won't work...
    Alan Justino da Silva
    @alanjds
    It is not compatible with 32-bit machines?
    James Webber
    @jamestwebber
    i don't know if it's meant to be (very new to the project!) but it looks like 64-bit types are assumed in the code
    and i guess i don't know enough rust to say if that's a deal breaker but i wouldn't be surprised if some aspects assume 64-bittedness
    Alan Justino da Silva
    @alanjds
    Me too. May the RustPython code is overlooking something on this. May nobody had tried a 32bit machine yet.
    If in a hurry, I think you can run on RPi via wasmer for now.
    Noah
    @coolreader18
    I think that should be just that one instance, since it's using libc timespec and libc doesn't use types like isize, it just typedefs according to the platform. I think we've tried to ensure that we don't assume anything about pointer size/endianness, so it should work if you fix that error.
    Aurelien Montmejat
    @aurelien-m
    Thanks for the replies, I tried doing tv_nsec: dur.subsec_nanos() as i32 and it doesn't show that error but it just crashes every time I try to build (if you guys have tips on how to access some logs that would be cool). Right now I'm running with a 32 bit architecture, I'll try to find a 64 bit OS (I have a RPi3 so it should be compatible) and I'll try via wasmer
    Ruwan Egodawatte
    @ruwanego
    Hi all, I'm new to Rust lang and RustPython... I'd like to contribute to the project and learn Rust in the process.. I've looked in to RustPython/RustPython#1175 "Extend the os module".. and if I want to start working on, say, get_exec_path().. where should I start? I might be asking for baby steps.. but I think baby steps are good for really UNDERSTANDING how the code works..
    12 replies
    Mathieu Dupuy
    @deronnax
    hello. No way to make a donation to the project ?
    Jeong YunWon
    @youknowone
    is there any free CI supporting 32-bit?
    4 replies
    Reuben Staley
    @CodeTriangle
    Hey all! Finally got RustPython working on OpenBSD. I had to fork libc, and I'm getting a few warnings from my local copy of that, but at least it works. I might also look into doing maintenance work other OSes that are not tested by CI. Other BSDs, perhaps?
    Ruwan Egodawatte
    @ruwanego
    when I cargo run, I get the error, "Python compile error from Lib/python_builtins/_frozen_importlib.py: Got unexpected token '.' at line 1 column 1"
    any suggestions?
    Noah
    @coolreader18
    Try running powershell scripts/symlinks-to-hardlinks.ps1
    You're on windows, right?
    Ruwan Egodawatte
    @ruwanego

    cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.26s
    Running target\debug\rustpython.exe

    thread 'main' has overflowed its stack
    error: process didn't exit successfully: target\debug\rustpython.exe (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

    @coolreader18 yes.. now I get this :(
    Windel Bouwman
    @windelbouwman_twitter
    @CodeTriangle nicely done! Are there specific steps to take, or does it work out of the box? In case of specific build steps, a guide would be great to have!
    Reuben Staley
    @CodeTriangle
    @windelbouwman_twitter I did have to fork libc because its support for BSDs and other more specialized kernals is lacking. So I had to add a few functions. Other than that, though, as of PR #1946, master contains all the code necessary to get it running on OpenBSD.
    I'm planning on submitting another PR to libc so that no extra effort is required.
    Jeong YunWon
    @youknowone
    supporting bsd sounds great :)
    why does it require forking libc? due to rust or due to rustpython?
    Noah
    @coolreader18
    @ruwanego make sure you run in release mode (cargo run --release), there's a lot going on with Python