orchestracities / ngsi-timeseries-api

QuantumLeap: a FIWARE Generic Enabler to support the usage of NGSIv2 (and NGSI-LD experimentally) data in time-series databases
https://quantumleap.rtfd.io/
MIT License
37 stars 49 forks source link

Broken dev env on Apple silicon #734

Closed c0c0n3 closed 11 months ago

c0c0n3 commented 11 months ago

Describe the bug

Can't set up even a basic dev env on Apple silicon---M1 and M2. Last year we had a working setup on the M1, but now it looks like it's impossible to reproduce it starting from scratch. Most likely because we never pinned deps. Ouch!

To Reproduce

We tried a fresh install both on a Mac M1 and M2 with Homebrew. Here's the steps. First install the brew command

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
$ (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/andrea/.bash_profile
$ eval "$(/opt/homebrew/bin/brew shellenv)"

then use it to install Python 3.8 and pipenv---notice there's no pinning of pipenv version:

$ brew install python@3.8
$ brew install pipenv
$ pipenv --version
pipenv, version 2023.7.23

Finally get into the QL repo's root and install all the Python deps

$ pipenv install --dev

This step fails both on M1 and M2 with lots of errors similar to the following:

Installing dependencies from Pipfile.lock (f71fd9)...
An error occurred while installing asn1crypto==1.4.0 --hash=sha256:4bcdf33c861c7d40bdcd74d8e4dd7661aac320fcdf40b9a3f95b4ee12fde2fa8 --hash=sha256:f4f6e119474e58e04a2b1af817eb585b4fd72bdd89b998624712b5c99be7641c! Will try again.
An error occurred while installing attrs==21.4.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' --hash=sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4 --hash=sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd! Will try again.
An error occurred while installing bitmath==1.3.3.1 --hash=sha256:293325f01e65defe966853111df11d39215eb705a967cb115851da8c4cfa3eb8! Will try again.
An error occurred while installing certifi...

...lots more broken packages

Installing initially failed dependencies...
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/bin/pipenv", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/cli/command.py", line 233, in install
    do_install(
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 170, in do_install
    do_init(
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 776, in do_init
    do_install_dependencies(
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 455, in do_install_dependencies
    batch_install(
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 596, in batch_install
    batch_install_iteration(
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 538, in batch_install_iteration
    _cleanup_procs(project, procs, failed_deps_queue, retry=retry)
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/routines/install.py", line 651, in _cleanup_procs
    dep.use_pep517 = True
    ^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pipenv/2023.7.23/libexec/lib/python3.11/site-packages/pipenv/vendor/requirementslib/models/common.py", line 18, in __setattr__
    raise ValueError(f'"{self.__class__.__name__}" object has no field "{name}"')
ValueError: "Requirement" object has no field "use_pep517"

Expected behavior

Running the above steps should work.

Environment

Additional context

Tried the same using a different package manager (Nix) and still got the same errors. I also tried all the various workarounds detailed here:

but had no luck.