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

Bazel 4.0 not building project correctly on macOs Monterrey version 12.4 #4391

Closed
KevinGitonga opened this issue Jun 10, 2022 · 3 comments
Closed
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Work: High It's not clear what the solution is. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@KevinGitonga
Copy link
Contributor

KevinGitonga commented Jun 10, 2022

Describe the bug
Building project with bazel using macOs Monterrey version 12.4 on terminal fails see logs below for context

Generating JavaLite proto_library //model/src/main/proto:event_logger_proto failed: (Segmentation fault): protoc failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc '--proto_path=bazel-out/android-armeabi-v7a-fastbuild/bin/model/src/main/proto/_virtual_imports/math_proto' ... (remaining 22 argument(s) skipped)

To Reproduce
Steps to reproduce the behavior:

  1. Setup Oppia Android project on macOs Monterrey version 12.4 as per the docs
  2. Run command bazel build //:oppia on terminal
  3. See error

Expected behavior
I expect Bazel to build project successfully and be able to generate required artifacts.

Demonstration
Screenshot 2022-06-10 at 11 17 46

Environment

  • macOs Monterrey version 12.4
  • Android or SDK version 30
  • App version 1.0
  • Bazel Version 4.0

Additional context
Issue with similar specs on Bazel repository
bazelbuild/bazel#14469

@BenHenning
Copy link
Member

Thanks for filing this @KevinGitonga.

This issue will be blocked on us being able to upgrade to Bazel 5.0 (which is the recommendation in the reference Bazel bug above). We can't do that until Bazel is moved over to using the new D8 tool (since it forces using build tools 31+ which removes the desugar compatibility tool that Bazel expects--see bazelbuild/bazel#13989). I'm tracking the other constituent work items needed to unblock this work.

@BenHenning BenHenning added this to the Beta MR1 milestone Jun 11, 2022
@BenHenning BenHenning modified the milestones: Beta MR1, Beta MR2 Jun 11, 2022
@Broppia Broppia added issue_type_bug Impact: Low Low perceived user impact (e.g. edge cases). labels Jun 13, 2022
@BenHenning BenHenning added Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Z-ibt Temporary label for Ben to keep track of issues he's triaged. issue_user_developer and removed Impact: Low Low perceived user impact (e.g. edge cases). labels Sep 15, 2022
@BenHenning BenHenning removed this from the Beta MR2 milestone Sep 16, 2022
@seanlip seanlip added bug End user-perceivable behaviors which are not desirable. and removed issue_user_developer labels Mar 29, 2023
@adhiamboperes
Copy link
Collaborator

Hey @KevinGitonga, Could you please try this build to see if it is still reproducible? @kkmurerwa had a similar issue on M1, and we were able to find a fix (unused imports in the affected models -- which seem not to be an issue with the highlighted math.proto currently)

adhiamboperes added a commit that referenced this issue Aug 3, 2023
<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
Fix part of #4391 : Fix failing build on M1 Macs
## Explanation
<!--
- Explain what your PR does. If this PR fixes an existing bug, please
include
- "Fixes #bugnum:" in the explanation so that GitHub can auto-close the
issue
  - when this PR is merged.
  -->
Some M1 Macs fail to build the Oppia app because of unused imports in
some of the proto files in the project. This PR attempts to fix this
issue by removing unused imports in proto files. Files affected by this
fix are;
- profile.proto
- deprecation.proto

This is a temporary fix and more investigation will need to be done to
properly understand why this behavior is erratic and why it only happens
in some instances and not in others. More checks are also needed to
ensure that proto files only have imports that are used in the proto
file before they are merged.

Besides build fixes, this PR also;
- Includes a fix for the `buildifier_download.sh` which previously did
not work for MacOS users.
- Introduces a `static_checks.sh` file to allow contributors to run all
static checks locally before pushing the code to Git.
- Adds a wiki entry in the Static-Analysis-Checks wiki. The entry
contains instructions on how to run static checks locally with the
static_checks.sh file.

## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

---------

Co-authored-by: Kenneth Murerwa <[email protected]>
Co-authored-by: Adhiambo Peres <[email protected]>
@BenHenning
Copy link
Member

Similar to #3653 I suspect that this isn't an issue after #4886 was merged. Please reopen if this is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). Work: High It's not clear what the solution is. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Projects
Development

No branches or pull requests

6 participants