You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merged PR 10509720: Make msbignum and rsa32 optional for MSBuild
This change updates the MSBuild projects to make the inclusion of msbignum and rsa32 optional. This will allow external users to more easily use MSBuild, and also unblock testing potential future changes to undocked pipelines.
Copy file name to clipboardExpand all lines: BUILD.md
+24-19Lines changed: 24 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ combinations, and we're working on adding support for more.
17
17
SymCrypt supports a variety of operating systems, CPU architectures, and runtime environments, but due to functionality
18
18
gaps in the build systems we use, not every combination is supported by every build system. Specifically, because
19
19
CMake does not currently support building kernel mode components, we also support MSBuild for building kernel-mode
20
-
libraries on Windows. Internally, we used Razzle as our legacy build system, but SymCrypt's support for Razzle builds
21
-
is on a deprecation path and will be removed in a future release. Additionally, it has not been tested with the
22
-
public open source version of Razzle, and is unlikely to work with it.
20
+
libraries on Windows. Internally, we previously used Razzle as our legacy build system, but SymCrypt's support
21
+
for Razzle builds is on a deprecation path and will be removed in a future release. Additionally, it has not been
22
+
tested with the public open source version of Razzle, and is unlikely to work with it.
23
23
24
24
The ability to build SymCrypt on any particular platform or architecture, with or without ASM optimizations, does not
25
25
imply that it has been tested for or is actively supported by Microsoft on that platform/architecture. While we make
@@ -30,18 +30,19 @@ warranties of merchantability, fitness for a particular purpose and noninfringem
30
30
## Build Instructions
31
31
For Microsoft employees building the library internally, to include msbignum and RSA32 implementation benchmarks in
32
32
the unit tests, make sure the SymCryptDependencies submodule is initialized by following the steps above
33
-
(`git submodule update --init`). When building, provide the additional CMake argument `-DSYMCRYPT_TEST_LEGACY_IMPL=ON`.
34
-
This only affects the unit tests, and does not change the functionality of the SymCrypt library itself.
33
+
(`git submodule update --init`). When building, specify `/p:SymCryptTestLegacyImpl=true` for MSBuild,
34
+
or `-DSYMCRYPT_TEST_LEGACY_IMPL=ON` for CMake. This only affects the unit tests, and does not change the
35
+
functionality of the SymCrypt library itself.
35
36
36
37
### Using Python scripts
37
38
Building SymCrypt can be complicated due to the number of platforms, architectures and targets supported. To improve
38
-
ease of use and have a consistent build solution that can be leveraged by both developers and our automated CI pipelines,
39
-
we have created a set of Python scripts to help with building, testing and packaging. You can run`scripts/build.py --help`
40
-
to get help with supported options.
39
+
ease of use and have a consistent build solution that can be leveraged by both developers and our automated CI
40
+
pipelines, we have created a set of Python scripts to help with building, testing and packaging. You can run
41
+
`scripts/build.py --help`to get help with supported options.
41
42
42
43
1. To build SymCrypt for Windows or Linux using the CMake build system, run `scripts/build.py cmake build_dir` where `build_dir` is the desired build output directory.
43
44
* To see additional options, run `scripts/build.py cmake --help`.
44
-
* On Windows, the the build script also supports MSBuild. Currently this is for internal use only. To use MSBuild, run `scripts\build.py msbuild`. The output directory for MSBuild is always `build\bin`.
45
+
* On Windows, the the build script also supports MSBuild. To use MSBuild, run `scripts\build.py msbuild`. The output directory for MSBuild is always `build\bin`.
45
46
1. To run the unit tests after a build has finished, run `scripts/test.py build_dir`.
46
47
* Additional positional arguments will be passed directly to the unit test executable.
47
48
1. To package up the built binaries into an archive, run `scripts/package.py build_dir arch configuration module_name release_dir`, where:
@@ -52,9 +53,9 @@ to get help with supported options.
52
53
*`release_dir` is the output directory for the release archive
53
54
54
55
### Building with CMake
55
-
If you don't want to use the Python helper scripts, or if they do not support the specific build flags you desire, you can
56
-
build SymCrypt by directly invoking CMake. Note that Python is still required for translating SymCryptAsm and building the
57
-
Linux modules with FIPS integrity checks.
56
+
If you don't want to use the Python helper scripts, or if they do not support the specific build flags you desire,
57
+
you can build SymCrypt by directly invoking CMake. Note that Python is still required for translating SymCryptAsm
58
+
and building the Linux modules with FIPS integrity checks.
58
59
59
60
1. Run `cmake -S . -B bin` to configure your build. You can add the following optional CMake arguments to change build options:
60
61
*`-DSYMCRYPT_TARGET_ARCH=<AMD64|X86|ARM64>` to choose a target architecture. If not specified, it will default to the host system architecture.
@@ -74,12 +75,11 @@ to your build directory:
74
75
*`exe` - unit tests
75
76
76
77
### Building with MSBuild
77
-
Currently, MSBuild is only supported internally for use in Azure DevOps pipelines that produce artifacts for Windows.
78
-
Building the SymCrypt unit tests with MSBuild requires access to the msbignum and RSA32 implementations, which cannot
79
-
be released externally due to licensing restrictions. If you wish to build directly with MSBuild, bypassing the Python
80
-
helper script, you can run `msbuild /p:Platform=<platform> /p:Architecture=<arch> symcrypt.sln`. Note that Python is
81
-
still required for translating SymCryptAsm. The output directory for MSBuild is always `build\bin`, and all compiled
82
-
outputs are placed in this directory.
78
+
SymCrypt also supports building with MSBuild on Windows. This is primarily intended for Microsoft-internal use in
79
+
official builds, for compatibility with the Windows engineering system. If you wish to build directly with MSBuild,
80
+
bypassing the Python helper script, you can run `msbuild /p:Platform=<platform> /p:Architecture=<arch> symcrypt.sln`.
81
+
Note that Python is still required for translating SymCryptAsm. The output directory for MSBuild is always `build\bin`,
82
+
and all compiled outputs are placed in this directory.
`symcryptunittest.exe` can be used to compare and measure performance of algorithms provided by SymCrypt and OpenSSL. On Windows `symcryptunittest.exe` would have to be compiled with OpenSSL. `nasm` and `strawberryperl` are prerequisites to building OpenSSL.
107
+
`symcryptunittest.exe` can be used to compare and measure performance of algorithms provided by SymCrypt and OpenSSL.
108
+
On Windows `symcryptunittest.exe` would have to be compiled with OpenSSL. `nasm` and `strawberryperl` are
109
+
prerequisites to building OpenSSL.
110
+
108
111
```
109
112
winget install nasm strawberryperl
110
113
.\scripts\build.py cmake bin --config Release --openssl-build-from-source
111
114
```
112
115
113
116
And on Linux we can use OpenSSL installed by system's package manager.
117
+
114
118
```
115
119
sudo apt install -y libssl-dev
116
120
./scripts/build.py cmake bin --config Release --openssl
117
121
```
118
122
119
123
To build OpenSSL on Linux we need to install following prerequisites.
124
+
120
125
```
121
126
sudo apt install -y nasm perl
122
127
.\scripts\build.py cmake bin --config Release --openssl-build-from-source
0 commit comments