Skip to content

Conversation

@JacobBarthelmeh
Copy link
Contributor

No description provided.

@JacobBarthelmeh JacobBarthelmeh self-assigned this Dec 11, 2025
@joakim-strandberg
Copy link

It's a good idea to add Ada examples to this repository.

The current solution requires a global installation of the Ada GNAT Compiler and GprBuild.
The current solution also expects the wolfssl git repository to be found in a specific directory.
It would be better if we could base the workflow on the Alire (alr) package manager for Ada, which does not require hard-coded directory paths.

Probably not a complete recipe to do this, but:

  1. In the file sha256.gpr remove the 'with "wolfssl_sha256.gpr";' and replace with 'with "wolfssl.gpr";'.
  2. Remove the wolfssl_sha256.gpr file. It should not be necessary. Also it imports a wolfssl_config.gpr which is auto-generated by alr and should not be added to the git repository.
  3. The ../Ada/sha256/ directory should be made into a project directory for alr. To do this:
    cd ../Ada/sha256/
    alr init --bin --in-place
    Answer the questions that alr asks. On the question of crate name, one can put for example "sha256".
  4. Make sure the generated gpr-file by alr points out the application entry point sha256_main.adb.
  5. Update .gitignore with files generated by alr that should not be included like alire/ and config/ directories.
  6. Right now the crate does not know that it has a dependency upon the wolfssl crate. To add this dependency "alr with wolfssl".
  7. If everything is OK, like an updated wolfssl crate with the latest version of the Ada binding, it should be possible to build the source code with the command "alr build". This will download all dependencies, including compilers and tools, if not already done and build the Ada application.

@joakim-strandberg
Copy link

Let me know if there are any issues.

I think currently doing "alr build" in the last step will fail with compilation errors of the Ada code because the WolfSSL Ada package will lack the Sha256 subprograms. But that will be fixed as soon as they are added the master branch, and the Alire index is updated with a new git commit that contains the changes. Irvise or mgrojo can help out with this step when we get to it.

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

Successfully merging this pull request may close these issues.

2 participants