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

Add version information to windows binaries #61

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ build --incompatible_strict_action_env

# The {linux,macos,windows} configs are automatically enabled by Bazel depending
# on the current platform due to --enable_platform_specific_config above.
# Currently, there is no Windows support for building with bazel.
build:linux --workspace_status_command=infra/get_workspace_status
build:macos --workspace_status_command=infra/get_workspace_status
build:windows --workspace_status_command=infra/get_workspace_status.cmd

test --test_summary=testcase
test --test_output=errors
Expand Down
39 changes: 39 additions & 0 deletions infra/get_workspace_status.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:: Copyright 2024 EngFlow Inc. All rights reserved.
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

:: The variables defined here are available not only in BES logs, but also for
:: stamping into built binaries (version information, etc.). Removing vars or
:: changing var names may break these version stamping libraries; if this script
:: is updated, also make sure the following are up-to-date:
::
:: - //internal/buildstamp/BUILD

@echo off

for /F %%x in ('git rev-parse --abbrev-ref HEAD') do echo BUILD_SCM_BRANCH %%x
for /F %%x in ('git rev-parse --verify HEAD') do echo BUILD_SCM_REVISION %%x

echo STABLE_BUILD_RELEASE_VERSION %BUILD_RELEASE_VERSION%

git diff-index --quiet HEAD --
if %ERRORLEVEL% == 0 (
echo BUILD_SCM_STATUS "clean"
) else (
echo BUILD_SCM_STATUS "modified"
)

for /F %%x in ('git remote get-url origin') do set REMOTE_URL=%%x
if %ERRORLEVEL% == 0 (
echo BUILD_SCM_REMOTE %REMOTE_URL%
)
2 changes: 1 addition & 1 deletion infra/internal/check_copyright_headers/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var (
regexp.MustCompile(`^platform/linux_x64/builtin_include_directory_paths`),
regexp.MustCompile(`^platform/linux_x64/module.modulemap`),
}
copyrightRegexp = regexp.MustCompile(`^(#|//) Copyright [0-9-]+ EngFlow Inc\.`)
copyrightRegexp = regexp.MustCompile(`^(#|//|::) Copyright [0-9-]+ EngFlow Inc\.`)
)

type checkerFunc func(string) bool
Expand Down