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

New Plugin: Crowdsource_pi #1199

Open
rgleason opened this issue Jan 9, 2025 · 79 comments
Open

New Plugin: Crowdsource_pi #1199

rgleason opened this issue Jan 9, 2025 · 79 comments

Comments

@rgleason
Copy link
Contributor

rgleason commented Jan 9, 2025

Contribute AIS and ARPA targets from your vessel to crowdsourcing for marine safety!
This plugin lets you upload AIS and radar ARPA targets (or any NMEA) to an internet server. Upload can be continuous, over intermittent internet, or scheduled, and tracks can be downsampled to fit your bandwidth.
Using Apache Avro. Designed to be used with radar_pi.

by "redhog"
https://github.com/KAHU-radar/crowdsource_pi

I am going to set Egil "redhog" as an Cloudsmith OpenCPN.org Plugin Teammember and make the 3 repositories that he can deploy too.

However Egil may need some help getting the Android versions to work.

@redhog
Copy link

redhog commented Jan 9, 2025

Heyas, just commenting here so you guys have a link to my github, and so that I get notifications when you comment here :)

This is my first plugin, so the build infrastructure / scripts are quite new to me. The plugin builds for linux, windows and macos right now. However, for some reason it does not load into opencpn on macos (haven't tested windows yet, my dev env is debian linux). If someone could help me test and figure out the build problems that'd be awesome.

All my built artefacts are currently here: https://cloudsmith.io/~kahu/repos/crowdsource_pi-beta/packages/?page=1&sort=-name

@redhog
Copy link

redhog commented Jan 12, 2025

Also, please see jongough/testplugin_pi#420 regarding macos build issue

@jongough
Copy link
Contributor

I have just tried importing the plugin into macOS ventura 13 and got the following in the opencpn.log

07:23:01.399 MESSAGE plugin_loader.cpp:508 Checking plugin compatibility: /Users/jon/Library/Application Support/OpenCPN/Contents/PlugIns/libcrowdsource_pi.dylib
07:23:01.399 MESSAGE plugin_loader.cpp:1374 Plugin is compatible: true
07:23:01.399 MESSAGE plugin_loader.cpp:1390 PluginLoader: Loading PlugIn: /Users/jon/Library/Application Support/OpenCPN/Contents/PlugIns/libcrowdsource_pi.dylib
07:23:01.400   ERROR dlunix.cpp:120 Failed to load shared library '/Users/jon/Library/Application Support/OpenCPN/Contents/PlugIns/libcrowdsource_pi.dylib': dlopen(/Users/jon/Library/Application Support/OpenCPN/Contents/PlugIns/libcrowdsource_pi.dylib, 0x0002): Library not loaded: /usr/local/lib/libwx_baseu-3.2.dylib
  Referenced from: <BB2109DF-7415-3194-B2F8-8BBFD27D042B> /Users/jon/Library/Application Support/OpenCPN/Contents/PlugIns/libcrowdsource_pi.dylib
  Reason: tried: '/usr/local/lib/libwx_baseu-3.2.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libwx_baseu-3.2.dylib' (no such file), '/usr/local/lib/libwx_baseu-3.2.dylib' (no such file), '/usr/lib/libwx_baseu-3.2.dylib' (no such file, not in dyld cache)
07:23:01.400 MESSAGE plugin_loader.cpp:1435 Ignoring blacklisted plugin libcrowdsource_pi
07:23:01.400 MESSAGE plugin_loader.cpp:1445    PluginLoader: Cannot load library: /Users/jon/Library/Application Support/OpenCPN/Contents/PlugIns/libcrowdsource_pi.dylib
0

I looked for the missing library and found it here:

/Applications/OpenCPN.app/Contents/Frameworks/libwx_baseu-3.2.0.2.3.dylib
/Applications/OpenCPN.app/Contents/Frameworks/libwx_baseu-3.2.dylib0

So it looks like there may be either something wrong with your build process or where you have setup to find the wxWidgets libraries.

I am not a mac person so really don't know how it works. nohal (Pavel) helps fix this stuff up for me.

@redhog
Copy link

redhog commented Jan 12, 2025

I'm not a mac person either, but already had a chat with @nohal who said that during the build, it always references wxwidgets stuff in /usr/local, and then https://github.com/KAHU-radar/testplugin_pi/blob/master/cmake/fix-macos-libs.sh is supposed to fix these paths in the generated file, replacing the absolute paths with relative ones. Which it does. But /after/ the tar.gz package is built.

So the issue is a pure cmake issue. And I'm not good enough at cmake to figure out why the order of these build steps is wrong, so that's what I'm asking you for help with :)

He does something very similar here:

"I myself do it using this script: https://github.com/nohal/dashboardsk_pi/blob/main/cmake/fix-macos-libs.sh (Invoked from https://github.com/nohal/dashboardsk_pi/blob/main/cmake/PluginInstall.cmake#L64)"

@rgleason
Copy link
Contributor Author

rgleason commented Jan 12, 2025

I am not macos or really a programer, but take a
Look at Line 60 - 93 of plugininstall.cmake.
https://github.dev/nohal/dashboardsk_pi/blob/main/cmake/PluginInstall.cmake

But first realize that he is using the Shipdriver Template which does things very differently.
What we need to do is find Testplugin example that does this similar thing.
Maybe vdr_pi is such an example, because bdbcat recently worked on it for MacOS and Android. Whoops I forgot that one is also using Shipdriver Template. We need to locate an example using Testplugin Template.

# On macos, fix paths which points to the build environment, make sure they
# refers to runtime locations
if(${BUILD_TYPE} STREQUAL "tarball" AND APPLE)
  install(CODE "execute_process(
      COMMAND bash -c ${PROJECT_SOURCE_DIR}/cmake/fix-macos-libs.sh
    )")
endif()

if(CMAKE_BUILD_TYPE MATCHES "Release|MinSizeRel")
  if(APPLE)
    set(_striplib OpenCPN.app/Contents/PlugIns/lib${PACKAGE_NAME}.dylib)
  elseif(MINGW)
    set(_striplib plugins/lib${PACKAGE_NAME}.dll)
  elseif(
    UNIX
    AND NOT CMAKE_CROSSCOMPILING
    AND NOT DEFINED ENV{FLATPAK_ID})
    # Plain, native linux
    set(_striplib lib/opencpn/lib${PACKAGE_NAME}.so)
  endif()
  if(BUILD_TYPE STREQUAL "tarball" AND DEFINED _striplib)
    find_program(STRIP_UTIL NAMES strip REQUIRED)
    if(APPLE)
      set(STRIP_UTIL "${STRIP_UTIL} -x")
    endif()
    install(CODE "message(STATUS \"Stripping ${_striplib}\")")
    install(
      CODE "
      execute_process(
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
        COMMAND ${STRIP_UTIL} app/files/${_striplib}
      )
    ")
  endif()

Then check out https://github.dev/nohal/dashboardsk_pi/blob/main/cmake/PluginInstall.cmake at fixmacos-libs.sh

# On macos, fix paths which points to the build environment, make sure they
# refers to runtime locations
if(${BUILD_TYPE} STREQUAL "tarball" AND APPLE)
  install(CODE "execute_process(
      COMMAND bash -c ${PROJECT_SOURCE_DIR}/cmake/fix-macos-libs.sh
    )")
endif()

if(CMAKE_BUILD_TYPE MATCHES "Release|MinSizeRel")
  if(APPLE)
    set(_striplib OpenCPN.app/Contents/PlugIns/lib${PACKAGE_NAME}.dylib)
  elseif(MINGW)
    set(_striplib plugins/lib${PACKAGE_NAME}.dll)
  elseif(
    UNIX
    AND NOT CMAKE_CROSSCOMPILING
    AND NOT DEFINED ENV{FLATPAK_ID})
    # Plain, native linux
    set(_striplib lib/opencpn/lib${PACKAGE_NAME}.so)
  endif()
  if(BUILD_TYPE STREQUAL "tarball" AND DEFINED _striplib)
    find_program(STRIP_UTIL NAMES strip REQUIRED)
    if(APPLE)
      set(STRIP_UTIL "${STRIP_UTIL} -x")
    endif()
    install(CODE "message(STATUS \"Stripping ${_striplib}\")")
    install(
      CODE "
      execute_process(
        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
        COMMAND ${STRIP_UTIL} app/files/${_striplib}
      )
    ")
  endif()

@rgleason
Copy link
Contributor Author

@redhog Egil I have created crowdsource-alpha, crowsource-beta and crowsource-prod and uploaded a placeholder txt file to each of those repositories.

I believe you have an account and are using your own organization repositories right now, here:
https://cloudsmith.io/~opencpn/repos/crowdsource-prod/packages/
Which is just fine, but if you want to use the OpenCPN.org repositories, you can.

I would like to send you an invitation from Cloudsmith OpenCPN organization to join the Plugin Team.
To do this I have searched on kahu and Egil Moller and your redhog email.
Can you email me what I should search on in the Cloudsmith search that will allow me to select you, so I can send the invitation. Nothing seems to find you right now.

@jongough
Copy link
Contributor

I have checked in the tarball and extracted the dylib files for testplugin and crowdsource, then looked in the binary for baseu and found the following:

  • Testplugin: @executable_path/../Frameworks//libwx_baseu_net-3.2.dylib
  • crowdsource: /usr/local/lib/libwx_baseu_net-3.2.dylib

So it would appear that the FE2 build process is working OK, but something has changed in the crowdsource implementation of the FE2 that is not working. Try copying all the FE2 build files over the top of your current ones and then build for macOS and see if that helps.

@bdbcat
Copy link
Member

bdbcat commented Jan 13, 2025

I think it would be productive to compare your CCI logs against the Testplugin CCI logs, specifically for MacOS.

@jongough
Copy link
Contributor

Up to the completion of the build script the systems seem the same. Not sure what the jobs are after the upload to cloudsmith, but they should not effect anything. I can only assume that wrong dylib is being put into the tarball, i.e. the before the fix up script version.

@redhog
Copy link

redhog commented Jan 13, 2025

Where exactly is the tar file made (in what scripts, run from where)?

@redhog
Copy link

redhog commented Jan 13, 2025

@rgleason https://github.com/KAHU-radar/crowdsource_pi/blob/master/cmake/PluginInstall.cmake#L203 seems very similar to https://github.com/nohal/dashboardsk_pi/blob/main/cmake/PluginInstall.cmake#L59C1-L66C8 , byut the file is organized differently (but both are written by @nohal, althoug the dashboard one has later updates by Alec Leamas).

@rgleason
Copy link
Contributor Author

Elig, which template are you using? I think it is Testplugin. DashboardSK is using the Shipdriver template.
When I compare crowdsource's plugininstall.cmake to testplugin's plugininstall.cmake they on first glance appear to be the same. Yes they were both written by Pavel [nohal].

Is that why you are looking at the changes that were made to DashboardSK plugininstall.cmake which seems to have code that is providing the correct path.

Perhaps this code should be in testplugin files too, however Jon may have made other accommodations to properly build MacOS. Or is this problem triggered by trying to build a certain library? I think we need Jon look into it and to respond here.

1 similar comment
@rgleason
Copy link
Contributor Author

Elig, which template are you using? I think it is Testplugin. DashboardSK is using the Shipdriver template.
When I compare crowdsource's plugininstall.cmake to testplugin's plugininstall.cmake they on first glance appear to be the same. Yes they were both written by Pavel [nohal].

Is that why you are looking at the changes that were made to DashboardSK plugininstall.cmake which seems to have code that is providing the correct path.

Perhaps this code should be in testplugin files too, however Jon may have made other accommodations to properly build MacOS. Or is this problem triggered by trying to build a certain library? I think we need Jon look into it and to respond here.

@rgleason
Copy link
Contributor Author

Elig, now I remember what needs to be done so I can send you a Cloudsmith invite. You need to allow your user name on cloudsmith to be public, then the search will find you.

@redhog
Copy link

redhog commented Jan 13, 2025

Yes, my plugin is based on testplugin_pi.

@redhog
Copy link

redhog commented Jan 13, 2025

I've made my account on cloudsmith public now. My account is here: https://cloudsmith.io/users/egil-moller/

@redhog
Copy link

redhog commented Jan 13, 2025

The main reason I'm looking at the dashboard one, is that Pavel told me about his solution in a convo on Zulip. He didn't mention his plugin is based on shipdriver though...

This script https://github.com/KAHU-radar/crowdsource_pi/blob/master/cmake/fix-macos-libs.sh is identital between shipdriver and testplugin (and my plugin).

The only problem is about /when/ this is called - before or after the tgz package is built.

@rgleason
Copy link
Contributor Author

Elig, since it does not work now, why not compare Pavel's to your current plugininstall.cmake, make note of the differences and determine what needs to be changed.

Then try that and see if it compiles for MacOS. If it does and if it works, then perhaps the same change should be done to Jon's Testplugin version too. (I wonder why other plugins built with MacOS are working?)

Also have you checked that all your testplugin template files are current? I would do that first. Then try the change, you can always revert it.

@rgleason
Copy link
Contributor Author

i've made my account on cloudsmith public now. My account is here: https://cloudsmith.io/users/egil-moller/

I think I managed to send the invite. Let me know if there are any problems.

@redhog
Copy link

redhog commented Jan 13, 2025

Invite worked fine

@bdbcat
Copy link
Member

bdbcat commented Jan 13, 2025

Where is the latest CCI build log?

@redhog
Copy link

redhog commented Jan 13, 2025

@redhog
Copy link

redhog commented Jan 13, 2025

Ok, doing it by hand: I logged in to the circleci build machine and reran what the make target "package" does by hand:

static:build distiller$ /opt/homebrew/bin/cpack --config ./CPackConfig.cmake
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: crowdsource_pi
CPack: - Install project: crowdsource_pi []
fix-macos-libs.sh: Revised library paths:
	@executable_path/../Frameworks//libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
CPack: Create package
CPack: - package: /Users/distiller/project/build/crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos.tar.gz generated.
static:build distiller$ mkdir x
static:build distiller$ cd x
static:x distiller$ tar -xvzf /Users/distiller/project/build/crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos.tar.gz
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/hu_HU.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/hu_HU.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/et_EE.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/et_EE.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/mr_IN.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/mr_IN.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ro_RO.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ro_RO.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/fi_FI.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/fi_FI.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/hi_IN.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/hi_IN.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/da_DK.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/da_DK.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/cs_CZ.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/cs_CZ.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/zh_CN.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/zh_CN.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/fil_PH.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/fil_PH.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/de_DE.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/de_DE.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/nl_NL.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/nl_NL.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/pt_BR.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/pt_BR.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/sv_SE.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/sv_SE.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/pt_PT.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/pt_PT.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/pl_PL.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/pl_PL.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/gl_ES.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/gl_ES.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/he_IL.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/he_IL.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/th_TH.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/th_TH.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/it_IT.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/it_IT.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/is_IS.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/is_IS.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/zh_TW.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/zh_TW.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/el_GR.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/el_GR.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ca_ES.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ca_ES.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/en_GB.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/en_GB.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ru_RU.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ru_RU.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/nb_NO.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/nb_NO.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/es_ES.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/es_ES.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/tr_TR.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/tr_TR.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ar_SA.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ar_SA.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/vi_VN.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/vi_VN.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/bg_BG.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/bg_BG.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ja_JP.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ja_JP.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/fr_FR.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/fr_FR.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ko_KR.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/ko_KR.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/id_ID.lproj/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/Resources/id_ID.lproj/opencpn-crowdsource_pi.mo
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/crowdsource-toggled.png
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/migrations/
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/migrations/0002-target-indices.sql
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/migrations/0001-create-targets.sql
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/crowdsource.png
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/proto_avro.json
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/crowdsource.svg
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/crowdsource-toggled.svg
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/crowdsourcegrey.png
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/crowdsourcegrey.svg
x crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/SharedSupport/plugins/crowdsource_pi/data/license.txt
static:x distiller$ otool -L crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib
crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib (architecture x86_64):
	@rpath/libcrowdsource_pi.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 169.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/lib/libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib (architecture arm64):
	@rpath/libcrowdsource_pi.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 169.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/lib/libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)

So cpack surprisingly runs fix-macos-libs.sh (I thought this would only run during the install make target!), but on the wrong files? Not sure how, as CPackConfig.cmake does not reference it.

@redhog
Copy link

redhog commented Jan 13, 2025

Further, the library file installed when cpack invokes the install target (from the package target), has the wrong paths!

static:build distiller$ otool -L _CPack_Packages/Darwin/TGZ/crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib
_CPack_Packages/Darwin/TGZ/crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib (architecture x86_64):
	@rpath/libcrowdsource_pi.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 169.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/lib/libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
_CPack_Packages/Darwin/TGZ/crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib (architecture arm64):
	@rpath/libcrowdsource_pi.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 169.0.0)
	/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
	/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)
	/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox (compatibility version 1.0.0, current version 1000.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/lib/libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/local/lib/libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)

