Skip to content

Add RISC-V support to jhack #227

Open

Description

@taurus-forever

Hi,

There are PoC for Juju on RISC-V but it is hard to test/troubleshoot it without jhack.
Can you please add RISC-V to the list of supported architectures for jhack?

Tnx!

Activity

  1. PietroPasotti commented on Aug 26, 2025

    @PietroPasotti
    Collaborator

    uhm what would that entail? just add it to the snap architectures for building, or are there other consequences?
    I have no means to test on risc-v.
    Have you verified that jhack works from sources on that arch?

  2. taurus-forever commented on Dec 4, 2025

    @taurus-forever
    Author

    Missed this thread. TL;DR: I would say, yes, simply add new architecture, works from sources:

    taurus@riscv64:$ uname -a
    Linux riscv64 6.6.20-6-fml13v01 #0ubuntu1 SMP Wed Apr 23 21:44:30 UTC 2025 riscv64 riscv64 riscv64 GNU/Linux
    
    taurus@riscv64:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID:	Ubuntu
    Description:	Ubuntu 24.04.3 LTS
    Release:	24.04
    Codename:	noble
    
    taurus@riscv64:~$ git clone https://github.com/canonical/jhack
    taurus@riscv64:~$ cd jhack/
    taurus@riscv64:~/jhack$ pip install -e . --break-system-packages
    taurus@riscv64:~/jhack$ jhack version
    jhack 0.4.4.0.24
    

    There is some noise, e.g. the first version call has:

    taurus@riscv64:~/jhack$ jhack version
    /home/taurus/jhack/jhack/utils/integrate.py:399: SyntaxWarning: invalid escape sequence '\['
      print(f"{ep1} {sym}-\[{interface}]-{sym} {ep2}")
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:18: SyntaxWarning: invalid escape sequence '\S'
      _optional_prefix = "(\S+)?( )?"
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:22: SyntaxWarning: invalid escape sequence '\S'
      base_pattern + "(?P<endpoint>\S+):(?P<endpoint_id>\S+): " + _optional_prefix
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:25: SyntaxWarning: invalid escape sequence '\S'
      operator_event_suffix = "Charm called itself via hooks/(?P<event>\S+)\."
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:28: SyntaxWarning: invalid escape sequence '\S'
      event_suffix = "Emitting Juju event (?P<event>\S+)\."
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:33: SyntaxWarning: invalid escape sequence '\S'
      jhack_fire_evt_suffix = "The previous (?P<event>\S+) was fired by jhack\."
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:36: SyntaxWarning: invalid escape sequence '\S'
      "(?P<event>\S+) \((?P<jhack_replayed_evt_timestamp>\S+(\s*\S+)?)\) was replayed by jhack\."
    /home/taurus/jhack/jhack/utils/tail_charms/core/parser.py:65: SyntaxWarning: invalid escape sequence '\/'
      lobotomy_suffix = "(?:selective|full) lobotomy ACTIVE: event hooks\/(?P<event>\S+) ignored."
    /home/taurus/jhack/jhack/utils/sync.py:151: SyntaxWarning: invalid escape sequence '\.'
      include_files: str = ".*\.py$",
    /home/taurus/jhack/jhack/utils/nuke.py:39: SyntaxWarning: invalid escape sequence '\_'
      NUKE_ASCII_ART = """
    /home/taurus/jhack/jhack/utils/nuke.py:54: SyntaxWarning: invalid escape sequence '\`'
      NUKE_GENTLY_ASCII_ART = """
    /home/taurus/jhack/jhack/utils/tail_logs.py:203: SyntaxWarning: invalid escape sequence '\['
      focus_spec = "\[{}]".format("|".join(self.focus))
    jhack 0.4.4.0.24
    taurus@riscv64:~/jhack$
    

    but it works well on the second+ retries... could be addressed later.

    Also:

    Image

    Sure, I can test riscv snap, in theory it is as simple as:

    taurus@riscv64:~/jhack$ git diff
    diff --git a/snapcraft.yaml b/snapcraft.yaml
    index 127fcee..85367de 100644
    --- a/snapcraft.yaml
    +++ b/snapcraft.yaml
    @@ -8,6 +8,7 @@ platforms:
       arm64:
       ppc64el:
       s390x:
    +  riscv64:
     
     adopt-info: jhack
     summary: Cli tool packed with juju hacks.
    

    Tnx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions