Skip to content

Commit e2f6e14

Browse files
shs96cdiemol
andauthored
[bazel] Use the release configs for the release tasks (#14423)
Rather than passing `--stamp` everywhere, use a proper config so that we can easily add additional flags. I've broken out a `remote_release` config which builds things remotely and then downloads the artifacts given on the command line to the local machine. This only makes sense for targets which we do _not_ `run` (as `run` happens locally, so we'd need to rebuild any artifacts anyway) Co-authored-by: Diego Molina <[email protected]>
1 parent ef1b422 commit e2f6e14

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

.bazelrc

+7-1
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,14 @@ test --test_timeout=1800
102102
test:node_debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
103103
test:ruby_debug --test_output=streamed --test_env=RUBY_DEBUG_FORK_MODE=parent --run_under="@bundle//bin:rdbg --nonstop --open --command"
104104

105-
build:release --config=remote
105+
106106
build:release --stamp
107+
build:release --compilation_mode=opt
108+
109+
# As regular `release` but all the build work happens on the RBE
110+
build:remote_release --config=release
111+
build:remote_release --config=remote
112+
build:remote_release --remote_download_toplevel
107113

108114
# RBE
109115
import %workspace%/.bazelrc.remote

Rakefile

+12-11
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ task ios_driver: [
331331
# ./go java:package['--config=release']
332332
desc 'Create stamped zipped assets for Java for uploading to GitHub'
333333
task :'java-release-zip' do
334-
Rake::Task['java:package'].invoke('--stamp')
334+
Rake::Task['java:package'].invoke('--config=remote_release')
335335
end
336336

337337
task 'release-java': %i[java-release-zip publish-maven]
@@ -450,7 +450,7 @@ namespace :node do
450450
nightly = args.delete('nightly')
451451
Rake::Task['node:version'].invoke('nightly') if nightly
452452

453-
Bazel.execute('run', ['--stamp'], '//javascript/node/selenium-webdriver:selenium-webdriver.publish')
453+
Bazel.execute('run', ['--config=release'], '//javascript/node/selenium-webdriver:selenium-webdriver.publish')
454454
end
455455

456456
desc 'Release Node npm package'
@@ -513,7 +513,7 @@ namespace :py do
513513
Rake::Task['py:version'].invoke('nightly') if nightly
514514

515515
command = nightly ? '//py:selenium-release-nightly' : '//py:selenium-release'
516-
Bazel.execute('run', ['--stamp'], command)
516+
Bazel.execute('run', ['--config=release'], command)
517517
end
518518

519519
desc 'generate and copy files required for local development'
@@ -680,10 +680,10 @@ namespace :rb do
680680

681681
if nightly
682682
Bazel.execute('run', [], '//rb:selenium-webdriver-bump-nightly-version')
683-
Bazel.execute('run', ['--stamp'], '//rb:selenium-webdriver-release-nightly')
683+
Bazel.execute('run', ['--config=release'], '//rb:selenium-webdriver-release-nightly')
684684
else
685-
Bazel.execute('run', ['--stamp'], '//rb:selenium-webdriver-release')
686-
Bazel.execute('run', ['--stamp'], '//rb:selenium-devtools-release')
685+
Bazel.execute('run', ['--config=release'], '//rb:selenium-webdriver-release')
686+
Bazel.execute('run', ['--config=release'], '//rb:selenium-devtools-release')
687687
end
688688
end
689689

@@ -753,7 +753,7 @@ namespace :dotnet do
753753
args = arguments.to_a.compact
754754
nightly = args.delete('nightly')
755755
Rake::Task['dotnet:version'].invoke('nightly') if nightly
756-
Rake::Task['dotnet:package'].invoke('--stamp')
756+
Rake::Task['dotnet:package'].invoke('--config=remote_release')
757757

758758
api_key = ENV.fetch('NUGET_API_KEY', nil)
759759
push_destination = 'https://api.nuget.org/v3/index.json'
@@ -839,7 +839,7 @@ namespace :java do
839839

840840
desc 'Package Java bindings and grid into releasable packages and stage for release'
841841
task :package do |_task, arguments|
842-
args = arguments.to_a.compact.empty? ? ['--stamp'] : arguments.to_a.compact
842+
args = arguments.to_a.compact.empty? ? ['--config=release'] : arguments.to_a.compact
843843
Bazel.execute('build', args, '//java/src/org/openqa/selenium:client-zip')
844844
Bazel.execute('build', args, '//java/src/org/openqa/selenium/grid:server-zip')
845845
Bazel.execute('build', args, '//java/src/org/openqa/selenium/grid:executable-grid')
@@ -872,9 +872,10 @@ namespace :java do
872872
ENV['GPG_SIGN'] = (!nightly).to_s
873873

874874
Rake::Task['java:version'].invoke if nightly
875-
Rake::Task['java:package'].invoke('--stamp')
876-
Rake::Task['java:build'].invoke('--stamp')
877-
JAVA_RELEASE_TARGETS.each { |target| Bazel.execute('run', ['--stamp'], target) }
875+
Rake::Task['java:package'].invoke('--config=release')
876+
Rake::Task['java:build'].invoke('--config=release')
877+
# Because we want to `run` things, we can't use the `release` config
878+
JAVA_RELEASE_TARGETS.each { |target| Bazel.execute('run', ['--config=release'], target) }
878879
end
879880

880881
desc 'Install jars to local m2 directory'

0 commit comments

Comments
 (0)