Skip to content

Use pvxslibs instead of qsrv#132

Merged
coretl merged 2 commits intomasterfrom
pvxslibs
Jul 5, 2023
Merged

Use pvxslibs instead of qsrv#132
coretl merged 2 commits intomasterfrom
pvxslibs

Conversation

@coretl
Copy link
Copy Markdown
Contributor

@coretl coretl commented Jun 6, 2023

This is not currently working

@coretl
Copy link
Copy Markdown
Contributor Author

coretl commented Jun 6, 2023

@mdavidsaver I'm trying to use QSRV2 in pythonSoftIOC, but I'm missing something. When I make the changes in this PR, install into a venv, and run venv/bin/python docs/examples/example_asyncio_ioc.py I get:

Unable to find symbol 'pvar_dset_devLoPDBQ2UTag' : /venv/lib/python3.10/site-packages/epicscorelibs/lib/libdbCore.so.7.0.7.99.0: undefined symbol: pvar_dset_devLoPDBQ2UTag
Unable to find dset for record type 'longin' support 'devLoPDBQ2UTag' : (null)
Traceback (most recent call last):
  File "/pythonSoftIOC/docs/examples/example_asyncio_ioc.py", line 2, in <module>
    from softioc import softioc, builder, asyncio_dispatcher
  File "/venv/lib/python3.10/site-packages/softioc/__init__.py", line 28, in <module>
    raise RuntimeError('Error registering')
RuntimeError: Error registering

I thought these symbols might have been from the demo application, so commented out everything apart from the registrar calls in pvxsIoc.dbd, but then I get:

Unable to find symbol 'pvar_func_pvxsBaseRegistrar' : /venv/lib/python3.10/site-packages/epicscorelibs/lib/libdbCore.so.7.0.7.99.0: undefined symbol: pvar_func_pvxsBaseRegistrar
Unable to find registrar 'pvxsBaseRegistrar' : (null)
Traceback (most recent call last):
  File "/pythonSoftIOC/docs/examples/example_asyncio_ioc.py", line 2, in <module>
    from softioc import softioc, builder, asyncio_dispatcher
  File "/venv/lib/python3.10/site-packages/softioc/__init__.py", line 28, in <module>
    raise RuntimeError('Error registering')
RuntimeError: Error registering

I see these same errors when importing in CI:
https://github.com/dls-controls/pythonSoftIOC/actions/runs/5189205532/jobs/9353980317?pr=132

I am using pvxslibs 1.2.1a1.

I added the DSOs and include path in setup.py, then loaded the dbd in __init__.py, is there anything I missed?

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 7, 2023

Unit Test Results

     15 files  ±0       15 suites  ±0   28m 54s ⏱️ + 2m 27s
   273 tests ±0     257 ✔️ ±0    16 💤 ±0  0 ±0 
4 095 runs  ±0  3 505 ✔️ ±0  590 💤 ±0  0 ±0 

Results for commit 6a99229. ± Comparison against base commit c826477.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 8, 2023

Codecov Report

Merging #132 (6a99229) into master (860f59c) will increase coverage by 0.21%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
+ Coverage   87.34%   87.56%   +0.21%     
==========================================
  Files          14       14              
  Lines         996     1005       +9     
==========================================
+ Hits          870      880      +10     
+ Misses        126      125       -1     
Impacted Files Coverage Δ
softioc/__init__.py 95.00% <100.00%> (+2.14%) ⬆️
softioc/builder.py 97.68% <100.00%> (+0.04%) ⬆️

... and 1 file with indirect coverage changes

@coretl coretl changed the title Try to use pvxslibs instead of qsrv Use pvxslibs instead of qsrv Jul 4, 2023
Comment thread softioc/builder.py
Comment on lines +269 to +271
def qform_string(rec):
rec.add_info("Q:form", "String")
return rec
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes QSRV2 treat a waveform as a string...

Comment thread softioc/builder.py

fields['NELM'] = length
fields['FTVL'] = 'UCHAR'
fields['FTVL'] = 'CHAR'
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... but only if FTVL is CHAR

Comment thread softioc/__init__.py
Comment on lines +29 to +30
ctypes.CDLL(find_dso('pvxslibs.lib.pvxsIoc'), ctypes.RTLD_GLOBAL)
os.environ.setdefault('PVXS_QSRV_ENABLE', 'YES')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pvxslibs needs to be loaded here, rather than linked in like dbCore, etc

Also work around Flake8 5.0 issue by pinning.
Copy link
Copy Markdown
Collaborator

@AlexanderWells-diamond AlexanderWells-diamond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. At some point we may want to add more tests for various other QSRV features but this is fine for now.

Once this is merged could you also close #133 ?

@coretl coretl marked this pull request as ready for review July 5, 2023 13:29
@coretl coretl merged commit dc24736 into master Jul 5, 2023
@coretl coretl deleted the pvxslibs branch July 5, 2023 13:29
@coretl coretl mentioned this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants