cknave / elf2djgpp

Convert ELF object files to DJGPP COFF-GO32 objects
MIT License
10 stars 2 forks source link

Python 3.11 needed to build the example #1

Closed stuaxo closed 1 year ago

stuaxo commented 1 year ago

typing.Self was introduced in python 3.11 - the readme mentions 3.9 and may want bumping.

I was using rustup and had to create a file rust-toolchain with the content nightly in the example directory to build (though; I'm very new to rust so not entirely sure what I'm doing).

After that I could build and run the example in dosbox (though on first runthrough I lost concentration so had run make not make debug or `make release).

$ make                 
sh build-dos-lib.sh --release
Building release target...
    Finished release [optimized] target(s) in 0.04s
Converting ELF objects to COFF-GO32...
Traceback (most recent call last):
  File "/home/stu/.virtualenvs/elf2djgpp/bin/elf2djgpp", line 8, in <module>
    sys.exit(main())
  File "/home/stu/projects/mine/dos-rust-projects/elf2djgpp/elf2djgpp/main.py", line 55, in main
    coff_obj.write(f)
  File "/home/stu/projects/mine/dos-rust-projects/elf2djgpp/elf2djgpp/coff_go32.py", line 194, in write
    from . import binfmt
  File "/home/stu/projects/mine/dos-rust-projects/elf2djgpp/elf2djgpp/binfmt.py", line 26, in <module>
    class COFFFileHeader:
  File "/home/stu/projects/mine/dos-rust-projects/elf2djgpp/elf2djgpp/binfmt.py", line 36, in COFFFileHeader
    def from_coff(cls, coff: coff_go32.COFF) -> typing.Self:
AttributeError: module 'typing' has no attribute 'Self'
make: *** [Makefile:32: build/release/librust_lib.a] Error 1
cknave commented 1 year ago

typing.Self was introduced in python 3.11 - the readme mentions 3.9 and may want bumping.

Doh! Fixed in 6f7db413a6e68913dc6df2e0ac75064bff87a0f2.

I was using rustup and had to create a file rust-toolchain with the content nightly in the example directory to build (though; I'm very new to rust so not entirely sure what I'm doing).

That makes two of us :smile:

Since the example requires nightly, I added a rust-toolchain.toml file to the example project in 42e5646c47b1f4c3438c5944cae46ebfbb51c81d.

stuaxo commented 1 year ago

That makes two of us :smile: That's reassuring, I think being able to make stuff for DOS might be what gets me into rust :)

Re: needing rust nightly - I don't know why it's the place that you get -Z

error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel

TLDR: Probably worth mentioning in the readme as well; maybe not everyone uses rustup ?

Closing this ticket as the 3.11 thing is sorted.