by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    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
    Reuben Staley
    @CodeTriangle
    @youknowone the libc library contains serious deficiencies for some of the more obscure operating systems. Lots of constants and functions are undefined for OpenBSD. Other BSDs too, probably.
    It's because of a lot of factors, one of them being that each BSD generally implements its own slightly modified kernel. It's easy to generalize the library for all of linux because there's only one kernel. But it's not that easy with BSDs
    Reuben Staley
    @CodeTriangle
    That, and that likely no one has done the Rust work for them because the main use cases of many BSDs is servers, not development with a cutting-edge technology.
    James Webber
    @jamestwebber
    I was trying to get some tests working and found that BytesIO.getbuffer is not implemented. Was going to give it a try but was wondering if anyone had thought about it yet doc here
    1 reply
    It seems maybe a bit tricky because it returns a mutable byte string–updating it will modify the value in the IO object
    in CPython they actually implement a little helper struct to deal with that, maybe that's the way to go in rust too
    Ruwan Egodawatte
    @ruwanego
    Hello All, https://github.com/ruwanego/RustPython-intro this is something that I've been working on for my own reference.. Hope that this will help the people new to RustPython.. Still WIP.. maybe you all can contribute.. and make it better :)
    I heavily copied the talk by @windelbouwman and @shinglyu.. (I wanted something to read through)
    Ruwan Egodawatte
    @ruwanego
    @windelbouwman_twitter
    James Webber
    @jamestwebber
    nice! that seems very useful