@redhog
Copy link

redhog commented Jan 13, 2025

I assume the culprtit is in the -maxdepth 1 in plugin=$(find . -maxdepth 1 -name '*.dylib') in https://github.com/jongough/testplugin_pi/blob/master/cmake/fix-macos-libs.sh#L9 (same file/line in my plugin).

@bdbcat
Copy link
Member

bdbcat commented Jan 13, 2025

OK, the interesting stuff is:


Run CPack packaging tool...
/opt/homebrew/bin/cpack --config ./CPackConfig.cmake
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: crowdsource_pi
CPack: - Install project: crowdsource_pi []
fix-macos-libs.sh: Revised library paths:
	@executable_path/../Frameworks//libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_core-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_net-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_baseu_xml-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_html-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_aui-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
	@executable_path/../Frameworks//libwx_osx_cocoau_gl-3.2.dylib (compatibility version 3.0.0, current version 3.2.0)
CPack: Create package
CPack: - package: /Users/distiller/project/build/crowdsource_pi-0.1.162.0-darwin-wx32-arm64-x86_64-12.6.3-macos.tar.gz generated.

Sure looks like the paths are being adjusted before the tarball is built.
Are we sure that we are getting the correct tarball?

@redhog
Copy link

redhog commented Jan 13, 2025

