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

Build with Nix #29

Merged
merged 135 commits into from
Aug 17, 2024
Merged

Build with Nix #29

merged 135 commits into from
Aug 17, 2024

Conversation

quapka
Copy link
Collaborator

@quapka quapka commented Jun 21, 2024

Building with Nix is one way of allowing multiple versions of tested libs to be running at the same time. Currently, few versions of OpenSSL are possible, check the commit message for more details.

More work is needed before merging this.

Jan Kvapil and others added 5 commits March 26, 2024 09:42
Currently, only running different versions of OpenSSL is implemented as
PoC to see if it would work. You can either build it or run it directly
with:
```
$ nix run '.?submodules=1#openssl_316' list-libs # uses OpenSSL 3.1.6
$ nix run '.?submodules=1#openssl_322' list-libs # uses OpenSSL 3.2.2
$ nix run '.?submodules=1' list-libs # uses OpenSSL 3.3.1
```

Adding new versions is possible, check `packages` part of `flake.nix`.

To see the supported versions run:
```
$ nix flake show
```
Copy link
Member

@J08nY J08nY left a comment

Choose a reason for hiding this comment

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

Cool stuf, I will try it out. Could you also add a github workflow that does the build using nix? Basically take the test workflow, strip out the reader and applet stuff.

flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@J08nY
Copy link
Member

J08nY commented Jun 21, 2024

Oh and one more thing. Can you make the version of the library propagate as an environment variable to the build and run environment? Then in the Makefile we can pass it on as a define to the compiler and thus get it in the shim code so that we can do ifdefs based on it.

@quapka
Copy link
Collaborator Author

quapka commented Jun 21, 2024

Oh and one more thing. Can you make the version of the library propagate as an environment variable to the build and run environment? Then in the Makefile we can pass it on as a define to the compiler and thus get it in the shim code so that we can do ifdefs based on it.

Yes. Both should be somewhat simple and straightforward.

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.66%. Comparing base (65ddb49) to head (8d54fae).

Files Patch % Lines
...crcs/ectester/standalone/libs/NativeECLibrary.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #29      +/-   ##
============================================
+ Coverage     62.65%   62.66%   +0.01%     
+ Complexity     1349     1348       -1     
============================================
  Files           133      133              
  Lines          9358     9348      -10     
  Branches       1288     1287       -1     
============================================
- Hits           5863     5858       -5     
+ Misses         2882     2877       -5     
  Partials        613      613              
Components Coverage Δ
Applet 70.27% <ø> (ø)
Common 57.41% <ø> (ø)
Reader 55.44% <ø> (ø)
Standalone 71.05% <90.00%> (+0.07%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

In order to prevent problems with dynamic linking of OpenSSL, LibreSSL
and BoringSSL -- that all have libcrypto.so -- we link statically into
the providers.
flake.nix Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
@quapka
Copy link
Collaborator Author

quapka commented Aug 14, 2024

Few more things I thought of:

  • [Technicality] We shall be using apps instead of packages, see Flakes
  • [Low prio] Add builders for other Gradle targets, such as applet and reader.

@J08nY
Copy link
Member

J08nY commented Aug 17, 2024

Few more things I thought of:

  • [Technicality] We shall be using apps instead of packages, see Flakes
  • [Low prio] Add builders for other Gradle targets, such as applet and reader.

I would not actually do any of these. The second one especially, I would keep the applet and reader subprojects as they are.

@J08nY J08nY merged commit 2b5a0e4 into crocs-muni:master Aug 17, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants