Adds support for making environment for arch linux and some other dis… #325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
resolves #142
Description
This pull request adds support for making environment for Arch Linux and other redhat-based distributions such as Oracle Linux and CentOS.
A new script called
make-environment-linux.sh
has been added and called after https://github.com/microsoft/electionguard-cpp/blob/8f8bcb550a273c58d7336f61621b00339913d817/Makefile#L47 when Linux is detected in the Makefile.The following functionality is added in this pull request:
make-environment-linux.sh
script detects the Linux distribution based on popular package managers such as dnf, yum, apt, and pacman. More support for other distributions can be added through this method in the future e.g. zypper for OpenSuse.distribution not supported
message.iwyu
package is not available in the official repos for CentOS-8 and Oracle Linux 8/9 so we try to build it from the github repo.lcov
package and if not available, the latest rpm from github repo is downloaded and installed locally.The new additions do not break the current support for debian-based distributions but add more support for other distributions.
Testing
Official docker images were used to test the new feature. These include:
I am attaching the standard output console logs logs.zip resulting from running
make
with this PR.I have also tested it on CentOS 7 and Oracle Linux 7. The
make environment
tasks work fine, but there are CMake errors that need to be looked at.cmake -S . -B /root/electionguard-cpp/build/libs/x86_64/Release \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON \ -DCAN_USE_VECTOR_INTRINSICS=ON \ -DCPM_SOURCE_CACHE=/root/electionguard-cpp/.cache/CPM CMake Error: The source directory "/root/electionguard-cpp/build/libs/x86_64/Release" does not exist. Specify --help for usage, or press the help button on the CMake GUI.
Since these distributions are not the latest ones and may not be supported anymore, therefore, we can avoid their support.