So removing -maxdepth 1 did NOt solve the issue.

otool -L _CPack_Packages/Darwin/TGZ/crowdsource_pi-0.1.163.0-darwin-wx32-arm64-x86_64-12.6.3-macos/OpenCPN.app/Contents/PlugIns/libcrowdsource_pi.dylib still lists /usr/local

@jongough
Copy link
Contributor

As far as I can see at the moment the '*dylib' file is created correctly and the change in libraries is done correctly. The listing at the end shows the contents of the modified file. I am not sure what is happening then as the cmake packaging process should have taken that whole directory system and zipped it up. The upload code is just putting the xml file inside the tar file at the root level for Plugin manager to process.

I think there needs to be more debugging information around what is happening with the dylib and tar files.

@jongough
Copy link
Contributor

I have cloned the repository and tried doing the circleci build, but it appears the 'libs' directory is not building correctly for the universal macos build. It appears to be getting mixed up between arm64 and x86 builds:

[100%] Linking CXX shared library libcrowdsource_pi.dylib
/opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/crowdsource_pi.dir/link.txt --verbose=1
ld: warning: ignoring file 'libavro.a[36](wrapped-buffer.c.o)': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file 'libjansson.a[13](value.c.o)': found architecture 'arm64', required architecture 'x86_64'
ld: warning: ignoring file 'libjansson.a[12](utf.c.o)': found architecture 'arm64', required architecture 'x86_64'
....

I may not have configured it all properly, but....

@redhog
Copy link

redhog commented Jan 14, 2025

That's weird, that works fine for me...

Note that the dylib in the _CPack_Packages has broken paths. I assume the install target modifies files in another directory, and ignores the cpack stuff, at least for the fixmacos script...

But I know nothing of cpack, so hard to figure out why...

@jongough
Copy link
Contributor

jongough commented Feb 3, 2025

The next step is to clone the opencpn/plugins directory locally, then use the scripts in the root of the project to download, and check the xml files generated in the build. There is a README file giving you basic instructions on what to do. See how you go and if you have issues let us know.

@rgleason
Copy link
Contributor Author

rgleason commented Feb 4, 2025

Redhog, Awesome. Congratulations. Downloaded it and tried to create an account, but it is not setup yet I guess 401.

@redhog
Copy link

redhog commented Feb 4, 2025

Oh, oupsi. The "sign up with github" works, but I guess the email one is broken? This is using django-allauth so I guess I have to poke at it a bit more... Will ping you @rgleason as soon as I've debugged it!

@rgleason
Copy link
Contributor Author

rgleason commented Feb 4, 2025

Thanks.

@redhog
Copy link

redhog commented Feb 4, 2025

This is a bit embarrasing: By default, email verification is on, but I hadn't set up an smtp account :P But, fixing that, it turned out that the allauth JS/react front end didn't have any code to handle email verification flows, so had to code that up too...

The whole auth flow is still a bit rough around the edges - it needs styling, and a bunch of automatic redirects / next-page stuff isn't there, but now at least it works. Give the thing a spin!

Test hint: You can test the crowdsource plugin without sailing around with your radar on with the help of the VDR plugin if you have a vdr.txt with $RATTM messages (as well as GPS positions and heading for own boat) in it.

@rgleason
Copy link
Contributor Author

rgleason commented Feb 5, 2025

Very impressed with your quick skills setting up for CI builds with testplugin.
What are the areas where things could be clearer?

I don't have one of those SRATTM messages with GPS position and headings, but maybe Hakan does as he is active with Radar_pi.
I will contact him.
https://cloudsmith.io/~opencpn/repos/crowdsource-beta/packages/?q=0.1.182+tarball

Downloaded and installed. Signed up and the confirm email was recieved, and I acknowledged it and signed in using my email and PW. Then I got this message

Unexpected Application Error!
404 Not Found

💿 Hey developer 👋

You can provide a way better UX than this when your app throws errors by providing your own ErrorBoundary or errorElement prop on your route.

@rgleason
Copy link
Contributor Author

rgleason commented Feb 5, 2025

I got back in and made an API key and pasted it into the Preferences api slot.
Does the plugin have an interface or does it just work in the background if you have radar on?
How does it deal with having no internet? Do the files get loaded up when Internet is available? Or does the user copy files etc.?

