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

binaryen/119 package update #27682

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Sep 5, 2024

@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr labels Sep 5, 2024
Copy link
Contributor Author

octo-sts bot commented Sep 5, 2024

Open AI suggestions to solve the build error:

The error message is: "In file included from /home/build/src/parser/wast-parser.cpp:19: /home/build/src/parser/wat-parser.h: In function 'wasm::Result<std::vector<wasm::WATParser::ScriptEntry> > wasm::WATParser::{anonymous}::wast(wasm::WATParser::Lexer&)': /home/build/src/parser/wat-parser.h:37:8: error: '*(wasm::WATParser::InvokeAction*)((char*)&<unnamed> + offsetof(wasm::WATParser::value_type, wasm::WATParser::ScriptEntry::cmd.std::variant<std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::<unnamed>.std::__detail::__variant::_Variant_base<std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::<unnamed>.std::__detail::__variant::_Move_assign_base<false, std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::<unnamed>.std::__detail::__variant::_Copy_assign_base<false, std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::<unnamed>.std::__detail::__variant::_Move_ctor_base<false, std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::<unnamed>.std::__detail::__variant::_Copy_ctor_base<false, std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::<unnamed>.std::__detail::__variant::_Variant_storage<false, std::variant<wasm::WATParser::QuotedModule, std::shared_ptr<wasm::Module> >, wasm::WATParser::Register, std::variant<wasm::WATParser::InvokeAction, wasm::WATParser::GetAction>, std::variant<wasm::WATParser::AssertReturn, wasm::WATParser::AssertAction, wasm::WATParser::AssertModule> >::_M_u)).wasm::WATParser::InvokeAction::name' may be used uninitialized [-Werror=maybe-uninitialized] 37 | struct InvokeAction { ninja: job failed: /usr/bin/g++  -I/home/build/src -I/home/build/third_party/FP16/include -I/home/build/third_party/llvm-project/include -I/home/build/output -O2 -Wall -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -march=armv8-a+crc+crypto -mtune=neoverse-n1 -DBUILD_LLVM_DWARF -Wall -Werror -Wextra -Wno-unused-parameter -Wno-dangling-pointer -fno-omit-frame-pointer -fno-rtti -Wno-implicit-int-float-conversion -Wno-unknown-warning-option -Wswitch -Wimplicit-fallthrough -Wnon-virtual-dtor -fPIC -fdiagnostics-color=always -O3 -DNDEBUG -UNDEBUG -std=c++20 -MD -MT src/parser/CMakeFiles/parser.dir/wast-parser.cpp.o -MF src/parser/CMakeFiles/parser.dir/wast-parser.cpp.o.d -o src/parser/CMakeFiles/parser.dir/wast-parser.cpp.o -c /home/build/src/parser/wast-parser.cpp cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics cc1plus: note: unrecognized command-line option '-Wno-implicit-int-float-conversion' may have been intended to silence earlier diagnostics cc1plus: all warnings being treated as errors ninja: subcommand failed ERROR: failed to build package. the build environment has been preserved: workspace dir: /temp/melange-workspace-1383487530 guest dir: /temp/melange-guest-2804905905 failed to build package: unable to run package binaryen pipeline: unable to run pipeline: unable to run pipeline: exit status 1 make[1]: *** [Makefile:111: packages/aarch64/binaryen-119-r0.apk] Error 1 make[1]: Leaving directory '/github/home' make: *** [Makefile:101: package/binaryen] Error 2 Process completed with exit code 2."

To fix this error:
1. Initialize the `name` member of `InvokeAction` in the constructor.
2. Ensure all members of `InvokeAction` are properly initialized.
3. Add `-Wno-maybe-uninitialized` to the compiler flags if the warning is a false positive.
4. Review the code to ensure no uninitialized variables are being used.

I was unable to get this to buidl without the provided patch.
Getting -Wno-error=maybe-uninitialized into the
compiler flags was not enough.

There are other examples in binaryen's git where this
pragma approach is used.

I could not get it to build with openssf-compiler-options
enabled, very close.  By adding

    vars:
      no-error-flags: -Wno-error=conversion \
        -Wno-error=float-conversion \
        -Wno-error=format-nonliteral \
        -Wno-error=maybe-uninitialized \
        -Wno-error=stringop-overflow

and then adding to the cmake/configure opts

  -DCMAKE_CXX_FLAGS="${{vars.no-error-flags}}"

we can get to an _Unwind_Resume linker error.
Presumably that will be fixed with something like
#27815
Copy link
Contributor

github-actions bot commented Sep 6, 2024

Package binaryen: Click to expand/collapse

Package binaryen:
Modified: /usr/bin/wasm-as
Modified: /usr/bin/wasm-ctor-eval
Modified: /usr/bin/wasm-dis
Modified: /usr/bin/wasm-emscripten-finalize
Modified: /usr/bin/wasm-fuzz-lattices
Modified: /usr/bin/wasm-fuzz-types
Modified: /usr/bin/wasm-merge
Modified: /usr/bin/wasm-metadce
Modified: /usr/bin/wasm-opt
Modified: /usr/bin/wasm-reduce
Modified: /usr/bin/wasm-shell
Modified: /usr/bin/wasm-split
Modified: /usr/bin/wasm2js
Modified: /usr/lib/libbinaryen.so

Package binaryen-dev: Click to expand/collapse

Package binaryen-dev:
Modified: /usr/include/binaryen-c.h
Modified: /usr/include/wasm-delegations.def

bincapz found differences: Click to expand/collapse

Deleted: binaryen-dev/var/lib/db/sbom/binaryen-dev-118-r0.spdx.json [⚠️ MEDIUM]

RISK KEY DESCRIPTION EVIDENCE
-MEDIUM net/download download files downloadLocation
-LOW ref/site/url contains embedded HTTPS URLs https://spdx.org/spdxdocs/chainguard/melange/a26a4dd0555e1389852110035b36

Moved: binaryen/var/lib/db/sbom/binaryen-118-r0.spdx.json -> /tmp/wolfictl-apk-3004492629/binaryen-dev/var/lib/db/sbom/binaryen-dev-119-r0.spdx.json (similarity: 0.91)

Moved: binaryen/var/lib/db/sbom/binaryen-118-r0.spdx.json -> /tmp/wolfictl-apk-3004492629/binaryen/var/lib/db/sbom/binaryen-119-r0.spdx.json (similarity: 0.99)

@smoser
Copy link
Member

smoser commented Sep 6, 2024

Submitted WebAssembly/binaryen#6912 for upstream.

Copy link
Member

@mamccorm mamccorm left a comment

Choose a reason for hiding this comment

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

thank-you

@mamccorm mamccorm merged commit 479be3b into main Sep 11, 2024
13 checks passed
@mamccorm mamccorm deleted the wolfictl-158ca9ce-3080-4a07-b880-0f52311a3622 branch September 11, 2024 16:58
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