Skip to content

cmd/gomobile: add golistflags flag - #105

Open
baizon wants to merge 4 commits into
golang:masterfrom
baizon:feature/glflags
Open

cmd/gomobile: add golistflags flag#105
baizon wants to merge 4 commits into
golang:masterfrom
baizon:feature/glflags

Conversation

@baizon

@baizon baizon commented Jul 21, 2024

Copy link
Copy Markdown

Adds -mod=mod parameter to the go list command.

Fixes golang/go#67927.

@google-cla

google-cla Bot commented Jul 21, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gopherbot

Copy link
Copy Markdown
Contributor

This PR (HEAD: 1d3b1e5) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/mobile/+/599916.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Gopher Robot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@benma

benma commented Sep 2, 2024

Copy link
Copy Markdown

Could someone please look at this PR? We need it, otherwise we cannot compile a project with a vendor folder with Go1.22+ as described in golang/go#67927. Thanks.

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 1:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@baizon baizon changed the title feat: added glflags feat: added golistflags Sep 3, 2024
@gopherbot

Copy link
Copy Markdown
Contributor

This PR (HEAD: de3284d) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/mobile/+/599916.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Igor Sirotin:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@dmitshur dmitshur changed the title feat: added golistflags cmd/gomobile: add golistflags flag May 12, 2025
@gopherbot

Copy link
Copy Markdown
Contributor

Message from Dmitri Shuralyov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@vicenterzl

Copy link
Copy Markdown

@baizon is it possible to use this PR even if it's not merged? Like use a gomobile version that has this PR on it, what is the standard way of doing that in Go?

@baizon

baizon commented Sep 15, 2025

Copy link
Copy Markdown
Author

Yes, it is possible.

@vicenterzl

Copy link
Copy Markdown

Yes, it is possible.

I am going to clone and apply the patch, then install.
Apparently this repo is a mirror, what if you send the PR in the official repository? Not sure if it's possible, here's the link:
https://cs.opensource.google/go/x/mobile

@baizon

baizon commented Sep 16, 2025

Copy link
Copy Markdown
Author

Yes, it is a mirror. Ive made a PR to google. They are reviewing it.

@vicenterzl

Copy link
Copy Markdown

Yes, it is a mirror. Ive made a PR to google. They are reviewing it.

Awesome, thank you so much, meanwhile I used this for the patch: https://patch-diff.githubusercontent.com/raw/golang/mobile/pull/105.patch

@vicenterzl

Copy link
Copy Markdown

@baizon after adding the PR and go bind -golistflags=-mod=mod ... I still get this:

gomobile: go mod tidy failed: exit status 1
go: downloading go1.24 (linux/amd64)
go: download go1.24 for linux/amd64: toolchain not available

Any suggestions?

@vicenterzl

vicenterzl commented Sep 16, 2025

Copy link
Copy Markdown

I made it work after doing this:

go get golang.org/x/mobile/cmd/gomobile@${GOMOBILE_COMMIT}
go mod edit -replace=golang.org/x/mobile=$(pwd)/.gomobile

Replacing the module by the repository that I patched before with your PR, then it works.

@benma

benma commented Feb 12, 2026

Copy link
Copy Markdown

@baizon https://go-review.googlesource.com/c/mobile/+/599916 has had some comments, would you mind addressing them so this can move forward? Thank you.

@baizon

baizon commented Feb 12, 2026

Copy link
Copy Markdown
Author

Hey, well the answer is:

Without looking closer, to me it seems always using -mod=readonly might work in both contexts and so adding a flag wouldn't be needed.

@benma

benma commented Feb 12, 2026

Copy link
Copy Markdown

Hey, well the answer is:

Without looking closer, to me it seems always using -mod=readonly might work in both contexts and so adding a flag wouldn't be needed.

That's the reviewer's suggestion, but then the next step would be for you to update the code to drop the flag again and default it to readonly, right?

@gopherbot

Copy link
Copy Markdown
Contributor

This PR (HEAD: ba1c821) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/mobile/+/599916.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Mateusz Umstädter:

Patch Set 4:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

This PR (HEAD: 8e8e1cd) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/mobile/+/599916.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Mateusz Umstädter:

Patch Set 4:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 5:

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

Message from Hajime Hoshi:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/599916.
After addressing review feedback, remember to publish your drafts!

@gopherbot

Copy link
Copy Markdown
Contributor

This PR (HEAD: 6fde4f3) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/mobile/+/599916.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

x/mobile: does not work with Go 1.22 if a vendor folder is present, even with the GO111MODULE=off workaround

4 participants