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

[BUG]: Bazel build failed in mac m1 #5094

Closed
MohitGupta121 opened this issue Jul 18, 2023 · 7 comments · Fixed by #5139
Closed

[BUG]: Bazel build failed in mac m1 #5094

MohitGupta121 opened this issue Jul 18, 2023 · 7 comments · Fixed by #5139
Assignees
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks.

Comments

@MohitGupta121
Copy link
Member

MohitGupta121 commented Jul 18, 2023

Describe the bug

This bug is faced by me when I updated my Mac OS from Monterey to Ventura, I got this error while building Bazel:

ERROR: /Users/OpenSource/oppia-android/model/src/main/proto/BUILD.bazel:167:20: Generating JavaLite proto_library //model/src/main/proto:profile_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/languages_proto' ... (remaining 8 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox 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/languages_proto' ... (remaining 8 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Target //:oppia failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 70.242s, Critical Path: 12.83s
INFO: 282 processes: 21 internal, 261 darwin-sandbox.
FAILED: Build did NOT complete successfully

Describe the solution you'd like

The solution that I found is when we update Mac OS to Ventura then some Xcode terms changed and some setup files is missing for that we have to mannually install again that files and accept the terms.

So here the steps that I thinking to add into wiki as solution of this bug:

 xcode-select --install
 sudo xcodebuild -licence
 sudo xcode-select -r 
 sudo xcode-select -s /Library/Developer/CommandLineTools
 xcode-select -p 

After this Build bazel with this command:

bazel clean --expunge
bazel build //:oppia --noexperimental_check_desugar_deps

Steps To Reproduce

  1. Setup Bazel in Mac OS M1 - version Ventura
  2. Run Bazel build command

Expected Behavior

Bazel build successful

Screenshots/Videos

No response

What device/emulator are you using?

No response

Which Android version is your device/emulator running?

No response

Which version of the Oppia Android app are you using?

No response

Additional Context

No response

@MohitGupta121 MohitGupta121 added Impact: Low Low perceived user impact (e.g. edge cases). bug End user-perceivable behaviors which are not desirable. Work: Low Solution is clear and broken into good-first-issue-sized chunks. labels Jul 18, 2023
@MohitGupta121 MohitGupta121 self-assigned this Jul 18, 2023
@MohitGupta121
Copy link
Member Author

@kkmurerwa @adhiamboperes PTAL on the issue desciption, please suggest if something need change or add. Thanks!

@kkmurerwa
Copy link
Collaborator

Hi @MohitGupta121. The issue looks good. It is similar to issue #4391 and PR #5111 should be able to fix it. I think I can reference this issue as well in my PR. What do you think @adhiamboperes?

@adhiamboperes
Copy link
Collaborator

Hey @kkmurerwa, yes, you can reference this issue in your PR. However, it is not a full fix.

Can you both @kkmurerwa and @MohitGupta121 add your MacOs and Xcode versions to the issues for further debugging?

@adhiamboperes
Copy link
Collaborator

@MohitGupta121, thanks for proposing these steps. I think it is okay to incorporate them into the setup instructions for Mac.

@kkmurerwa
Copy link
Collaborator

@adhiamboperes I see. It would need a change to the Wiki to be a full fix. I will add part of so that it can be easily referenced. You can add Mohit's suggestions as part of your ongoing fixes for the Wiki.

@MohitGupta121
Copy link
Member Author

Okay Thanks @kkmurerwa @adhiamboperes

@MohitGupta121
Copy link
Member Author

MohitGupta121 commented Aug 3, 2023

@kkmurerwa or we can also mention the error here in a section of wiki Bazel-Issues. What do you think?

adhiamboperes pushed a commit that referenced this issue Sep 5, 2023
<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation

Fix #5094 : [Wiki update] Bazel build failed in mac m1

<!--
- 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.
  -->

## 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: ...".)
- [ ] 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)).

## For UI-specific PRs only
<!-- Delete these section if this PR does not include UI-related
changes. -->
If your PR includes UI-related changes, then:
- Add screenshots for portrait/landscape for both a tablet & phone of
the before & after UI changes
- For the screenshots above, include both English and pseudo-localized
(RTL) screenshots (see [RTL
guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines))
- Add a video showing the full UX flow with a screen reader enabled (see
[accessibility
guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide))
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing
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: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks.
Development

Successfully merging a pull request may close this issue.

3 participants