Skip to content

Commit

Permalink
Dummy commit to debug window issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sluongng committed May 10, 2022
1 parent 0ee4878 commit a2b9cb7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
6 changes: 2 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ tasks:
build_flags:
# Go requires a C toolchain that accepts options and emits errors like
# gcc or clang. The Go SDK does not support MSVC.
- "-k"
- "--cpu=x64_windows"
- "--compiler=mingw-gcc"
- '--action_env=PATH=C:\tools\msys64\usr\bin;C:\tools\msys64\bin;C:\tools\msys64\mingw64\bin;C:\python3\Scripts\;C:\python3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\tools\msys64\usr\bin;c:\openjdk\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\CMake\bin;c:\ninja;c:\bazel;c:\buildkite'
Expand Down Expand Up @@ -123,7 +124,6 @@ tasks:
- "-@org_golang_x_sys//windows/svc/eventlog:eventlog_test"
- "-@org_golang_x_sys//windows/svc:svc_test"
- "-@org_golang_x_text//language:language_test"
- "-//go/analyzer/staticcheck:all"
- "-//proto:combo_grpc"
- "-//proto:combo_proto"
- "-//proto:gofast_grpc"
Expand Down Expand Up @@ -192,7 +192,6 @@ tasks:
- "-//tests/core/go_proto_library_importmap:importmap_test"
- "-//tests/core/go_test:data_test"
- "-//tests/core/go_test:pwd_test"
- "-//tests/core/nogo/staticcheck:staticcheck_test"
- "-//tests/core/race:race_test"
- "-//tests/core/stdlib:buildid_test"
- "-//tests/examples/executable_name:executable_name"
Expand Down Expand Up @@ -240,6 +239,7 @@ tasks:
test_flags:
# Go requires a C toolchain that accepts options and emits errors like
# gcc or clang. The Go SDK does not support MSVC.
- "-k"
- "--cpu=x64_windows"
- "--compiler=mingw-gcc"
- '--action_env=PATH=C:\tools\msys64\usr\bin;C:\tools\msys64\bin;C:\tools\msys64\mingw64\bin;C:\python3\Scripts\;C:\python3;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Google\Compute Engine\sysprep;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\tools\msys64\usr\bin;c:\openjdk\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\CMake\bin;c:\ninja;c:\bazel;c:\buildkite'
Expand All @@ -265,7 +265,6 @@ tasks:
- "-@org_golang_x_text//language:language_test"
- "-@org_golang_x_tools//cmd/splitdwarf/internal/macho:macho_test"
- "-@test_chdir_remote//sub:go_default_test"
- "-//go/analyzer/staticcheck:all"
- "-//go/tools/bazel:bazel_test"
- "-//tests:buildifier_test" # requires bash
- "-//tests/core/cgo:dylib_client"
Expand Down Expand Up @@ -297,7 +296,6 @@ tasks:
- "-//tests/core/go_test:data_test"
- "-//tests/core/go_test:pwd_test"
- "-//tests/core/nogo/coverage:coverage_test"
- "-//tests/core/nogo/staticcheck:staticcheck_test"
- "-//tests/core/race:race_test" # fails on Windows due to upstream bug, see issue #2911
- "-//tests/core/stdlib:buildid_test"
- "-//tests/examples/executable_name:executable_name"
Expand Down
6 changes: 6 additions & 0 deletions go/analyzer/staticcheck/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ filegroup(
name = analyzer + "_test",
srcs = ["analyzer_test.go"],
embed = [analyzer],
# Is not compatible with window due to lack of sandboxing
target_compatible_with = select({
"@platforms//os:osx": [],
"@platforms//os:linux": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
)
for analyzer in ANALYZERS
]
12 changes: 12 additions & 0 deletions go/private/actions/compilepkg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ def emit_compilepkg(
env = go.env

args = go.builder_args(go, "compilepkg")
if out_lib.short_path.find("staticcheck") > -1:
has_go = False
for source in sources:
if source.short_path.endswith(".go"):
has_go = True

if len(sources) == 0:
print("DEBUGSLUONG: " + out_lib.short_path)

if not has_go:
print("DEBUGSLUONG: " + out_lib.short_path)

args.add_all(sources, before_each = "-src")
args.add_all(embedsrcs, before_each = "-embedsrc", expand_directories = False)
args.add_all(
Expand Down
8 changes: 4 additions & 4 deletions go/tools/builders/compilepkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ func compileArchive(
outPath string,
outXPath string,
cgoExportHPath string,
coverFormat string) error {

coverFormat string,
) error {
workDir, cleanup, err := goenv.workDir()
if err != nil {
return err
Expand Down Expand Up @@ -416,8 +416,8 @@ func compileArchive(
// Compile the .s files.
if len(srcs.sSrcs) > 0 {
includeSet := map[string]struct{}{
filepath.Join(os.Getenv("GOROOT"), "pkg", "include"): struct{}{},
workDir: struct{}{},
filepath.Join(os.Getenv("GOROOT"), "pkg", "include"): {},
workDir: {},
}
for _, hdr := range srcs.hSrcs {
includeSet[filepath.Dir(hdr.filename)] = struct{}{}
Expand Down
8 changes: 4 additions & 4 deletions tests/core/nogo/staticcheck/staticcheck_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ func alwaysTrue(a int) string {
}
`,
WorkspaceSuffix: `
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
load("@io_bazel_rules_go//go/analyzer/staticcheck:deps.bzl", "staticcheck_deps")
staticcheck_deps()
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
gazelle_dependencies()
`,
})
}
Expand Down

0 comments on commit a2b9cb7

Please sign in to comment.