Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译时开启 python 支持编译失败 #2

Open
taotieren opened this issue Jan 3, 2025 · 6 comments
Open

编译时开启 python 支持编译失败 #2

taotieren opened this issue Jan 3, 2025 · 6 comments

Comments

@taotieren
Copy link

# Maintainer: taotieren <[email protected]>

pkgname="sigrok-slogic-git"
pkgver=r5829.0cc6bef
pkgrel=1
pkgdesc="sigrok_slogic"
arch=($CARCH)
url="https://wiki.sipeed.com/hardware/zh/logic_analyzer/combo8/index.html"
license=('GPL-3.0-or-later')
depends=(
  glib2
  glibc
  glibmm
  bluez-libs
  hicolor-icon-theme
  hidapi
  libftdi
  libieee1284
  libserialport
  libsigc++
  libtirpc
  libusb
  libzip
  nettle
  protobuf-c
  python
  swig
  zlib
)
makedepends=(
  check
  git
  doxygen
  python-gobject
  python-numpy
  python-setuptools
)
conflicts=("${pkgname%-git}" libsigrok)
provides=("${pkgname%-git}" libsigrok)
source=("${pkgname}::git+https://github.com/sipeed/sigrok_slogic.git")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgname}"
  (
    set -o pipefail
    git describe --long --tag --abbrev=7 2>/dev/null | sed 's/^v//g;s/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}

prepare() {
  git -C "${srcdir}/${pkgname}" clean -dfx
}

build() {
  cd "${srcdir}/${pkgname}"
  chmod +x autogen.sh
  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --disable-java \
    --disable-ruby

  make
}

package() {
  cd "${srcdir}/${pkgname}"

  make DESTDIR="${pkgdir}" install
  install -Dvm644 'contrib/60-libsigrok.rules' "${pkgdir}/usr/lib/udev/rules.d/60-libsigrok.rules"
  install -Dvm644 'contrib/61-libsigrok-uaccess.rules' "${pkgdir}/usr/lib/udev/rules.d/61-libsigrok-uaccess.rules"
}
copying selected object files to avoid basename conflicts...
GEN      doxy/xml/index.xml
GEN      bindings/cxx/enums.timestamp
CXX      bindings/cxx/classes.lo
CXXLD    bindings/cxx/libsigrokcxx.la
GEN      bindings/cxx/doxy/xml/index.xml
GEN      bindings/python/sigrok/core/doc_start.i
GEN      bindings/python/sigrok/core/doc_end.i
GEN      bindings/python/timestamp
/usr/lib/python3.13/site-packages/setuptools/dist.py:694: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
!!

********************************************************************************
Please replace its usage with implicitnamespaces (PEP 420).

See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
********************************************************************************

!!
ep.load()(self, ep.name, value)
./sigrok/core/../../../swig/classes.i:51: Warning 330: Template forward class 'enable_shared_from_this< Context >' cannot be used to instantiate a full template class with name 'ContextShared'.
sigrok/core/classes_wrap.cpp: In lambda function:
sigrok/core/classes_wrap.cpp:43689:21: error: ‘PyEval_CallObject’ was not declared in this scope; did you mean ‘PyObject_CallObject’?
43689 |       auto result = PyEval_CallObject(swig_obj[1], arglist);
|                     ^~~~~~~~~~~~~~~~~
|                     PyObject_CallObject
sigrok/core/classes_wrap.cpp: In lambda function:
sigrok/core/classes_wrap.cpp:47865:21: error: ‘PyEval_CallObject’ was not declared in this scope; did you mean ‘PyObject_CallObject’?
47865 |       auto result = PyEval_CallObject(swig_obj[1], arglist);
|                     ^~~~~~~~~~~~~~~~~
|                     PyObject_CallObject
sigrok/core/classes_wrap.cpp: In lambda function:
sigrok/core/classes_wrap.cpp:48179:27: error: ‘PyEval_CallObject’ was not declared in this scope; did you mean ‘PyObject_CallObject’?
48179 |       const auto result = PyEval_CallObject(swig_obj[1], nullptr);
|                           ^~~~~~~~~~~~~~~~~
|                           PyObject_CallObject
error: command '/usr/bin/g++' failed with exitcode 1
make[1]: *** [Makefile:5690: bindings/python/timestamp] Error 1
make: *** [Makefile:2142: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
@taotieren
Copy link
Author

taotieren commented Jan 4, 2025

本地编译时合并式上游最新提交编译通过,建议是合并到上游或与上游提交进行定期合并。

Arch 用户可以通过 AUR 安装 sigrok-slogic-git

# Maintainer: taotieren <[email protected]>

pkgbase=sigrok-slogic-git
pkgname=(sigrok-slogic-git)
pkgver=0.2.1.r4402.gac52ec30
pkgrel=1
pkgdesc="sigrok_slogic"
arch=($CARCH)
url="https://wiki.sipeed.com/hardware/zh/logic_analyzer/combo8/index.html"
license=('GPL-3.0-or-later')
depends=(
  glib2
  glibc
  bluez-libs
  hicolor-icon-theme
  hidapi
  libftdi
  libieee1284
  libtirpc
  libusb
  libzip
  nettle
  zlib
  glibmm
  libsigc++
  swig
  python
  #AUR
  libserialport-git
)
makedepends=(
  check
  git
  doxygen
  python-gobject
  python-numpy
  python-setuptools
)
conflicts=("${pkgname%-git}" libsigrok libsigrok-git)
provides=("${pkgname%-git}" libsigrok libsigrok-git)
# source=("${pkgbase}::git+https://github.com/sipeed/sigrok_slogic.git")
source=("${pkgbase}::git+https://github.com/sigrokproject/libsigrok.git")
md5sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgbase}"
  (
    set -o pipefail
    git describe --exclude 'libsigrok-unreleased' --long | sed 's/^libsigrok-//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
      printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}

prepare() {
  git -C "${srcdir}/${pkgbase}" clean -dfx
  cd "${srcdir}/${pkgbase}"
  git config --global user.email "[email protected]"
  git config --global user.name "taotieren"
  git remote add sigrok_slogic https://github.com/sipeed/sigrok_slogic.git
  git fetch --all
  git merge sigrok_slogic/hardware-sipeed-slogic-analyzer-support
  #   hardware-sipeed-slogic-analyzer-support
}

build() {
  cd "${srcdir}/${pkgbase}"
  chmod +x autogen.sh
  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --enable-cxx \
    --enable-shared \
    --disable-static \
    --disable-java \
    --disable-ruby
  #     --disable-python

  make
}

package() {
  cd "${srcdir}/${pkgbase}"

  make DESTDIR="${pkgdir}" install
  install -Dvm644 'contrib/60-libsigrok.rules' "${pkgdir}/usr/lib/udev/rules.d/60-libsigrok.rules"
  install -Dvm644 'contrib/61-libsigrok-uaccess.rules' "${pkgdir}/usr/lib/udev/rules.d/61-libsigrok-uaccess.rules"
}

@taotieren
Copy link
Author

❯ yay -Ql sigrok-slogic-git
sigrok-slogic-git /usr/
sigrok-slogic-git /usr/include/
sigrok-slogic-git /usr/include/libsigrok/
sigrok-slogic-git /usr/include/libsigrok/libsigrok.h
sigrok-slogic-git /usr/include/libsigrok/proto.h
sigrok-slogic-git /usr/include/libsigrok/version.h
sigrok-slogic-git /usr/include/libsigrokcxx/
sigrok-slogic-git /usr/include/libsigrokcxx/enums.hpp
sigrok-slogic-git /usr/include/libsigrokcxx/libsigrokcxx.hpp
sigrok-slogic-git /usr/lib/
sigrok-slogic-git /usr/lib/libsigrok.so
sigrok-slogic-git /usr/lib/libsigrok.so.4
sigrok-slogic-git /usr/lib/libsigrok.so.4.0.0
sigrok-slogic-git /usr/lib/libsigrokcxx.so
sigrok-slogic-git /usr/lib/libsigrokcxx.so.4
sigrok-slogic-git /usr/lib/libsigrokcxx.so.4.0.0
sigrok-slogic-git /usr/lib/pkgconfig/
sigrok-slogic-git /usr/lib/pkgconfig/libsigrok.pc
sigrok-slogic-git /usr/lib/pkgconfig/libsigrokcxx.pc
sigrok-slogic-git /usr/lib/python3.13/
sigrok-slogic-git /usr/lib/python3.13/site-packages/
sigrok-slogic-git /usr/lib/python3.13/site-packages/libsigrok-0.6.0-py3.13.egg-info/
sigrok-slogic-git /usr/lib/python3.13/site-packages/libsigrok-0.6.0-py3.13.egg-info/PKG-INFO
sigrok-slogic-git /usr/lib/python3.13/site-packages/libsigrok-0.6.0-py3.13.egg-info/SOURCES.txt
sigrok-slogic-git /usr/lib/python3.13/site-packages/libsigrok-0.6.0-py3.13.egg-info/dependency_links.txt
sigrok-slogic-git /usr/lib/python3.13/site-packages/libsigrok-0.6.0-py3.13.egg-info/not-zip-safe
sigrok-slogic-git /usr/lib/python3.13/site-packages/libsigrok-0.6.0-py3.13.egg-info/top_level.txt
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/__init__.py
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/__pycache__/
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/__pycache__/__init__.cpython-313.pyc
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/__init__.py
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/__pycache__/
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/__pycache__/__init__.cpython-313.pyc
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/__pycache__/classes.cpython-313.pyc
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/_classes.cpython-313-x86_64-linux-gnu.so
sigrok-slogic-git /usr/lib/python3.13/site-packages/sigrok/core/classes.py
sigrok-slogic-git /usr/lib/udev/
sigrok-slogic-git /usr/lib/udev/rules.d/
sigrok-slogic-git /usr/lib/udev/rules.d/60-libsigrok.rules
sigrok-slogic-git /usr/lib/udev/rules.d/61-libsigrok-uaccess.rules
sigrok-slogic-git /usr/share/
sigrok-slogic-git /usr/share/icons/
sigrok-slogic-git /usr/share/icons/hicolor/
sigrok-slogic-git /usr/share/icons/hicolor/48x48/
sigrok-slogic-git /usr/share/icons/hicolor/48x48/mimetypes/
sigrok-slogic-git /usr/share/icons/hicolor/48x48/mimetypes/libsigrok.png
sigrok-slogic-git /usr/share/icons/hicolor/scalable/
sigrok-slogic-git /usr/share/icons/hicolor/scalable/mimetypes/
sigrok-slogic-git /usr/share/icons/hicolor/scalable/mimetypes/libsigrok.svg
sigrok-slogic-git /usr/share/mime/
sigrok-slogic-git /usr/share/mime/packages/
sigrok-slogic-git /usr/share/mime/packages/vnd.sigrok.session.xml

@taotieren
Copy link
Author

图片
合并后用上游的 pulseview 也是能检测到设备。

@taotieren
Copy link
Author

用 boufflab devcube 连接并刷机后切换到 CK-LINK 模式
无法检测到 CK-LINK HS 设备
图片
lsusb -v 信息

Bus 007 Device 011: ID 42bf:b210 SIPEED   CKLink-HS
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               2.00
bDeviceClass          239 Miscellaneous Device
bDeviceSubClass         2 [unknown]
bDeviceProtocol         1 Interface Association
bMaxPacketSize0        64
idVendor           0x42bf SIPEED
idProduct          0xb210 CKLink-HS
bcdDevice            2.17
iManufacturer           1 SIPEED
iProduct                2 CKLink-HS
iSerial                 3 FactoryAIOT
bNumConfigurations      1
Configuration Descriptor:
bLength                 9
bDescriptorType         2
wTotalLength       0x006a
bNumInterfaces          3
bConfigurationValue     1
iConfiguration          0
bmAttributes         0x80
(Bus Powered)
MaxPower              100mA
Interface Association:
bLength                 8
bDescriptorType        11
bFirstInterface         0
bInterfaceCount         1
bFunctionClass        255 Vendor Specific Class
bFunctionSubClass       1 [unknown]
bFunctionProtocol       0
iFunction               0
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        0
bAlternateSetting       0
bNumEndpoints           2
bInterfaceClass       255 Vendor Specific Class
bInterfaceSubClass      1 [unknown]
bInterfaceProtocol      0
iInterface              4 CKLink-Lite
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x02  EP 2 OUT
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0040  1x 64 bytes
bInterval               0
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x81  EP 1 IN
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0040  1x 64 bytes
bInterval               0
Interface Association:
bLength                 8
bDescriptorType        11
bFirstInterface         1
bInterfaceCount         2
bFunctionClass          2 Communications
bFunctionSubClass       2 Abstract (modem)
bFunctionProtocol       1 AT-commands (v.25ter)
iFunction               0
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        1
bAlternateSetting       0
bNumEndpoints           1
bInterfaceClass         2 Communications
bInterfaceSubClass      2 Abstract (modem)
bInterfaceProtocol      1 AT-commands (v.25ter)
iInterface              2 CKLink-HS
CDC Header:
bcdCDC               1.10
CDC Call Management:
bmCapabilities       0x00
bDataInterface          2
CDC ACM:
bmCapabilities       0x02
line coding and serial state
CDC Union:
bMasterInterface        1
bSlaveInterface         2
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x85  EP 5 IN
bmAttributes            3
Transfer Type            Interrupt
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        2
bAlternateSetting       0
bNumEndpoints           2
bInterfaceClass        10 CDC Data
bInterfaceSubClass      0 [unknown]
bInterfaceProtocol      0
iInterface              0
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x04  EP 4 OUT
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x83  EP 3 IN
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Device Qualifier (for other device speed):
bLength                10
bDescriptorType         6
bcdUSB               2.00
bDeviceClass            2 Communications
bDeviceSubClass         2 Abstract (modem)
bDeviceProtocol         1 AT-commands (v.25ter)
bMaxPacketSize0        64
bNumConfigurations      1
Device Status:     0x0000
(Bus Powered)

@taotieren
Copy link
Author

taotieren commented Jan 4, 2025

同样切换到 CMSIS-DAP 也有问题

图片

在 jlinkconfigexe 下能检测到 CMSIS-DAP
图片

Bus 007 Device 013: ID d6e7:3507 SIPEED RV CMSIS-DAP
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
bLength                18
bDescriptorType         1
bcdUSB               2.00
bDeviceClass          239 Miscellaneous Device
bDeviceSubClass         2 [unknown]
bDeviceProtocol         1 Interface Association
bMaxPacketSize0        64
idVendor           0xd6e7 SIPEED
idProduct          0x3507 RV CMSIS-DAP
bcdDevice            1.00
iManufacturer           1 SIPEED
iProduct                2 RV CMSIS-DAP
iSerial                 3 012345ABCDEF
bNumConfigurations      1
Configuration Descriptor:
bLength                 9
bDescriptorType         2
wTotalLength       0x0062
bNumInterfaces          3
bConfigurationValue     1
iConfiguration          0
bmAttributes         0x80
(Bus Powered)
MaxPower              500mA
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        0
bAlternateSetting       0
bNumEndpoints           2
bInterfaceClass       255 Vendor Specific Class
bInterfaceSubClass      0 [unknown]
bInterfaceProtocol      0
iInterface              4 RV CMSIS-DAP
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x01  EP 1 OUT
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x82  EP 2 IN
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Interface Association:
bLength                 8
bDescriptorType        11
bFirstInterface         1
bInterfaceCount         2
bFunctionClass          2 Communications
bFunctionSubClass       2 Abstract (modem)
bFunctionProtocol       1 AT-commands (v.25ter)
iFunction               0
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        1
bAlternateSetting       0
bNumEndpoints           1
bInterfaceClass         2 Communications
bInterfaceSubClass      2 Abstract (modem)
bInterfaceProtocol      1 AT-commands (v.25ter)
iInterface              0
CDC Header:
bcdCDC               1.10
CDC Call Management:
bmCapabilities       0x00
bDataInterface          2
CDC ACM:
bmCapabilities       0x02
line coding and serial state
CDC Union:
bMasterInterface        1
bSlaveInterface         2
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x85  EP 5 IN
bmAttributes            3
Transfer Type            Interrupt
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0008  1x 8 bytes
bInterval              16
Interface Descriptor:
bLength                 9
bDescriptorType         4
bInterfaceNumber        2
bAlternateSetting       0
bNumEndpoints           2
bInterfaceClass        10 CDC Data
bInterfaceSubClass      0 [unknown]
bInterfaceProtocol      0
iInterface              0
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x04  EP 4 OUT
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Endpoint Descriptor:
bLength                 7
bDescriptorType         5
bEndpointAddress     0x83  EP 3 IN
bmAttributes            2
Transfer Type            Bulk
Synch Type               None
Usage Type               Data
wMaxPacketSize     0x0200  1x 512 bytes
bInterval               0
Device Qualifier (for other device speed):
bLength                10
bDescriptorType         6
bcdUSB               2.10
bDeviceClass            0 [unknown]
bDeviceSubClass         0 [unknown]
bDeviceProtocol         0
bMaxPacketSize0        64
bNumConfigurations      1
cannot read device status, Resource temporarily unavailable (11)

@taorye
Copy link
Collaborator

taorye commented Jan 13, 2025

  1. CKLink 和 DAPLink 模式,可以先在 windows 下的设备管理器查看是否能正常识别和挂载。
  2. 需要一些前置信息:图中描述烧写后无法使用,那么烧写前是否可用?又是出于什么原因要自行烧写?
  3. 烧写后 逻辑分析仪 和 4串口 功能是否也无法使用?还是仅 CK/DAP Link 功能异常?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants