intel/tdx-tools

Can not build successfully with 2023WW27 SW stack about build-intel-mvp-vtpm-td

qhbqyj opened this issue · 7 comments

qhbqyj commented

/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td
++ pushd deps/td-shim
/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim /home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td
++ cargo xbuild -p td-shim --target x86_64-unknown-none --release --features=main,tdx --no-default-features
warning: user-defined alias xbuild is shadowing an external subcommand found at: /root/.cargo/bin/cargo-xbuild
This was previously accepted but is being phased out; it will become a hard error in a future release.
For more information, see issue #10049 rust-lang/cargo#10049.
Updating crates.io index
Compiling compiler_builtins v0.1.82
Compiling core v0.0.0 (/root/.rustup/toolchains/nightly-2022-11-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling proc-macro2 v1.0.63
Compiling unicode-ident v1.0.10
Compiling quote v1.0.29
Compiling syn v1.0.109
Compiling autocfg v1.1.0
Compiling rustversion v1.0.13
Compiling version_check v0.9.4
Compiling typenum v1.16.0
Compiling log v0.4.19
Compiling scopeguard v1.1.0
Compiling libc v0.2.147
Compiling bit_field v0.10.2
Compiling anyhow v1.0.71
Compiling spin v0.5.2
Compiling r-efi v3.2.0
Compiling bitflags v1.3.2
Compiling volatile v0.4.6
Compiling x86 v0.47.0
Compiling either v1.8.1
Compiling cc v1.0.79
Compiling lazy_static v1.4.0
Compiling generic-array v0.14.7
Compiling lock_api v0.4.10
Compiling spin v0.9.8
Compiling x86_64 v0.14.10
Compiling which v4.4.0
Compiling scroll_derive v0.10.5
Compiling zerocopy-derive v0.3.2
Compiling scroll v0.10.2
Compiling td-uefi-pi v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-uefi-pi)
Compiling tdx-tdcall v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/tdx-tdcall)
Compiling td-layout v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-layout)
Compiling td-shim v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-shim)
Compiling rustc-std-workspace-core v1.99.0 (/root/.rustup/toolchains/nightly-2022-11-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling alloc v0.0.0 (/root/.rustup/toolchains/nightly-2022-11-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
Compiling cpufeatures v0.2.9
Compiling cfg-if v1.0.0
Compiling byteorder v1.4.3
Compiling bitfield v0.13.2
Compiling raw-cpuid v10.7.0
Compiling zerocopy v0.6.1
Compiling td-loader v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-loader)
Compiling spinning_top v0.2.5
Compiling linked_list_allocator v0.10.5
Compiling block-buffer v0.10.4
Compiling crypto-common v0.1.6
Compiling digest v0.10.7
Compiling td-logger v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-logger)
Compiling td-exception v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-exception)
Compiling sha2 v0.10.7
Compiling cc-measurement v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/cc-measurement)
Compiling td-paging v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-paging)
Finished release [optimized] target(s) in 12.38s
++ popd
/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td
++ cargo xbuild --target x86_64-unknown-none --features=td-logger/tdx,sha256,sha384 -p vtpmtd --release
warning: user-defined alias xbuild is shadowing an external subcommand found at: /root/.cargo/bin/cargo-xbuild
This was previously accepted but is being phased out; it will become a hard error in a future release.
For more information, see issue #10049 rust-lang/cargo#10049.
warning: /home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/src/vtpmtd/Cargo.toml: unused manifest key: dependencies.td-shim.default-featuers
Compiling compiler_builtins v0.1.82
Compiling core v0.0.0 (/root/.rustup/toolchains/nightly-2022-11-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
Compiling proc-macro2 v1.0.63
Compiling quote v1.0.29
Compiling unicode-ident v1.0.9
Compiling syn v1.0.109
Compiling autocfg v1.1.0
Compiling version_check v0.9.4
Compiling rustversion v1.0.12
Compiling cc v1.0.79
Compiling typenum v1.16.0
Compiling scopeguard v1.1.0
Compiling log v0.4.19
Compiling libc v0.2.147
Compiling serde v1.0.164
Compiling bit_field v0.10.2
Compiling spin v0.5.2
Compiling bitflags v1.3.2
Compiling r-efi v3.2.0
Compiling volatile v0.4.6
Compiling anyhow v1.0.71
Compiling serde_json v1.0.99
Compiling either v1.8.1
Compiling unicode-xid v0.2.4
Compiling ryu v1.0.13
Compiling x86 v0.47.0
Compiling itoa v1.0.6
Compiling paste v1.0.12
Compiling tpm v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/src/tpm)
Compiling lazy_static v1.4.0
Compiling generic-array v0.14.7
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling lock_api v0.4.10
Compiling ring v0.16.20 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/rust-spdm/external/ring)
warning: unnecessary parentheses around match arm expression
--> deps/rust-spdm/external/ring/build.rs:628:21
|
628 | "x86_64" => ("win64"),
| ^ ^
|
= note: #[warn(unused_parens)] on by default
help: remove these parentheses
|
628 - "x86_64" => ("win64"),
628 + "x86_64" => "win64",
|

warning: unnecessary parentheses around match arm expression
--> deps/rust-spdm/external/ring/build.rs:629:18
|
629 | "x86" => ("win32"),
| ^ ^
|
help: remove these parentheses
|
629 - "x86" => ("win32"),
629 + "x86" => "win32",
|

Compiling spin v0.9.8
Compiling x86_64 v0.14.10
Compiling which v4.4.0
Compiling syn v2.0.22
warning: ring (build script) generated 2 warnings
Compiling synstructure v0.12.6
Compiling scroll_derive v0.10.5
Compiling zerocopy-derive v0.3.2
Compiling der_derive v0.5.0
Compiling der_derive v0.4.1
Compiling scroll v0.10.2
Compiling td-uefi-pi v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-uefi-pi)
Compiling tdx-tdcall v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/tdx-tdcall)
Compiling serde_derive v1.0.164
Compiling zeroize_derive v1.4.2
Compiling td-layout v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-layout)
Compiling td-shim v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-shim)
Compiling rustc-std-workspace-core v1.99.0 (/root/.rustup/toolchains/nightly-2022-11-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
Compiling spdmlib v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/rust-spdm/spdmlib)
Compiling alloc v0.0.0 (/root/.rustup/toolchains/nightly-2022-11-15-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
Compiling cfg-if v1.0.0
Compiling untrusted v0.7.1
Compiling byteorder v1.4.3
Compiling zeroize v1.6.0
Compiling cpufeatures v0.2.8
Compiling time-core v0.1.1
Compiling conquer-util v0.3.0
Compiling bitfield v0.13.2
Compiling der v0.4.5
Compiling bytes v1.4.0
Compiling codec v0.2.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/rust-spdm/codec)
Compiling const-oid v0.7.1
Compiling bit_field v0.9.0
Compiling getrandom v0.2.10
Compiling raw-cpuid v10.7.0
Compiling time v0.3.22
Compiling conquer-once v0.3.2
Compiling bitmap-allocator v0.1.0 (https://github.com/rcore-os/bitmap-allocator?rev=03bd9909#03bd9909)
Compiling der v0.5.1
Compiling rust-tpm-20-ref v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/rust-tpm-20-ref)
Compiling zerocopy v0.6.1
Compiling td-loader v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-loader)
Compiling spinning_top v0.2.5
warning: unused doc comment
--> deps/rust-spdm/external/ring/src/aead/chacha.rs:110:9
|
110 | / /// XXX: Although this takes an Iv, this actually uses it like a
111 | | /// Counter.
| |____________^
112 | / extern "C" {
113 | | fn GFp_ChaCha20_ctr32(
114 | | out: *mut u8,
115 | | in
: *const u8,
... |
119 | | );
120 | | }
| |
- rustdoc does not generate documentation for extern blocks
|
= help: use // for a plain comment
= note: #[warn(unused_doc_comments)] on by default

Compiling linked_list_allocator v0.10.5
Compiling global v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/src/global)
Compiling protocol v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/src/protocol)
warning: crate-level attribute should be in the root module
--> src/tpm/src/std_lib.rs:5:24
|
5 | #![cfg_attr(not(test), no_std)]
| ^^^^^^
|
= note: #[warn(unused_attributes)] on by default

warning: crate-level attribute should be in the root module
--> src/tpm/src/std_lib.rs:7:1
|
7 | #![feature(alloc_error_handler)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be in the root module
--> src/tpm/src/std_lib.rs:8:1
|
8 | #![feature(naked_functions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compiling sys_time v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/rust-spdm/sys_time)
warning: field cpu_features is never read
--> deps/rust-spdm/external/ring/src/digest.rs:49:5
|
38 | pub(crate) struct BlockContext {
| ------------ field in this struct
...
49 | cpu_features: cpu::Features,
| ^^^^^^^^^^^^
|
= note: BlockContext has a derived impl for the trait Clone, but this is intentionally ignored during dead code analysis
= note: #[warn(dead_code)] on by default

Compiling td-exception v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-exception)
Compiling td-logger v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/td-logger)
Compiling webpki v0.22.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/rust-spdm/external/webpki)
Compiling crypto-common v0.1.6
Compiling block-buffer v0.10.4
Compiling digest v0.10.7
Compiling sha2 v0.10.7
warning: ring (lib) generated 2 warnings
warning: extern block uses type u128, which is not FFI-safe
--> src/tpm/src/tpm2_sys.rs:7488:10
|
7488 | ) -> u128;
| ^^^^ not FFI-safe
|
= note: 128-bit integers don't currently have a known stable ABI
= note: #[warn(improper_ctypes)] on by default

Compiling cc-measurement v0.1.0 (/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/rpmbuild/BUILD/vtpm-td/deps/td-shim/cc-measurement)
error: could not find native static library smallc, perhaps an -L flag is missing?

warning: tpm (lib) generated 4 warnings
error: could not compile tpm due to previous error; 4 warnings emitted
warning: build failed, waiting for other jobs to finish...
error: Bad exit status from /var/tmp/rpm-tmp.Z4688Y (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.Z4688Y (%build)

It built successful in github action, please see https://github.com/intel/tdx-tools/actions/runs/5470808315/jobs/9961296369, is there any difference between you and our github action build?

@qhbqyj can you check if intel-mvp-vtpm-td/vtpm-td/deps/rust-tpm-20-ref/smallc exists?
If not please rm intel-mvp-vtpm-td/vtpm-td and run build.sh again, or sync the submodules manually.

@qhbqyj I will close this firstly, please follow @jialeif 's suggestion to test again. Thanks!

qhbqyj commented

@kenplusplus @jialeif smallc exist:
[root@localhost rust-tpm-20-ref]# ls
Cargo.toml ms-tpm-20-ref openssl openssl-stubs patches sh_script smallc src tpm
[root@localhost rust-tpm-20-ref]# pwd
/home/tdx-tools-2023ww27/build/rhel-8/intel-mvp-vtpm-td/vtpm-td/deps/rust-tpm-20-ref

@qhbqyj I tried but did not reproduce it, could you provide more info and share the full build log?

[jialei@cpio-sprac-prc2 intel-mvp-vtpm-td]$ ll rpmbuild/RPMS/noarch/intel-mvp-vtpm-td-v0.1.1-mvp7.noarch.rpm
-rw-rw-r-- 1 jialei jialei 1362472 Jul 8 21:17 rpmbuild/RPMS/noarch/intel-mvp-vtpm-td-v0.1.1-mvp7.noarch.rpm
[jialei@cpio-sprac-prc2 intel-mvp-vtpm-td]$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.7 (Ootpa)"

qhbqyj commented

[root@localhost intel-mvp-vtpm-td]# ll rpmbuild/RPMS/noarch/

ls: cannot access 'rpmbuild/RPMS/noarch/': No such file or directory
Can I send the full log to you by e-mail? @jialeif

@qhbqyj yes, please send full log to us jialei.feng@intel.com or ken.lu@intel.com. We need fix all potential issues..