cmsis-pack-manager is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs

Overview

cmsis-pack-manager

cmsis-pack-manager is a python module, Rust crate and command line utility for managing current device information that is stored in many CMSIS PACKs. Users of cmsis-pack-manager may query for information such as processor type, flash algorithm and memory layout information in a python program or through the command line utility, pack-manager, provided as part of this module.

CI Status

Windows Build status Mac and Linux Build Status

Wheels

The last step of CI uploads binary wheels to this S3 bucket.

DOCS!

They live here: https://pyocd.github.io/cmsis-pack-manager/

Building

To build cmsis-pack-manager locally, Install a stable rust compiler. See https://rustup.rs/ for details on installing rustup, the rust toolchain updater. Afterwards, run rustup update stable to get the most recent stable rust toolchain and build system.

After installing the rust toolchain and downloading a stable compiler, run python2 setup.py bdist_wheel from the root of this repo to generate a binary wheel (.whl file) in the same way as we release.

For testing purposes, there is a CLI written in Rust within the rust workspace as the package cmsis-cli. For example From the rust directory, cargo run -p cmsis-cli -- update builds this testing CLI and runs the update command, for example.

Comments
  • Using pack manager on arm-based system

    Using pack manager on arm-based system

    I've tried to install newest pyocd version on armbian, but when trying to install it even with pip, every time installed version of pack manager is 0.1. Is it possible to install newest version of pack manager on arm-based system? sorry for newbie question, but i've tried to google it, without any results.

    opened by harrrson 33
  • build problem on FreeBSD

    build problem on FreeBSD

    Hello world, I have problem building on FreeBSD.. any hints welcome :-)

    (venv37bsd) python setup.py -v install
    fatal: not a git repository (or any parent up to mount point /ztuff)
    Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
    running install
    running bdist_egg
    running egg_info
    writing cmsis_pack_manager.egg-info/PKG-INFO
    writing dependency_links to cmsis_pack_manager.egg-info/dependency_links.txt
    writing entry points to cmsis_pack_manager.egg-info/entry_points.txt
    writing requirements to cmsis_pack_manager.egg-info/requires.txt
    writing top-level names to cmsis_pack_manager.egg-info/top_level.txt
    'license_file' option was not specified
    reading manifest file 'cmsis_pack_manager.egg-info/SOURCES.txt'
    writing manifest file 'cmsis_pack_manager.egg-info/SOURCES.txt'
    installing library code to build/bdist.freebsd-12.0-RELEASE-p3-amd64/egg
    running install_lib
    running build_py
    not copying cmsis_pack_manager/__init__.py (output up-to-date)
    not copying cmsis_pack_manager/pack_manager.py (output up-to-date)
    error: [Errno 2] No such file or directory: 'cargo': 'cargo'
    
    (venv37bsd) pip show cargo
    Name: cargo
    Version: 0.1.1
    Summary: Transform dictionaries into Python objects
    Home-page: github.com/eugene-eeo/cargo
    Author: Eugene Eeo
    Author-email: [email protected]
    License: UNKNOWN
    Location: /ztuff/cederom/(..)/venv37bsd/lib/python3.7/site-packages
    Requires:
    Required-by:
    
    (venv37bsd) python --version
    Python 3.7.3
    
    (venv37bsd) uname -a
    FreeBSD 0xCFC2 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
    
    (venv37bsd) ls
    LICENSE                         appveyor.yml                    cmsis_pack_manager.egg-info     setup.py
    README.md                       build                           requirements.txt                setup_requirements.txt
    apache-2.0.txt                  build-wheels.sh                 rust                            test_requirements.txt
    appveyor.bat                    cmsis_pack_manager              setup.cfg                       tests
    (venv37bsd)
    

    Would be really nice if cmsis-pack-manager was also provided in PyPI as sources so it can be automtically compiled by pip on platforms that have no binaries provided :-)

    opened by cederom 33
  • Switch HTTP implementation to `reqwest`

    Switch HTTP implementation to `reqwest`

    The prior HTTP implementation was hyper, and provided a low level of abstraction. This low level required me to implement redirect and proxy support. I omitted proxy support.

    Now, we use reqwest to handle HTTP. This allows us to delete our custom (but not special) redirect support and pick up proxy support.


    Note: This contains format changes and a minor refactor (move vidx/pidx-related code to methods on DownloadContext)

    opened by theotherjimmy 21
  • Install with pip >=20 always triggers build

    Install with pip >=20 always triggers build

    Downgrading to < 20 uses wheel.

    $ pip --version
    pip 20.0.1 from /home/juho/py3/lib/python3.5/site-packages/pip (python 3.5)
    (py3) [email protected]:~$ pip install cmsis-pack-manager
    Collecting cmsis-pack-manager
      Using cached cmsis-pack-manager-0.2.9.tar.gz (42 kB)
    Collecting appdirs>=1.4
      Using cached appdirs-1.4.3-py2.py3-none-any.whl (12 kB)
    Collecting milksnake>=0.1.2
      Using cached milksnake-0.1.5-py2.py3-none-any.whl (9.6 kB)
    Processing ./.cache/pip/wheels/e4/76/4d/a95b8dd7b452b69e8ed4f68b69e1b55e12c9c9624dd962b191/PyYAML-5.3-cp35-cp35m-linux_x86_64.whl
    Collecting cffi>=1.6.0
      Using cached cffi-1.13.2-cp35-cp35m-manylinux1_x86_64.whl (397 kB)
    Processing ./.cache/pip/wheels/f2/9a/90/de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511/pycparser-2.19-py2.py3-none-any.whl
    Building wheels for collected packages: cmsis-pack-manager
      Building wheel for cmsis-pack-manager (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-tar7vy6_
           cwd: /tmp/pip-install-aa67zdj0/cmsis-pack-manager/
      Complete output (9 lines):
      running bdist_wheel
      running build
      running build_py
      creating build/lib
      creating build/lib/cmsis_pack_manager
      copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
      copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
      copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
      error: [Errno 2] No such file or directory: 'cargo'
      ----------------------------------------
      ERROR: Failed building wheel for cmsis-pack-manager
      Running setup.py clean for cmsis-pack-manager
    Failed to build cmsis-pack-manager
    Installing collected packages: appdirs, pycparser, cffi, milksnake, pyyaml, cmsis-pack-manager
        Running setup.py install for cmsis-pack-manager ... error
        ERROR: Command errored out with exit status 1:
         command: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jt_ysbz4/install-record.txt --single-version-externally-managed --compile --install-headers /home/juho/py3/include/site/python3.5/cmsis-pack-manager
             cwd: /tmp/pip-install-aa67zdj0/cmsis-pack-manager/
        Complete output (9 lines):
        running install
        running build
        running build_py
        creating build/lib
        creating build/lib/cmsis_pack_manager
        copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
        copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
        copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
        error: [Errno 2] No such file or directory: 'cargo'
        ----------------------------------------
    ERROR: Command errored out with exit status 1: /home/juho/py3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"'; __file__='"'"'/tmp/pip-install-aa67zdj0/cmsis-pack-manager/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jt_ysbz4/install-record.txt --single-version-externally-managed --compile --install-headers /home/juho/py3/include/site/python3.5/cmsis-pack-manager Check the logs for full command output.
    (py3) [email protected]:~$ pip install pip==19.3.1
    Collecting pip==19.3.1
      Using cached pip-19.3.1-py2.py3-none-any.whl (1.4 MB)
    Installing collected packages: pip
      Attempting uninstall: pip
        Found existing installation: pip 20.0.1
        Uninstalling pip-20.0.1:
          Successfully uninstalled pip-20.0.1
    Successfully installed pip-19.3.1
    (py3) [email protected]:~$ pip install cmsis-pack-manager
    Collecting cmsis-pack-manager
      Using cached https://files.pythonhosted.org/packages/fd/6b/b1f8f4117b3a4efafbdb04eaa7e7685a395cda565b3b221860d04f2a827c/cmsis_pack_manager-0.2.9-py2.py3-none-manylinux1_x86_64.whl
    Requirement already satisfied: pyyaml>=3.12 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (5.3)
    Requirement already satisfied: milksnake>=0.1.2 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (0.1.5)
    Requirement already satisfied: appdirs>=1.4 in ./py3/lib/python3.5/site-packages (from cmsis-pack-manager) (1.4.3)
    Requirement already satisfied: cffi>=1.6.0 in ./py3/lib/python3.5/site-packages (from milksnake>=0.1.2->cmsis-pack-manager) (1.13.2)
    Requirement already satisfied: pycparser in ./py3/lib/python3.5/site-packages (from cffi>=1.6.0->milksnake>=0.1.2->cmsis-pack-manager) (2.19)
    Installing collected packages: cmsis-pack-manager
    Successfully installed cmsis-pack-manager-0.2.9
    WARNING: You are using pip version 19.3.1; however, version 20.0 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.
    
    opened by juhhov 15
  • cmsis-pack-manager 0.1.1

    cmsis-pack-manager 0.1.1

    on a raspberry pi running ubuntu 18.04.2 "pip3 install pyocd" complains about "cmsis-pack-manager 0.1.1":

    ERROR: pyocd 0.21.0 has requirement cmsis-pack-manager>=0.2.7, but you'll have cmsis-pack-manager 0.1.1 which is incompatible.
    Installing collected packages: cmsis-pack-manager
      Found existing installation: cmsis-pack-manager 0.1.1
        Uninstalling cmsis-pack-manager-0.1.1:
          Successfully uninstalled cmsis-pack-manager-0.1.1
    Successfully installed cmsis-pack-manager-0.1.1
    

    upon investigation, this https://github.com/ARMmbed/cmsis-pack-manager/blob/e26f87d797715aa2f5111b6333e0908dea8ece80/setup.py#L55

    seems to be the cause.

    after downloading 0.2.8 source tarball from pypi, changing "0.1.1" to "0.2.8", building cmsis-pack-manager and installation in a new virtualenv, installation of pyocd finally succeeds.

    opened by rmu75 9
  • Add HTTP proxy support

    Add HTTP proxy support

    This is a request to add support for the http_proxy environment variable so that the index and packs can be downloaded through a proxy server.

    See below from @jeromecoutant in mbedmicro/pyOCD#638. The gist is that curl is able to access the Keil index files from a corporate network behind a proxy, where CPM cannot (it fails with a DNS error).

    Hi Back to this issue... I agree that I have some network/PC restrictions due to company policy...
    $ pyocd pack --install stm32f303
    0000348:INFO:__main__:No pack index present, downloading now...
    May 03 11:43:05.522 ERRO No such host is known. (os error 11001), uri: http://www.keil.com/pack/keil.vidx
    May 03 11:43:05.523 ERRO No such host is known. (os error 11001), uri: http://www.keil.com/pack/keil.pidx
    

    OK

    $ curl -L http://www.keil.com/pack/keil.vidx -O
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5668  100  5668    0     0  21308      0 --:--:-- --:--:-- --:--:-- 21308
    100  9622  100  9622    0     0  17590      0 --:--:-- --:--:-- --:--:-- 17590
    
    $ curl -L http://www.keil.com/pack/keil.pidx -O
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5672  100  5672    0     0  60340      0 --:--:-- --:--:-- --:--:-- 60340
    100 14216  100 14216    0     0  19771      0 --:--:-- --:--:-- --:--:-- 19771
    

    Seems that curl is calling directly GET HTTP function, whereas pack manager use first DNS call without any proxy setting.

    All commands using http_proxy environment variable are working (git clone, curl, …)

    So it seems that restrictions I have could be avoid ?

    enhancement 
    opened by flit 8
  • Error Building Wheel with Python 3.11

    Error Building Wheel with Python 3.11

    I was attempting to update my Zephyr workspace after updating to Fedora 37 and it seems as though the wheel for cmsis-pack-manager no longer builds:

    (.venv) [mbanducci zephyr]$ pip install cmsis-pack-manager
    Collecting cmsis-pack-manager
      Using cached cmsis-pack-manager-0.4.0.tar.gz (43 kB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... done
      Preparing metadata (pyproject.toml) ... done
    Collecting appdirs<2.0,>=1.4
      Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
    Collecting milksnake<1.0,>=0.1.5
      Using cached milksnake-0.1.5-py2.py3-none-any.whl (9.6 kB)
    Requirement already satisfied: pyyaml<7.0,>=6.0 in /home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages (from cmsis-pack-manager) (6.0)
    Collecting cffi>=1.6.0
      Using cached cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462 kB)
    Collecting pycparser
      Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
    Building wheels for collected packages: cmsis-pack-manager
      Building wheel for cmsis-pack-manager (pyproject.toml) ... error
      error: subprocess-exited-with-error
      
      × Building wheel for cmsis-pack-manager (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [285 lines of output]
          /tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
            warnings.warn(msg, warning_class)
          running bdist_wheel
          running build
          running build_py
          creating build/lib
          creating build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/pack_manager.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/_version.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/_native__ffi.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/_native.py -> build/lib/cmsis_pack_manager
          copying cmsis_pack_manager/__init__.py -> build/lib/cmsis_pack_manager
              Updating crates.io index
             Compiling libc v0.2.137
             Compiling autocfg v1.1.0
             Compiling cfg-if v1.0.0
             Compiling cfg-if v0.1.10
             Compiling futures v0.1.31
             Compiling log v0.4.17
             Compiling byteorder v1.4.3
             Compiling semver-parser v0.7.0
             Compiling either v1.8.0
             Compiling maybe-uninit v2.0.0
             Compiling lazy_static v1.4.0
             Compiling cc v1.0.76
             Compiling scopeguard v1.1.0
             Compiling proc-macro2 v1.0.47
             Compiling unicode-ident v1.0.5
             Compiling quote v1.0.21
             Compiling fnv v1.0.7
             Compiling tinyvec_macros v0.1.0
             Compiling syn v1.0.103
             Compiling rand_core v0.4.2
             Compiling unicode-bidi v0.3.8
             Compiling once_cell v1.16.0
             Compiling version_check v0.9.4
             Compiling spin v0.5.2
             Compiling untrusted v0.7.1
             Compiling tinyvec v1.6.0
             Compiling memchr v2.5.0
             Compiling lock_api v0.3.4
             Compiling matches v0.1.9
             Compiling serde_derive v1.0.147
             Compiling itoa v0.4.8
             Compiling serde v1.0.147
             Compiling semver v0.9.0
             Compiling autocfg v0.1.8
             Compiling adler v1.0.2
             Compiling rand_core v0.3.1
             Compiling httparse v1.8.0
             Compiling failure_derive v0.1.8
             Compiling hashbrown v0.12.3
             Compiling percent-encoding v1.0.1
             Compiling miniz_oxide v0.5.4
             Compiling gimli v0.26.2
             Compiling percent-encoding v2.2.0
             Compiling unicode-xid v0.2.4
             Compiling rustc_version v0.2.3
             Compiling crossbeam-utils v0.7.2
             Compiling slab v0.4.7
             Compiling memoffset v0.5.6
             Compiling crossbeam-epoch v0.8.2
             Compiling unicase v2.6.0
             Compiling smallvec v0.6.14
             Compiling indexmap v1.9.1
             Compiling rand_pcg v0.1.2
             Compiling rand_chacha v0.1.1
             Compiling form_urlencoded v1.1.0
             Compiling rand v0.6.5
             Compiling num-traits v0.2.15
             Compiling base64 v0.10.1
             Compiling rustc-demangle v0.1.21
             Compiling parking_lot_core v0.6.2
             Compiling parking_lot v0.9.0
             Compiling hyper v0.12.36
             Compiling try-lock v0.2.3
             Compiling serde_json v1.0.87
             Compiling crc32fast v1.3.2
             Compiling num-integer v0.1.45
             Compiling object v0.29.0
             Compiling unicode-normalization v0.1.22
             Compiling rand_xorshift v0.1.1
             Compiling rand_hc v0.1.0
             Compiling rand_isaac v0.1.1
             Compiling rand_jitter v0.1.4
             Compiling ryu v1.0.11
             Compiling encoding_rs v0.8.31
             Compiling iovec v0.1.4
             Compiling num_cpus v1.14.0
             Compiling net2 v0.2.38
             Compiling ring v0.16.20
             Compiling tokio-sync v0.1.8
             Compiling bytes v0.4.12
             Compiling time v0.1.44
             Compiling backtrace v0.3.66
             Compiling want v0.2.0
             Compiling mime_guess v2.0.4
             Compiling rand_os v0.1.3
             Compiling itoa v1.0.4
             Compiling try_from v0.3.2
             Compiling tokio-executor v0.1.10
             Compiling mio v0.6.23
             Compiling crossbeam-queue v0.2.3
             Compiling futures-cpupool v0.1.8
             Compiling mime v0.3.16
             Compiling dtoa v0.4.8
             Compiling crossbeam-utils v0.8.12
             Compiling idna v0.1.5
             Compiling tokio-current-thread v0.1.7
             Compiling tokio-timer v0.2.13
             Compiling tokio-io v0.1.13
             Compiling http v0.1.21
             Compiling string v0.2.1
             Compiling crossbeam-deque v0.7.4
             Compiling tokio-buf v0.1.1
             Compiling idna v0.3.0
             Compiling idna v0.2.3
             Compiling flate2 v1.0.24
             Compiling dirs-sys v0.3.7
             Compiling quick-xml v0.17.2
             Compiling scoped-tls v0.1.2
             Compiling iana-time-zone v0.1.53
             Compiling tokio-threadpool v0.1.18
             Compiling unicode-width v0.1.10
             Compiling dirs v4.0.0
             Compiling termcolor v1.1.3
             Compiling tokio-codec v0.1.2
             Compiling xdg v2.4.1
             Compiling textwrap v0.11.0
             Compiling atty v0.2.14
             Compiling strsim v0.8.0
             Compiling url v1.7.2
             Compiling tokio-reactor v0.1.12
             Compiling mio-uds v0.6.8
             Compiling url v2.3.1
             Compiling uuid v0.7.4
             Compiling tokio-fs v0.1.7
             Compiling minidom v0.12.0
             Compiling crossbeam-channel v0.5.6
             Compiling bitflags v1.3.2
             Compiling ansi_term v0.12.1
             Compiling vec_map v0.8.2
             Compiling tokio-tcp v0.1.4
             Compiling tokio-uds v0.2.7
             Compiling tokio-udp v0.1.6
             Compiling app_dirs v1.2.1
             Compiling clap v2.34.0
             Compiling chrono v0.4.23
             Compiling cookie v0.12.0
             Compiling tokio v0.1.22
             Compiling publicsuffix v1.5.6
             Compiling pbr v1.0.4
             Compiling addr2line v0.17.0
             Compiling tokio-core v0.1.18
             Compiling sct v0.6.1
             Compiling webpki v0.21.4
             Compiling http-body v0.1.0
             Compiling h2 v0.1.26
             Compiling ct-logs v0.6.0
             Compiling rustls v0.16.0
             Compiling webpki-roots v0.17.0
             Compiling simplelog v0.8.0
             Compiling synstructure v0.12.6
             Compiling tokio-rustls v0.10.3
             Compiling ctor v0.1.26
             Compiling failure v0.1.8
             Compiling hyper-rustls v0.17.1
             Compiling serde_urlencoded v0.5.5
             Compiling cookie_store v0.7.0
             Compiling reqwest v0.9.24
             Compiling cmsis-pack v0.3.0 (/tmp/pip-install-t1h86i5d/cmsis-pack-manager_0df7306226554d2ab758737493fb3cfd/rust/cmsis-pack)
          warning: fields `name`, `description` and `doc` are never read
             --> cmsis-pack/src/pdsc/component.rs:160:5
              |
          159 | pub struct Bundle {
              |            ------ fields in this struct
          160 |     name: String,
              |     ^^^^
          ...
          164 |     description: String,
              |     ^^^^^^^^^^^
          165 |     doc: String,
              |     ^^^
              |
              = note: `#[warn(dead_code)]` on by default
              = note: `Bundle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
          
             Compiling cmsis-cli v0.3.0 (/tmp/pip-install-t1h86i5d/cmsis-pack-manager_0df7306226554d2ab758737493fb3cfd/rust/cmsis-cli)
          warning: `cmsis-pack` (lib) generated 1 warning
             Compiling cmsis-cffi v0.3.0 (/tmp/pip-install-t1h86i5d/cmsis-pack-manager_0df7306226554d2ab758737493fb3cfd/rust/cmsis-cffi)
          warning: unused return value of `std::mem::replace` that must be used
             --> cmsis-cffi/src/pack_index.rs:145:13
              |
          145 |             mem::replace(boxed.borrow_mut(), next_state);
              |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              |
              = note: `#[warn(unused_must_use)]` on by default
              = note: if you don't need the old value, you can just assign the new value directly
          
          warning: unused return value of `std::mem::replace` that must be used
             --> cmsis-cffi/src/pack_index.rs:191:13
              |
          191 |             mem::replace(boxed.borrow_mut(), next_state);
              |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              |
              = note: if you don't need the old value, you can just assign the new value directly
          
          warning: `cmsis-cffi` (lib) generated 2 warnings
              Finished release [optimized] target(s) in 28.11s
          copying dylib libcmsis_cffi.so
          Traceback (most recent call last):
            File "/home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
              main()
            File "/home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/mbanducci/zephyrproject/.venv/lib64/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
              return _build_backend().build_wheel(wheel_directory, config_settings,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 412, in build_wheel
              return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 397, in _build_with_temp_dir
              self.run_setup()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
              exec(code, locals())
            File "<string>", line 66, in <module>
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
              return distutils.core.setup(**attrs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
              return run_commands(dist)
                     ^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
              dist.run_commands()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
              self.run_command(cmd)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 325, in run
              self.run_command("build")
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
              self.distribution.run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
              self.run_command(cmd_name)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
              self.distribution.run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1217, in run_command
              super().run_command(command)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 987, in run_command
              cmd_obj.run()
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/setuptools_ext.py", line 88, in run
              func(base_path=base_path, inplace=False)
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/setuptools_ext.py", line 276, in build_cffi
              ffi = make_ffi()
                    ^^^^^^^^^^
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/setuptools_ext.py", line 262, in make_ffi
              from milksnake.ffi import make_ffi
            File "/tmp/pip-build-env-a67mmg56/overlay/lib/python3.11/site-packages/milksnake/ffi.py", line 8, in <module>
              _directive_re = re.compile(r'^\s*#.*?$(?m)')
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/__init__.py", line 227, in compile
              return _compile(pattern, flags)
                     ^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/__init__.py", line 294, in _compile
              p = _compiler.compile(pattern, flags)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_compiler.py", line 743, in compile
              p = _parser.parse(p, flags)
                  ^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_parser.py", line 980, in parse
              p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_parser.py", line 455, in _parse_sub
              itemsappend(_parse(source, state, verbose, nested + 1,
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/usr/lib64/python3.11/re/_parser.py", line 841, in _parse
              raise source.error('global flags not at the start '
          re.error: global flags not at the start of the expression at position 9
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for cmsis-pack-manager
    Failed to build cmsis-pack-manager
    ERROR: Could not build wheels for cmsis-pack-manager, which is required to install pyproject.toml-based projects
    

    Other notes:

    • This was all working fine on Fedora 36 immediately before the reboot, which defaults to Python 3.10
    • I checked to ensure I had python3-devel installed, just in case, but adding it did not alter behavior
    • I tried to install cmsis-pack-manager both inside of and outside of my Zephyr venv with identical results
    opened by banduccm 5
  • Fix clippy lints

    Fix clippy lints

    I fixed all the clipply lints.

    Somehow now cbindgen doesn't generate bindings for many of the extern "C" functions. Also, python2 setup.py bdist_wheel as stated in the readme does not work at all. It tells me that bdist_wheel is no valid command.

    Maybe you can have a look and help me get this right (I fix it myself, I just need a hint)

    opened by Yatekii 5
  • Failure to download STM32F4xx DFP

    Failure to download STM32F4xx DFP

    If the Python API is used to download the Keil::STM32F4xx_DFP::2.13.0 pack, you get this file instead:

    <?xml version="1.0" encoding="utf-8"?><Error><Code>BlobNotFound</Code><Message>The specified blob does not exist.
    RequestId:00ffc5ad-601e-00b2-3a34-f61678000000
    Time:2019-04-18T22:14:45.2212973Z</Message></Error>
    

    Downloading manually from http://www.keil.com/dd2/pack works fine.

    priority 
    opened by flit 5
  • Consider replacing milksnake with maturin

    Consider replacing milksnake with maturin

    Hi! It looks like maturin is the more actively maintained project, whereas milksnake appears rather dead (no release in four years, open pull requests are ignored).

    Would it be possible for this project to facilitate maturin instead of milksnake (unless I'm misinterpreting the scope).

    I'm asking this because I'm packaging maturin on Arch Linux already and packaging a rather undead package for building cmsis-pack-manager could potentially be circumvented.

    opened by dvzrv 4
  • Purge slog for more ergonomic usage

    Purge slog for more ergonomic usage

    I removed slog from the crate to make usage more ergonomic and similar to what other crates do mostly.

    There is no real replacement for the kv-replacement feature of slog. I tried my best to keep the information logged as before, but surely it wount be 100% the same.

    Also, I used simplelog, which should generate nice, colored terminal output.

    If anything is unsound, please point me to it, I'll hapily fix it.

    opened by Yatekii 4
  • the pdsc parser doesn't handle families well

    the pdsc parser doesn't handle families well

    The pdsc does nothing to part the elements of the famly tag under the package/devices tag. This means that things like the debugconfig and sequences are not available via parsing. It would be pretty awesome to parse the families more fully.

    It looks like the builder suffers similarly and doesn't know how to build a pdsc with multiple families.

    opened by wt 0
  • Too many concurrent requests trigger DoS protection

    Too many concurrent requests trigger DoS protection

    CPM is too aggressive in parallelizing the index download. While this is great for index update performance, it can trigger the servers' CDN's DoS protection and the requests are blocked. Only Keil and NXP CDNs seem to have this response (they both use Akamai).

    Specifically what happens is that the request queue can result in many concurrent requests targeted at one server. If the number of requests is greater than the maximum allowed per source IP, the requests are blocked and either a 403 or other error is returned. After triggering the DoS protection, typically all new requests from the source IP are blocked for a timeout period.

    This is made far worse by #162 and #155, since the responses are not checked and the HTML error page included in the response is saved to the .pdsc index file (and then you get PDSC parse errors, of course).

    The solution is to throttle the number of concurrent requests. It would be nice to have a maximum per server domain, but limiting the total number is a good first step that would solve the issue.

    A while back I wrote the cmsis-pack-index-monitor script to explore this issue outside of CPM. You can use it to see the problem for yourself and experiment with a maximum number of jobs.

    opened by flit 0
  • cmsis-pack crate does not respect local configuration of root certificates

    cmsis-pack crate does not respect local configuration of root certificates

    Cache is unable to download packs in enterprise environments with "transparent" TLS-terminating middleboxes:

    $ pack-manager cache packs
    Caching all packs; this will take some time. Press Control-C to quit.
    20:57:14 [WARN] Sending fatal alert BadCertificate
    20:57:14 [ERROR] https://sadevicepacksprodus.blob.core.windows.net/idxfile/index.pidx: error trying to connect: invalid certificate: UnknownIssuer
    

    reqwest supports bundling Mozilla's root certificates (rusttls-tls, i.e., rust-tls-webpki-roots) or using the platform's native certificate store (rustls-tls-native-roots). See rustls-native-certs for a comparison of the two approaches.

    Consider switching from rust-tls-webpki-roots to rustls-tls-native-roots to support enterprise environments with "transparent" TLS-terminating middleboxes.

    opened by claymation 0
  • PYD libraries can't be loaded in 32bit Python on Windows

    PYD libraries can't be loaded in 32bit Python on Windows

    Hello, In version 0.3.0 I'm getting the following error when starting 'pack-manager' (or more generally 'pyocd')

    OSError: cannot load library '...venv_39_32\lib\site-packages\cmsis_pack_manager_native__lib.cp39-win32.pyd': error 0xc1

    This error occurs on Python 3.6 up to 3.9, but only in the 32bit versions. It would seem that the 32bit versions of wheels contain 64bit libraries because on 64bit Python everything works just fine (I've tried Python 3.6 up to 3.9)

    Best Regards, Michal

    bug os: windows 
    opened by mstarecek 12
  • Fine grained download control and version status

    Fine grained download control and version status

    Currently the only the entire set of PDSCs can be cached as a whole.

    It would be very useful to have the abilities to separately:

    • Download only the index.
    • Determine if and which PDSCs and (downloaded) packs are out of date (or entirely new)
    • Download/update specified PDSCs.

    The primary use case is to quickly check for new PDSCs and versions of already downloaded packs, and then download only those that are needed. Specifically, it would be highly useful if pyocd could quickly check for a new PDSC/pack, and potentially download it, when it is connecting to a target.

    opened by flit 0
Releases(v0.5.1)
Owner
pyocd
Organisation for pyOCD and related projects
pyocd
doq (python docstring generator) extension for coc.nvim

coc-pydocstring doq (python docstring generator) extension for coc.nvim Install CocInstall: :CocInstall coc-pydocstring vim-plug: Plug 'yaegassy/coc-p

yaegassy 27 Jan 04, 2023
A small system that allow you to manage hosts stored in your .ssh/config file

A small system that allow you to manage hosts stored in your .ssh/config using simple commands.

Simone Ostini 1 Jan 24, 2022
xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

xonsh xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt. The language is a superset of Python 3.6+ with additio

xonsh 6.7k Jan 08, 2023
Bad Apple printed out on the console with Python!

Bad Apple printed out on the console with Python!

CalvinLoke 186 Dec 01, 2022
git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's partial clone and sparse checkout features.

Partial Submodules for Git git-partial-submodule is a command-line script for setting up and working with submodules while enabling them to use git's

Nathan Reed 15 Sep 22, 2022
gcp-doctor - Diagnostics for Google Cloud Platform

gcp-doctor is a command-line diagnostics tool for GCP customers. It finds and helps to fix common issues in Google Cloud Platform projects. It is used to test projects against a wide range of best-pr

Google Cloud Platform 185 Dec 20, 2022
Chameleon is yet another PowerShell obfuscation tool designed to bypass AMSI and commercial antivirus solutions.

Chameleon is yet another PowerShell obfuscation tool designed to bypass AMSI and commercial antivirus solutions. The tool has been developed as a Python port of the Chimera project, by tokioneon_.

332 Dec 26, 2022
Kubernetes shell: An integrated shell for working with the Kubernetes

kube-shell Kube-shell: An integrated shell for working with the Kubernetes CLI Under the hood kube-shell still calls kubectl. Kube-shell aims to provi

CloudNative Labs 2.2k Jan 08, 2023
A python command line tool to calculate options max pain for a given company symbol and options expiry date.

Options-Max-Pain-Calculator A python command line tool to calculate options max pain for a given company symbol and options expiry date. Overview - Ma

13 Dec 26, 2022
CLI to show end-of-life dates for tools and technologies.

Python 3.9+ interface to endoflife.date to show end-of-life dates for tools and technologies.

Hugo van Kemenade 32 Jan 06, 2023
Command-line tool for downloading and extending the RedCaps dataset.

Command-line tool for downloading and extending the RedCaps dataset.

RedCaps dataset 33 Dec 14, 2022
Convert shellcode into :sparkles: different :sparkles: formats!

Bluffy Convert shellcode into ✨ different ✨ formats! Bluffy is a utility which was used in experiments to bypass Anti-Virus products (statically) by f

AD995 305 Dec 17, 2022
Command-line program for organizing and managing ebook collections

Command-line program for organizing and managing ebook collections. It is a Python port from the original shell scripts ebook-tools

Raul 14 Nov 12, 2022
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
Skiller - With this payload you can control the target computer with (cmd)

Skiller - With this payload you can control the target computer with (cmd)

1 Jan 02, 2022
Command line interface for unasync

CLI for unasync Command line interface for unasync Getting started Install Run the following command to install the package with pip: pip install unas

Leynier Gutiérrez González 3 Apr 04, 2022
Tool for HackMyVM platform

HMV-cli It is a tool for the HackMyVM platform. With this tool you will be able to see the machines you have pending, filter by difficulty, download d

bitc0de 11 Sep 19, 2022
Python3 library for multimedia functions at the command terminal

TERMINEDIA This is a Python library allowing using a text-terminal as a low-resolution graphics output, along with keyboard realtime reading, and a co

Joao S. O. Bueno 89 Dec 17, 2022
Doing set operations on files considered as sets of lines

CLI tool that can be used to do set operations like union on files considering them as a set of lines. Notes It ignores all empty lines with whitespac

Partho 11 Sep 06, 2022
Lets you view, edit and execute Jupyter Notebooks in the terminal.

Lets you view, edit and execute Jupyter Notebooks in the terminal.

David Brochart 684 Dec 28, 2022