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

[DO NOT MERGE] Release 0.50 CI Test #4077

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

[DO NOT MERGE] Release 0.50 CI Test #4077

wants to merge 15 commits into from

Conversation

tyler-french
Copy link
Contributor

This is a test for CI in a cherry-picked branch

AlessandroPatti and others added 3 commits August 30, 2024 15:48
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

It fixes reproducibility issues reported in
#3994 by lazy-expanding
paths to absolute paths

**Which issues(s) does this PR fix?**

Fixes #3994
**What type of PR is this?**
Cleanup

**What does this PR do? Why is it needed?**
It seems odd to hang helpers off the `go` context because they still
need to take `go` as a param. It's clearer to just import them.

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**
This is one of the sources of feeding structs into `deps`.

**What type of PR is this?**
Starlark cleanup

**What does this PR do? Why is it needed?**

**Which issues(s) does this PR fix?**

Fixes #

**Other notes for review**
tyler-french and others added 8 commits August 30, 2024 16:36
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

**Which issues(s) does this PR fix?**

**Other notes for review**

This change was requested in
bazelbuild/bazel-gazelle#1735 (comment)
… subdirectory. (#4002)

<!-- Thanks for sending a PR! Before submitting:

1. If this is your first PR, please read CONTRIBUTING.md and sign the
CLA
   first. We cannot review code without a signed CLA.
2. Please file an issue *first*. All features and most bug fixes should
have
an associated issue with a design discussed and decided upon. Small bug
   fixes and documentation improvements don't need issues.
3. New features and bug fixes must have tests. Documentation may need to
be updated. If you're unsure what to update, send the PR, and we'll
discuss
   in review.
4. Note that PRs updating dependencies and new Go versions are not
accepted.
   Please file an issue instead.
-->

**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

It allows gopackagesdriver to be called within a subdirectory of a
workspace and properly resolve queries from gopls from IDEs like VSCode
when they include relative references. For example, if you have the
following repo/workspace structure:
```
WORKSPACE
project1/BUILD.bazel
project1/main.go
project2/BUILD.bazel
project2/main.go
...
```

If you run gopackagesdriver using bazel run from project1 directory and
receive the following queries:
```
file=./main.go
./...
```
The existing code will try to resolve those queries against the root of
the workspace, when instead we would expect it to resolve relative to
the project1 directory.

**Which issues(s) does this PR fix?**

Fixes #4001 

**Other notes for review**
**What type of PR is this?**

Feature

**What does this PR do? Why is it needed?**

Adds support for GOOS=wasip1 so that users can build wasi binaries using
rules_go

**Which issues(s) does this PR fix?**

Fixes #4046

**Other notes for review**

None
**What type of PR is this?**

> Bug fix

**What does this PR do? Why is it needed?**

filepath.EvalSymlinks works differently on Windows in Go 1.23.0: mount
points and reparse points are no longer treated as symbolic links by
os.Stat. Bazel uses junctions (implemented as reparse points) for
inputs, so this means EvalSymlinks can fail with some kinds of inputs
where it didn't before.

replicateTree calls EvalSymlinks before constructing an input tree for
`GoStdlib`. This seems to be necessary in some cases, though I'm not
altogether sure why. EvalSymlinks fails due to the new behavior though.

This change sets `GODEBUG=winsymlink=0` when invoking the builder binary
to revert to the old behavior. This should not affect the behavior of
user code compiled using the builder. This may not be a permanent
solution, but it should work at least through Go 1.25.

**Which issues(s) does this PR fix?**

Fixes #4049

**Other notes for review**

No test, but verified locally. Simply running `GoStdlib` with Go 1.23.0
will cover this. rules_go currently builds with Go 1.21.8 (no longer a
version supported by Google!).
**What type of PR is this?**

> Feature

**What does this PR do? Why is it needed?**

Adds the ability to pass extra arguments to gomock

**Which issues(s) does this PR fix?**

Fixes #4065
Closes #4067

**Other notes for review**

cleaner
Resolves #3996

---------

Co-authored-by: Fabian Meumertzheim <[email protected]>
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

Without this, nogo runs on the external test sources when compiling the
internal test library, which can result in missing deps errors and is
also wasteful. Since filtering out files made certain nogo actions run
on no files, also fix a bug that affects this situation by writing out
an empty log in addition to an empty facts file.

The code that checks imports and builds the importcfg was shared between
`compilepkg` and `nogo` and is now extracted into a common method. Along
the way, have it output the file into the working directory, which
simplifies cleanup, makes the file easier to find and avoids writing
files unknown to Bazel into the output directory.

Also removes some unused test files.

**Which issues(s) does this PR fix?**

Fixes #4062
Fixes #4070
Fixes #4073

**Other notes for review**
This will be merged, but we will end up cherry picking certain commits
onto an `release-0.50` branch, which will not include all of the commits
on master.
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

**Which issues(s) does this PR fix?**

Fixes #4079

**Other notes for review**
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

nogo should run on both the internal and external libraries compiled for
a `go_test`, but didn't. It also shouldn't run on the generated
`testmain.go` file, but did.
fmeum and others added 2 commits September 5, 2024 02:50
**What type of PR is this?**

Bug fix

**What does this PR do? Why is it needed?**

Previously, it was printed once by analyzer.

**Which issues(s) does this PR fix?**

Fixes #4080

**Other notes for review**
This PR prepares for the cherry-picked `0.50.1` patch release, which
will include:
#4081 
#4082 
#4083 

These commits will be cherry-picked to the branch `release-0.50`
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.

8 participants