@redhog
Copy link

redhog commented Feb 5, 2025

Cool! It doesn't have a UI except the preferences window but runs in the background. Any $RATTM messages get cached in a sqlite database, and whenever you have internet they get uploaded. You can see number of unsent tracks and track points in the preferences dialog. It uses an exponential backoff for reconnection attempts. So no file copying :)

The idea is that you might have internet either nearly all the time via say iridium or something, or only when close enough to shore via 3G, or maybe even only over wifi when you're at the dock. The plugin will cope :)

Maybe this needs a bit of an explanation / help text in the pref. dialog?

@redhog
Copy link

redhog commented Feb 5, 2025

Btw, you might find this script helpful: It generates synthetic (not very realistic) $RATTM messages: https://github.com/KAHU-radar/makerattm/blob/master/makerattm.py You still need heading and position messages to mix them with though.

This reminds me: It would be very useful to have a test-rig for opencpn that generates synthetic NMEA fo simulated but realistic voyages and/or a library of recorded real voyages.

And, for the radar plugin specifically: A simulator radar that generates realistic images (based on a map and vessel positions).

@redhog
Copy link

redhog commented Feb 5, 2025

Btw: What is the practical difference between alpha, beta and prod? Which of them actually show up in the plugin list in opencpn (or do they all, but prod has priority)?

@rgleason
Copy link
Contributor Author

rgleason commented Feb 5, 2025

We use them alpha for trial and testing, beta is used for co mmit tagged pushes that are not from master. Prod is used for commits that are tagged and pushed.

These CS all have different retention policies. Prod is longer and larger. We like to see metadata from versions in Prod being pushed to the master catalog.

