adafruit / Adafruit_CircuitPython_Register

Python data descriptor classes to represent hardware registers on I2C devices.
MIT License
51 stars 23 forks source link

Not building on OSX #26

Closed mpechner closed 5 years ago

mpechner commented 5 years ago

Seems to have a different version of mpy-cross than the lastest micropython has. That successfully built

(circuitpython) Mikeys-MBP:Adafruit_CircuitPython_Register mpechner$ circuitpython-build-bundles --filename_prefix adafruit-circuitpython-register --library_location . Deleting existing build.

Generating VERSIONS

Zipping adafruit-circuitpython-register-py-1.7.1/examples/register_rwbits.py 1218 1536 adafruit-circuitpython-register-py-1.7.1/examples/register_rwbit.py 1232 1536 adafruit-circuitpython-register-py-1.7.1/examples/register_unarystruct.py 1288 1536 adafruit-circuitpython-register-py-1.7.1/examples/register_struct.py 1062 1536 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/i2c_bit.py 3469 3584 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/i2c_struct_array.py 4785 5120 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/i2c_bcd_datetime.py 4337 4608 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/i2c_bcd_alarm.py 7290 7680 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/init.py 0 0 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/i2c_bits.py 4676 5120 adafruit-circuitpython-register-py-1.7.1/lib/adafruit_register/i2c_struct.py 4293 4608

37888 B 37.0 kiB 0.0361328125 MiB Bundled in bundles/adafruit-circuitpython-register-py-1.7.1.zip

Building mpy-cross for circuitpython 2.3.1

M mpy-cross/Makefile M mpy-cross/gccollect.c M mpy-cross/main.c M mpy-cross/mpconfigport.h M mpy-cross/mphalport.h HEAD is now at 6e95c9040 Merge pull request #812 from dhalbert/2.x-filesystem-writability-on-boot Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. rm -f mpy-cross rm -f mpy-cross.map rm -rf build Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity. Generating build/genhdr/mpversion.h GEN build/genhdr/qstr.i.last QSTR updated GEN build/genhdr/qstrdefs.generated.h main.c:200:25: error: no member named 'native_arch' in 'struct mp_dynamic_compiler_t' mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X64;


main.c:200:39: error: use of undeclared identifier 'MP_NATIVE_ARCH_X64'
    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X64;
                                      ^
main.c:260:41: error: no member named 'native_arch' in 'struct mp_dynamic_compiler_t'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X86;
                    ~~~~~~~~~~~~~~~~~~~ ^
main.c:260:55: error: use of undeclared identifier 'MP_NATIVE_ARCH_X86'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X86;
                                                      ^
main.c:262:41: error: no member named 'native_arch' in 'struct mp_dynamic_compiler_t'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X64;
                    ~~~~~~~~~~~~~~~~~~~ ^
main.c:262:55: error: use of undeclared identifier 'MP_NATIVE_ARCH_X64'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_X64;
                                                      ^
main.c:264:41: error: no member named 'native_arch' in 'struct mp_dynamic_compiler_t'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV6;
                    ~~~~~~~~~~~~~~~~~~~ ^
main.c:264:55: error: use of undeclared identifier 'MP_NATIVE_ARCH_ARMV6'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV6;
                                                      ^
main.c:266:41: error: no member named 'native_arch' in 'struct mp_dynamic_compiler_t'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV7M;
                    ~~~~~~~~~~~~~~~~~~~ ^
main.c:266:55: error: use of undeclared identifier 'MP_NATIVE_ARCH_ARMV7M'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_ARMV7M;
                                                      ^
main.c:268:41: error: no member named 'native_arch' in 'struct mp_dynamic_compiler_t'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_XTENSA;
                    ~~~~~~~~~~~~~~~~~~~ ^
main.c:268:55: error: use of undeclared identifier 'MP_NATIVE_ARCH_XTENSA'
                    mp_dynamic_compiler.native_arch = MP_NATIVE_ARCH_XTENSA;
                                                      ^
