mobile icon indicating copy to clipboard operation
mobile copied to clipboard

cmd/gomobile: add golistflags flag

Open baizon opened this issue 1 year ago • 17 comments

Add golistflags flag to make it possible to use 'go list' with argument. For example, 'go list -mod=mod'.

Fixes golang/go#67927.

baizon avatar Jul 21 '24 08:07 baizon

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.

google-cla[bot] avatar Jul 21 '24 08:07 google-cla[bot]

This PR (HEAD: 1d3b1e5c533f3e2b92f8cdde1921d96b618eb361) 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 avatar Jul 21 '24 08:07 gopherbot

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 avatar Jul 21 '24 08:07 gopherbot

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!

gopherbot avatar Jul 21 '24 08:07 gopherbot

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 https://github.com/golang/go/issues/67927. Thanks.

benma avatar Sep 02 '24 09:09 benma

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!

gopherbot avatar Sep 02 '24 12:09 gopherbot

This PR (HEAD: de3284d1a4abc021a9e8e94ef2851c98c017c54a) 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 avatar Sep 03 '24 05:09 gopherbot

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 avatar May 12 '25 12:05 gopherbot

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!

gopherbot avatar May 12 '25 14:05 gopherbot

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!

gopherbot avatar May 12 '25 19:05 gopherbot

@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?

vicenterzl avatar Sep 12 '25 13:09 vicenterzl

Yes, it is possible.

baizon avatar Sep 15 '25 04:09 baizon

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

vicenterzl avatar Sep 16 '25 10:09 vicenterzl

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

baizon avatar Sep 16 '25 12:09 baizon

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 avatar Sep 16 '25 14:09 vicenterzl

@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 avatar Sep 16 '25 14:09 vicenterzl

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.

vicenterzl avatar Sep 16 '25 14:09 vicenterzl