I am currently moving the old metedata versions from the master publish plugins catalog to the beta plugins catalog. Do not know If i will continue that.

@redhog
Copy link

redhog commented Feb 5, 2025

But all of them go out to the GUI? Or can you somewhere in OpenCPN say if you want to install e.g. beta plugins and not just prod?

@rgleason
Copy link
Contributor Author

rgleason commented Feb 5, 2025

Maybe this will help
jongough/testplugin_pi#348

Push to Cloudsmith [plugin]-beta repository via Github & CircleCI

Push to Cloudsmith [plugin]-prod repository via Github & CircleCI

@redhog
Copy link

redhog commented Feb 5, 2025

Added docs (Hope I did all the linking/naming right), and made a PR against the plugins repo

@rgleason
Copy link
Contributor Author

rgleason commented Feb 6, 2025

Excellent job.

@redhog
Copy link

redhog commented Feb 6, 2025

So, I saw my PR was merged. But no plugin shows up in the plugin manager in OpenCPN. I also don't see my docs show up in https://opencpn-manuals.github.io/main/opencpn-plugins/index.html. So, what did I do wrong?

@rgleason
Copy link
Contributor Author

rgleason commented Feb 6, 2025

You did nothing wrong Elig, we need to get the necessary hooks established so that your manual is brought into the Plugin Manual. Your plugin manual has to be added to a plugin list that is executed.

Mike Rossiter can do that. Will you please contact him?, perhaps through github [Rasbats]

If you have trouble, let me know.

@rgleason
Copy link
Contributor Author