12 errors generated.
make: *** [build/main.o] Error 1
Traceback (most recent call last):
  File "/Users/mpechner/dev/circuitpython/bin/circuitpython-build-bundles", line 11, in <module>
    load_entry_point('circuitpython-build-tools==1.2.6', 'console_scripts', 'circuitpython-build-bundles')()
  File "/Users/mpechner/dev/circuitpython/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mpechner/dev/circuitpython/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/mpechner/dev/circuitpython/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/mpechner/dev/circuitpython/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/mpechner/dev/circuitpython/lib/python3.7/site-packages/circuitpython_build_tools/scripts/build_bundles.py", line 173, in build_bundles
    build.mpy_cross(mpy_cross, version["tag"])
  File "/Users/mpechner/dev/circuitpython/lib/python3.7/site-packages/circuitpython_build_tools/build.py", line 85, in mpy_cross
    shutil.copy("build_deps/circuitpython/mpy-cross/mpy-cross", mpy_cross_filename)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 241, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'build_deps/circuitpython/mpy-cross/mpy-cross'
(circuitpython) Mikeys-MBP:Adafruit_CircuitPython_Register mpechner$ ls -l build_deps/circuitpython/mpy-cross/mpy
ladyada commented 5 years ago

hiya - that code isnt in this repo? its in circuitpython right? here's no C code here. also we're up to 4.0.0 so we recommend that version.

mpechner commented 5 years ago

That is the odd one. I just set up this environment. When I follow the instructions it is grabbing mpy-cross from the 2.x branch I guess.

I placed the latested mpy-cross, that I know compiles, into the code base at the location complained about in the messages. It gets replaced with the version from 2.31.

It was 1 or 2 in the morning. I'll investigate in the next couple of days.

I am at this package because I am falling down the BNO055 tutorial rabbit hole. Circuit python on the M0 express.

You will love the eventual ham radio application :-D

ladyada commented 5 years ago

which instructions? why are you building mpy-cross?

mpechner commented 5 years ago

I am not. You can see in the output of the circuitpython-build-bundles command as instructed in the README.md. The circuitpython-build-bundles grabbing it and building it.

ladyada commented 5 years ago

@sommersoft @dhalbert do you have any idea?

dhalbert commented 5 years ago

I can look at this Monday evening or Tuesday.

mpechner commented 5 years ago

circuitpython-build-tools builds a copy of mp-cross.
Look in: https://github.com/adafruit/circuitpython-build-https://github.com/adafruit/circuitpython-build-tools/blob/master/circuitpython_build_tools/scripts/build_mpy_cross.py

if name == "main": output_directory = sys.argv[1] os.makedirs(output_directory, exist_ok=True) for version in target_versions.VERSIONS: mpy_cross = output_directory + "/mpy-cross-" + version["name"] build.mpy_cross(mpy_cross, version["tag"])

then: https://github.com/adafruit/circuitpython-build-tools/blob/master/circuitpython_build_tools/target_versions.py VERSIONS = [ {"tag": "2.3.1", "name": "2.x"}, {"tag": "3.0.0", "name": "3.x"}, {"tag": "4.0.0-alpha.2", "name": "4.x"}, ]

So the last checkin for target_versions.py re-added version 2.31. Th is is why you see the errors.

mpechner commented 5 years ago

Fixing this just became a moot point for me. On the BNO055 page: "Turns out the BNO0055 breakout board is quite sensitive to RF interference from nearby wires with higher frequency square waves."

I was intending for someone who who will be transmitting on the ham radio frequencies on 2M, 70CM and 20M to where one.

Also I found that I did not need to jump down the Rabbit hole. The latest circuit python does have the BNO055 driver installed.

ladyada commented 5 years ago

ok please close if this is resolved?

mpechner commented 5 years ago

Resolved because I do not need it.

Not resolved because circuitpython-build-tools is building the 2.31 and failing on OSX.

So open a bug on that project??

ladyada commented 5 years ago

yeah do you mind opening the issue there? that would be really helpful to keep track :)

mpechner commented 5 years ago

Opened issue 43 ion project circuitpython-build-tools