gnuradio icon indicating copy to clipboard operation
gnuradio copied to clipboard

grc: use state directory in generated python

Open marcusmueller opened this issue 1 year ago • 4 comments

Description

Oversight on my side: new statedir is used for saving hier-blocks, but not for reading them

Related Issue

main version of maint-3.10 #7454

Which blocks/areas does this affect?

GRC

Testing Done

Manual

Checklist

marcusmueller avatar Jul 28 '24 17:07 marcusmueller

It sounds like this one is worth another release? Or does the problem hit only under certain conditions?

willcode avatar Jul 28 '24 21:07 willcode

If .grc_gnuradio exists but not .local/state/gnuradio, then I get the following error:

Traceback (most recent call last):
  File "/home/argilo/prefix_310/src/gr-ieee-80211/examples/wifi_loopback.py", line 24, in get_state_directory
    log.warn(f"Found persistent state path '{newpath}', but file does not exist. " +
    ^^^
NameError: name 'log' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/argilo/prefix_310/src/gr-ieee-80211/examples/wifi_loopback.py", line 47, in <module>
    sys.path.append(os.environ.get('GRC_HIER_PATH', get_state_directory()))
                                                    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/argilo/prefix_310/src/gr-ieee-80211/examples/wifi_loopback.py", line 33, in get_state_directory
    log.warn("Could not retrieve GNU Radio persistent state directory from GNU Radio." +
    ^^^
NameError: name 'log' is not defined

argilo avatar Jul 28 '24 22:07 argilo

@argilo is that with the PR, or is that why we need the PR?

willcode avatar Jul 28 '24 22:07 willcode

It's a bug in this PR.

argilo avatar Jul 28 '24 22:07 argilo

This pr should be applied. Otherwise we can generate hier blocks and use them in defining flowgraphs, but the flowgraphs fail to execute. The fg's only execute if you copy the corresponding *.py file from ~/.local/state/gnuradio to ~/.grc_gnuradio

dl1ksv avatar Sep 22 '24 10:09 dl1ksv

Backport note: maint-3.10 PR is already queued up.

willcode avatar Sep 23 '24 18:09 willcode

This is an improvement, but there were still several bugs present in this PR. We should probably open up an issue for those.

argilo avatar Sep 23 '24 18:09 argilo