rgleason commented Feb 6, 2025

  1. The crowdsource files exist in plugins/master catalog.
  2. Looking at the log file...
  3. Language file is loaded.
    . ```
    13:37:57.245 MESSAGE OCPNPlatform.cpp:1156 ChangeLocale: Locale Init OK for: en_US
    13:37:57.245 MESSAGE OCPNPlatform.cpp:1175 Loaded translation catalog for: opencpn-crowdsource_pi
    13:37:57.245 MESSAGE OCPNPlatform.cpp:1175 Loaded translation catalog for: opencpn-objsearch_pi
But I don't see a crowdsource dll plugin in the plugin manager in OpenCPN.

13:38:00.470 MESSAGE plugin_loader.cpp:640 PluginLoader searching for PlugIns in location C:\Users\fcgle\AppData\Local\opencpn\plugins
13:38:00.516 MESSAGE plugin_loader.cpp:678 Found 32 candidates
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\admiralty_tide_tables_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\aisradar_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\autopilot_route_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\AutoTrackRaymarine_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\celestial_navigation_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\chartscale_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\DashboardSK_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\deviation_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\engine_dashboard_pi.dll
13:38:00.516 MESSAGE plugin_loader.cpp:442 Checking plugin candidate: C:\Users\fcgle\AppData\Local\opencpn\plugins\findit_pi.dll

@redhog
Copy link

redhog commented Feb 6, 2025

I did test the windows build using "Import plugin..." and that worked... But when a plugin isn't yet installed, it surely can't find the dll locally yet? That needs download first, right? When you just update the plugin catalog, you just get a bunch of xml-files, right?

@redhog
Copy link

redhog commented Feb 6, 2025

I pinged Mike Rossiter's github on https://opencpn.zulipchat.com . What's their github username btw?

@jongough
Copy link
Contributor

jongough commented Feb 6, 2025

The import of the tar file uses the xml embedded in the tar file for compatibility testing. The plugin code is placed, I think, in the plugin cache, but it is not loaded. You then just need to select the plugin in plugin manager and try activating it. This will then try to make the plugin work and will highlight any issues. The plugin manager catalog, when you download it, just downloads the catalog xml files that are in the prod/beta/alpha repository, but does not download the tar file until you install it. I think the latter process automatically activates the plugin as well, so it appears as one process.

@redhog
Copy link

redhog commented Feb 6, 2025

@jongough Yep, so then the question is still, why isn't it showing up in the catalog / the list when updating the catalog?

@redhog
Copy link

redhog commented Feb 6, 2025

Aha! It is. In the xml. But: I'm on debian bookworm, and that debian version isn't in the circleci list, so no plugin is compiled for my platform! I'll fix and make a new version.

@jongough
Copy link
Contributor

jongough commented Feb 6, 2025

If you are using FE2 then all the supported platforms/versions will be generated.

If you have generated into cloudsmith and download the tar file from there, then you need to download into a local clone of plugins the XML using the supplied download scripts. It is advised to check the XML using the validate script before adding/staging, committing, pushing and creating a pull request on opencpn/plugins. It will then get merged, normally within a hour or so and will become available through the 'catalog update' process.

@rgleason
Copy link
Contributor Author

rgleason commented Feb 7, 2025

Elig,

Aha! It is. In the xml. But: I'm on debian bookworm, and that debian version isn't in the circleci list, so no plugin is compiled for my platform! I'll fix and make a new version.

That's what I told you earlier. It is in the catalog, but it doesn't appear on my Windows machine either and there is absolutely no message that it is incompatible or fails, AND I can see that the plugin manager is loading the po files.

I have never seen this happen. BTW Jon, Elig's crowdsource is using TP Frontend2

@jongough
Copy link
Contributor

jongough commented Feb 7, 2025

I have just started a windows 10 machine, updated OCPN to 5.10.2, updated the plugin catalog for master, looked for and found KAHU Radar Hub, selected it and installed it. Went into is properties and they showed up and asked me to make an account which I did, I created and added the API . That is about as far as I can get.

As for bookworm the current FE2 builds for"

          - build-debian-arm64-12-bookworm:
              <<: *std-filters
          - build-debian-armhf-12-bookworm:
              <<: *std-filters
          - build-debian-x86_64-12-bookworm:
              <<: *std-filters

So it should be there, but I don't have a test machine for that, so cannot verify.

@redhog
Copy link

redhog commented Feb 7, 2025

@jongough If you get that far, the only step left is to either load some $RATTM messages using the VDR plugin (but then please tell me so I can mark the tracks you upload as tests, should add a GUI for that), or by adding the radar plugin and actually go for a sailing trip (no idea where you are and if the season is sailable, here in norway all the boats are up on land right now) :)

@rgleason
Copy link
Contributor Author

rgleason commented Feb 7, 2025

### Crowdsource is not listed by Plugin Manager

Have you looked carefully at the metadata output?
I don't find anything in the crowdsource-prod repository, but I do find
https://cloudsmith.io/~opencpn/repos/crowdsource-beta/packages/?q=0.1.183.0+msvc+tarball

I downloaded one of the metadata file for this tarball and looked at it.
https://cloudsmith.io/~opencpn/repos/crowdsource-beta/packages/?q=0.1.183.0+msvc+metadata

And found this target

https://dl.cloudsmith.io/public/opencpn/crowdsource-beta/raw/names/crowdsource_pi-0.1.183.0-msvc-x86-wx32-10.0.20348-MSVC-tarball/versions/0.1.183.0+1582.9cd1ef5/crowdsource_pi-0.1.183.0-msvc-x86-wx32-10.0.20348-MSVC.tar.gz

When I put that url into my browser, the file is found and downloaded to my downloads directory.
So that does work, and the paths do seem to be correct.

So why are the plugins dlls not being found by Plugin Manager?
You would think that there would at least be an error in the log file.

I see what happened now.

Crowdsource ----> Kahu Radar Hub

This must be changed. It is very confusing to the user. What is this plugin Crowdsource or Kahu Radar Hub?
I asked this question before we even started.

@jongough
Copy link
Contributor

jongough commented Feb 7, 2025

I only installed the plugin to demonstrate that it was there. I don't have radar where I am (not on the boat). But got most of the plugin working. However, as Rick says above, the plugin is not called crowdsource, rather it is called KAHU Radar Hub which makes it difficult to find. However, the build and push to cloudsmith is working as it should. So a small change should get the plugin name to match what you want and then you should be able to find it easily.

I'm in Australia, so it is supposed to be good weather, but we seem to be having quite a few storms and LOTS of rain. So, not as good as it should be!

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

5 participants