platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.8k stars 785 forks source link

Error on using `pio remote test` from Azure DevOps Pipelines #4580

Closed juniorsaldanha closed 1 year ago

juniorsaldanha commented 1 year ago

Context

We have a firmware developed with test on a Azure DevOps repo, for now we do use azure to build "it is not this pipeline", and delivery the firmware artfacts to production, now we have developed unittests, and we are trying to do the pio remote test just like we do from our computers to the remote raspberry that has the physical connection to the hardware for running the tests.

With this context im getting the following error on Azure DevOps Pipelines. Ive tried to fix installing some dependencies, but still not working. Bellow follows the "Pipeline". On Step 4, gives an error when it runs the pio remote test command and tries to install some stuff.

Some of the attempts to solve

Azure DevOps Pipeline

Step1: Install PlatformIO dependencies

sudo apt-get update -yqq
sudo apt-get install python3-dev libffi-dev libssl-dev -yqq

Step2: Upgrade PIP

python -m pip install --upgrade pip

Step3: Install PlatformIO

pip install -U platformio

Step4: Run tests on the embedded target

pio remote test -d firmware  -e test

ERROR MESSAGE

2023-03-17T19:42:52.9426964Z pio remote test -d firmware  -e test
2023-03-17T19:42:52.9427552Z ##[debug]Agent.Version=2.217.2
2023-03-17T19:42:52.9428205Z ##[debug]agent.tempDirectory=/home/vsts/work/_temp
2023-03-17T19:42:52.9428855Z ##[debug]check path : /home/vsts/work/_temp
2023-03-17T19:42:52.9434834Z ========================== Starting Command Output ===========================
2023-03-17T19:42:52.9436084Z ##[debug]which '/usr/bin/bash'
2023-03-17T19:42:52.9437793Z ##[debug]found: '/usr/bin/bash'
2023-03-17T19:42:52.9438773Z ##[debug]/usr/bin/bash arg: /home/vsts/work/_temp/1bff3c93-b31e-4c90-8752-b4e61dd89882.sh
2023-03-17T19:42:52.9441764Z ##[debug]exec tool: /usr/bin/bash
2023-03-17T19:42:52.9442452Z ##[debug]arguments:
2023-03-17T19:42:52.9443256Z ##[debug]   /home/vsts/work/_temp/1bff3c93-b31e-4c90-8752-b4e61dd89882.sh
2023-03-17T19:42:52.9443992Z [command]/usr/bin/bash /home/vsts/work/_temp/1bff3c93-b31e-4c90-8752-b4e61dd89882.sh
2023-03-17T19:42:53.2344372Z ********************************************************************************
2023-03-17T19:42:53.2349729Z If you like PlatformIO, please:
2023-03-17T19:42:53.2350521Z - follow us on Twitter to stay up-to-date on the latest project news > https://twitter.com/PlatformIO_Org
2023-03-17T19:42:53.2351226Z - star it on GitHub > https://github.com/platformio/platformio
2023-03-17T19:42:53.2351684Z - try PlatformIO IDE for embedded development > https://platformio.org/platformio-ide
2023-03-17T19:42:53.2352064Z ********************************************************************************
2023-03-17T19:42:53.2352235Z 
2023-03-17T19:42:53.2365020Z Tool Manager: Installing platformio/contrib-pysite @ ~2.310.0
2023-03-17T19:42:55.8477514Z Downloading 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
2023-03-17T19:42:56.1187768Z Unpacking
2023-03-17T19:42:56.5584843Z Tool Manager: contrib-pysite@2.310.220222 has been installed!
2023-03-17T19:42:57.0908181Z DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453
2023-03-17T19:42:57.2255247Z Collecting twisted[tls]==22.1.0
2023-03-17T19:42:57.3141083Z   Downloading Twisted-22.1.0.tar.gz (3.7 MB)
2023-03-17T19:42:57.4043796Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 42.5 MB/s eta 0:00:00
2023-03-17T19:42:57.8682092Z   Installing build dependencies: started
2023-03-17T19:43:12.2191982Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:12.2199978Z   Getting requirements to build wheel: started
2023-03-17T19:43:12.9159829Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:12.9179766Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:13.5958734Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:13.7328961Z Collecting incremental>=21.3.0
2023-03-17T19:43:13.7350600Z   Using cached incremental-22.10.0.tar.gz (18 kB)
2023-03-17T19:43:13.7445926Z   Installing build dependencies: started
2023-03-17T19:43:20.4019561Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:20.4024640Z   Getting requirements to build wheel: started
2023-03-17T19:43:20.5666404Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:20.5682023Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:20.7367938Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:20.7516782Z Collecting constantly>=15.1
2023-03-17T19:43:20.7563360Z   Downloading constantly-15.1.0.tar.gz (21 kB)
2023-03-17T19:43:20.7623705Z   Preparing metadata (setup.py): started
2023-03-17T19:43:20.9441056Z   Preparing metadata (setup.py): finished with status 'done'
2023-03-17T19:43:20.9592407Z Collecting Automat>=0.8.0
2023-03-17T19:43:20.9649858Z   Downloading Automat-22.10.0.tar.gz (59 kB)
2023-03-17T19:43:20.9687904Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 59.1/59.1 kB 31.4 MB/s eta 0:00:00
2023-03-17T19:43:20.9810087Z   Preparing metadata (setup.py): started
2023-03-17T19:43:24.1821547Z   Preparing metadata (setup.py): finished with status 'done'
2023-03-17T19:43:24.1974767Z Collecting hyperlink>=17.1.1
2023-03-17T19:43:24.2029309Z   Downloading hyperlink-21.0.0.tar.gz (140 kB)
2023-03-17T19:43:24.2080834Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.7/140.7 kB 48.5 MB/s eta 0:00:00
2023-03-17T19:43:24.2208568Z   Installing build dependencies: started
2023-03-17T19:43:30.9350314Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:30.9355253Z   Getting requirements to build wheel: started
2023-03-17T19:43:31.0817055Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:31.0836886Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:31.2461252Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:31.2668407Z Collecting typing-extensions>=3.6.5
2023-03-17T19:43:31.2741954Z   Downloading typing_extensions-4.5.0.tar.gz (52 kB)
2023-03-17T19:43:31.2784083Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.4/52.4 kB 23.6 MB/s eta 0:00:00
2023-03-17T19:43:31.2861170Z   Installing build dependencies: started
2023-03-17T19:43:32.4652451Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:32.4657602Z   Getting requirements to build wheel: started
2023-03-17T19:43:32.5500403Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:32.5510144Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:32.6229678Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:32.6414712Z Collecting attrs>=19.2.0
2023-03-17T19:43:32.6465317Z   Downloading attrs-22.2.0.tar.gz (215 kB)
2023-03-17T19:43:32.6516810Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 215.9/215.9 kB 77.0 MB/s eta 0:00:00
2023-03-17T19:43:32.6864524Z   Installing build dependencies: started
2023-03-17T19:43:39.4126598Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:39.4131548Z   Getting requirements to build wheel: started
2023-03-17T19:43:39.5726788Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:39.5745551Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:39.7527399Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:39.8491285Z Collecting zope.interface>=4.4.2
2023-03-17T19:43:39.8541538Z   Downloading zope.interface-6.0.tar.gz (246 kB)
2023-03-17T19:43:39.8597670Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 246.3/246.3 kB 77.0 MB/s eta 0:00:00
2023-03-17T19:43:39.8930232Z   Preparing metadata (setup.py): started
2023-03-17T19:43:40.0886646Z   Preparing metadata (setup.py): finished with status 'done'
2023-03-17T19:43:40.1089021Z Collecting pyopenssl>=16.0.0
2023-03-17T19:43:40.1148381Z   Downloading pyOpenSSL-23.0.0.tar.gz (182 kB)
2023-03-17T19:43:40.1197340Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 182.4/182.4 kB 71.4 MB/s eta 0:00:00
2023-03-17T19:43:40.1418066Z   Installing build dependencies: started
2023-03-17T19:43:46.9012751Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:46.9017892Z   Getting requirements to build wheel: started
2023-03-17T19:43:47.0585946Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:47.0605036Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:47.2320292Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:47.2512260Z Collecting idna>=2.4
2023-03-17T19:43:47.2560041Z   Downloading idna-3.4.tar.gz (183 kB)
2023-03-17T19:43:47.2608988Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 183.1/183.1 kB 73.5 MB/s eta 0:00:00
2023-03-17T19:43:47.2788416Z   Installing build dependencies: started
2023-03-17T19:43:48.4716620Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:48.4721241Z   Getting requirements to build wheel: started
2023-03-17T19:43:48.5461211Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:48.5468830Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:48.6310205Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:48.6457541Z Collecting service-identity>=18.1.0
2023-03-17T19:43:48.6557816Z   Downloading service-identity-21.1.0.tar.gz (40 kB)
2023-03-17T19:43:48.6598197Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.1/40.1 kB 19.2 MB/s eta 0:00:00
2023-03-17T19:43:48.6732490Z   Installing build dependencies: started
2023-03-17T19:43:55.4049783Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:43:55.4054568Z   Getting requirements to build wheel: started
2023-03-17T19:43:55.5548433Z   Getting requirements to build wheel: finished with status 'done'
2023-03-17T19:43:55.5564724Z   Preparing metadata (pyproject.toml): started
2023-03-17T19:43:55.7248205Z   Preparing metadata (pyproject.toml): finished with status 'done'
2023-03-17T19:43:55.7708427Z Collecting six
2023-03-17T19:43:55.7749072Z   Downloading six-1.16.0.tar.gz (34 kB)
2023-03-17T19:43:55.7831658Z   Preparing metadata (setup.py): started
2023-03-17T19:43:55.9643416Z   Preparing metadata (setup.py): finished with status 'done'
2023-03-17T19:43:56.1142494Z Collecting cryptography<40,>=38.0.0
2023-03-17T19:43:56.1199510Z   Downloading cryptography-39.0.2.tar.gz (604 kB)
2023-03-17T19:43:56.1277759Z      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 604.3/604.3 kB 111.4 MB/s eta 0:00:00
2023-03-17T19:43:56.2303437Z   Installing build dependencies: started
2023-03-17T19:44:19.5220922Z   Installing build dependencies: finished with status 'done'
2023-03-17T19:44:19.5225960Z   Getting requirements to build wheel: started
2023-03-17T19:44:19.6707061Z   Getting requirements to build wheel: finished with status 'error'
2023-03-17T19:44:19.6769246Z   error: subprocess-exited-with-error
2023-03-17T19:44:19.6769747Z   
2023-03-17T19:44:19.6770525Z   × Getting requirements to build wheel did not run successfully.
2023-03-17T19:44:19.6770989Z   │ exit code: 1
2023-03-17T19:44:19.6771373Z   ╰─> [32 lines of output]
2023-03-17T19:44:19.6771700Z       
2023-03-17T19:44:19.6772089Z               =============================DEBUG ASSISTANCE==========================
2023-03-17T19:44:19.6772562Z               If you are seeing an error here please try the following to
2023-03-17T19:44:19.6772980Z               successfully install cryptography:
2023-03-17T19:44:19.6773308Z       
2023-03-17T19:44:19.6773698Z               Upgrade to the latest pip and try again. This will fix errors for most
2023-03-17T19:44:19.6774265Z               users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2023-03-17T19:44:19.6774763Z               =============================DEBUG ASSISTANCE==========================
2023-03-17T19:44:19.6775138Z       
2023-03-17T19:44:19.6775478Z       Traceback (most recent call last):
2023-03-17T19:44:19.6776129Z         File "/home/vsts/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
2023-03-17T19:44:19.6776637Z           main()
2023-03-17T19:44:19.6777237Z         File "/home/vsts/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
2023-03-17T19:44:19.6777861Z           json_out['return_val'] = hook(**hook_input['kwargs'])
2023-03-17T19:44:19.6778573Z         File "/home/vsts/.local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
2023-03-17T19:44:19.6779131Z           return hook(config_settings)
2023-03-17T19:44:19.6779798Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
2023-03-17T19:44:19.6780492Z           return self._get_build_requires(config_settings, requirements=['wheel'])
2023-03-17T19:44:19.6781228Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 320, in _get_build_requires
2023-03-17T19:44:19.6782062Z           self.run_setup()
2023-03-17T19:44:19.6782680Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools/build_meta.py", line 335, in run_setup
2023-03-17T19:44:19.6783183Z           exec(code, locals())
2023-03-17T19:44:19.6783567Z         File "<string>", line 18, in <module>
2023-03-17T19:44:19.6785162Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools_rust/__init__.py", line 1, in <module>
2023-03-17T19:44:19.6785706Z           from .build import build_rust
2023-03-17T19:44:19.6786342Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools_rust/build.py", line 29, in <module>
2023-03-17T19:44:19.9803958Z           from .command import RustCommand
2023-03-17T19:44:19.9807753Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools_rust/command.py", line 9, in <module>
2023-03-17T19:44:19.9808279Z           from .extension import RustExtension
2023-03-17T19:44:19.9808878Z         File "/tmp/pip-build-env-ftwqj6qn/overlay/local/lib/python3.10/dist-packages/setuptools_rust/extension.py", line 11, in <module>
2023-03-17T19:44:19.9809376Z           from semantic_version import SimpleSpec
2023-03-17T19:44:19.9809824Z       ModuleNotFoundError: No module named 'semantic_version'
2023-03-17T19:44:19.9810177Z       [end of output]
2023-03-17T19:44:19.9810432Z   
2023-03-17T19:44:19.9810737Z   note: This error originates from a subprocess, and is likely not a problem with pip.
2023-03-17T19:44:19.9811203Z error: subprocess-exited-with-error
2023-03-17T19:44:19.9811396Z 
2023-03-17T19:44:19.9811755Z × Getting requirements to build wheel did not run successfully.
2023-03-17T19:44:19.9812056Z │ exit code: 1
2023-03-17T19:44:19.9812319Z ╰─> See above for output.
2023-03-17T19:44:19.9812439Z 
2023-03-17T19:44:19.9812796Z note: This error originates from a subprocess, and is likely not a problem with pip.
2023-03-17T19:44:19.9813146Z Error: 
2023-03-17T19:44:19.9813265Z 
2023-03-17T19:44:19.9813492Z Please ensure that the next packages are installed:
2023-03-17T19:44:19.9813630Z 
2023-03-17T19:44:19.9814008Z sudo apt install python3-dev libffi-dev libssl-dev
2023-03-17T19:44:19.9814221Z 
2023-03-17T19:44:19.9815117Z ##[debug]Exit code 1 received from tool '/usr/bin/bash'
2023-03-17T19:44:19.9815780Z ##[debug]STDIO streams have closed for tool '/usr/bin/bash'
2023-03-17T19:44:19.9844330Z ##[error]Bash exited with code '1'.
2023-03-17T19:44:19.9853001Z ##[debug]Processed: ##vso[task.issue type=error;]Bash exited with code '1'.
2023-03-17T19:44:19.9854061Z ##[debug]task result: Failed
2023-03-17T19:44:19.9856355Z ##[debug]Processed: ##vso[task.complete result=Failed;done=true;]
2023-03-17T19:44:19.9859369Z ##[section]Finishing: Run tests on the embedded target
ivankravets commented 1 year ago

See https://stackoverflow.com/questions/69372488/python-3-6-9-importerror-no-module-named-setuptools-rust-and-a-command-pytho

Please add the following command before pio remote ...

python3 -m pip install --upgrade pip