File tree Expand file tree Collapse file tree 9 files changed +163
-20
lines changed
Expand file tree Collapse file tree 9 files changed +163
-20
lines changed Original file line number Diff line number Diff line change 1- build --enable_workspace
1+ # Intentionally blank
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -o errexit -o nounset -o pipefail
4+
5+
6+ FILTERS=()
7+ if [[ -n " ${TEST_FILTER:- } " ]] ; then
8+ FILTERS=(--build_tag_filters=" ${TEST_FILTER} " --test_tag_filters=" ${TEST_FILTER} " )
9+ fi
10+
11+ TESTS=$( bazel query ' filter(".*_test$", //tests/...)' )
12+
13+ bazel_cmd=(bazel test --build_tests_only " ${FILTERS[@]} " -- ${TESTS} //examples/... -//tests/rpm/...)
14+
15+ echo " ${bazel_cmd[@]} "
16+ " ${bazel_cmd[@]} "
17+ exit_code=" $? "
18+ if [ " ${exit_code} " -ne 0 ] ; then
19+ exit " ${exit_code} "
20+ fi
21+
22+ if [ -n " ${BUILD_DISTRO:- } " ] ; then
23+ bazel build //distro:distro
24+ exit_code=" $? "
25+ if [ " ${exit_code} " -ne 0 ] ; then
26+ echo " Could not build //distro:distro"
27+ exit " ${exit_code} "
28+ fi
29+ fi
30+
31+ exit " ${exit_code} "
Original file line number Diff line number Diff line change 1+ name : checks
2+
3+ on :
4+ push :
5+ branches :
6+ - " main"
7+
8+ pull_request :
9+ branches :
10+ - " main"
11+
12+ merge_group : {}
13+
14+ workflow_call : {}
15+
16+ permissions :
17+ contents : read
18+
19+ jobs :
20+ checks :
21+ strategy :
22+ fail-fast : false
23+ matrix :
24+ include :
25+ - name : " Bazel 8.x: @rules_pkg (Linux x64)"
26+ bazel_version : " 8.x"
27+ build_distro : " true"
28+ filter : " "
29+ runner : " ubuntu-latest"
30+
31+ - name : " Bazel 7.x: @rules_pkg (Linux x64)"
32+ bazel_version : " 7.x"
33+ build_distro : " "
34+ filter : " -REQUIRES_BAZEL_8"
35+ runner : " ubuntu-latest"
36+
37+ runs-on :
38+ - " ${{ matrix.runner }}"
39+
40+ steps :
41+ - uses : " actions/checkout@v6"
42+
43+ - name : " Run (Bash)"
44+ working-directory : " ${{ github.workspace }}"
45+ env :
46+ BUILD_DISTRO : " ${{ matrix.build_distro }}"
47+ USE_BAZEL_VERSION : " ${{ matrix.bazel_version }}"
48+ TEST_FILTER : " ${{ matrix.filter }}"
49+ run : bash "${{ github.workspace }}/.github/workflows/checks.sh"
50+
51+ status :
52+ runs-on :
53+ - " ubuntu-latest"
54+
55+ needs :
56+ - " checks"
57+ if : always()
58+
59+ steps :
60+ - name : " Report status"
61+ env :
62+ RESULT : " ${{ needs.checks.result }}"
63+ run : |
64+ echo "Status: ${RESULT}"
65+ if [[ "${RESULT}" != "success" ]]; then
66+ exit 1
67+ fi
Original file line number Diff line number Diff line change 11module (
22 name = "rules_pkg" ,
3- version = "1.2.0 " , # Must sync with version.bzl.
3+ version = "" , # set by release pipeline from version.bzl.
44 compatibility_level = 1 ,
55 repo_name = "rules_pkg" ,
66)
@@ -11,10 +11,10 @@ bazel_dep(name = "rules_python", version = "1.0.0")
1111bazel_dep (name = "bazel_skylib" , version = "1.7.1" )
1212
1313# Only for development
14- bazel_dep (name = "platforms" , version = "0.0.10" , dev_dependency = True )
15- bazel_dep (name = "rules_cc" , version = "0.0.17" , dev_dependency = True )
14+ bazel_dep (name = "platforms" , version = "1.0.0" , dev_dependency = True )
15+ bazel_dep (name = "rules_cc" , version = "0.1.1" , dev_dependency = True )
16+ bazel_dep (name = "rules_shell" , version = "0.6.1" , dev_dependency = True )
1617bazel_dep (name = "stardoc" , version = "0.7.2" , dev_dependency = True )
17- bazel_dep (name = "rules_shell" , version = "0.3.0" , dev_dependency = True )
1818
1919# Find the system rpmbuild if one is available.
2020find_rpm = use_extension ("//toolchains/rpm:rpmbuild_configure.bzl" , "find_system_rpmbuild_bzlmod" , dev_dependency = True )
Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ genrule(
5757 name = "small_module" ,
5858 srcs = ["//:MODULE.bazel" ],
5959 outs = ["MODULE.bazel" ],
60- cmd = "sed -e '/### INTERNAL ONLY/,$$d' $(location //:MODULE.bazel) >$@" ,
60+ cmd = """sed -e 's/version = ""/version = "{version}"/' -e '/### INTERNAL ONLY/,$$d' $(location //:MODULE.bazel) >$@""" .format (
61+ version = version ,
62+ ),
6163)
6264
6365genrule (
Original file line number Diff line number Diff line change @@ -638,17 +638,24 @@ pkg_tar(
638638# Test with symlinks
639639#
640640
641- raw_symlinks (name = "raw_symlinks" )
641+ raw_symlinks (
642+ name = "raw_symlinks" ,
643+ tags = ["REQUIRES_BAZEL_8" ],
644+ )
642645
643646pkg_tar (
644647 name = "raw_symlinks_tar" ,
645648 srcs = [":raw_symlinks" ],
646649 include_runfiles = True ,
650+ tags = ["REQUIRES_BAZEL_8" ],
647651)
648652
649653verify_archive_test (
650654 name = "raw_symlinks_test" ,
651- tags = ["no_windows" ],
655+ tags = [
656+ "REQUIRES_BAZEL_8" ,
657+ "no_windows" ,
658+ ],
652659 target = ":raw_symlinks_tar" ,
653660 # This test checks using relative symlinks, but Bazel always writes absolute
654661 # symlinks on windows.
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ pkg_zip(
272272create_fake_symlink (
273273 name = "fake_symlink" ,
274274 link = "fake_symlink" ,
275+ tags = ["REQUIRES_BAZEL_8" ],
275276 target = "../does_not_exist" ,
276277)
277278
@@ -281,6 +282,7 @@ pkg_zip(
281282 ":fake_symlink" ,
282283 "//tests:file_and_link" ,
283284 ],
285+ tags = ["REQUIRES_BAZEL_8" ],
284286)
285287
286288py_test (
@@ -302,7 +304,6 @@ py_test(
302304 ":test_zip_package_dir_substitution.zip" ,
303305 ":test_zip_permissions.zip" ,
304306 ":test_zip_stored" ,
305- ":test_zip_symlink" ,
306307 ":test_zip_timestamp.zip" ,
307308 ":test_zip_tree.zip" ,
308309 ],
@@ -312,6 +313,21 @@ py_test(
312313 ],
313314)
314315
316+ py_test (
317+ name = "zip_symlink_test" ,
318+ srcs = [
319+ "zip_symlink_test.py" ,
320+ ],
321+ data = [
322+ ":test_zip_symlink" ,
323+ ],
324+ python_version = "PY3" ,
325+ tags = ["REQUIRES_BAZEL_8" ],
326+ deps = [
327+ ":zip_test_lib" ,
328+ ],
329+ )
330+
315331py_test (
316332 name = "zip_byte_for_byte_test" ,
317333 srcs = [
Original file line number Diff line number Diff line change 1+ # Copyright 2025 The Bazel Authors. All rights reserved.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ import unittest
16+
17+ from tests .zip import zip_test_lib
18+
19+
20+ class ZipContentsTests (zip_test_lib .ZipContentsTestBase ):
21+
22+ def test_symlink (self ):
23+ self .assertZipFileContent ("test_zip_symlink.zip" , [
24+ {"filename" : "BUILD" , "islink" : False },
25+ {"filename" : "fake_symlink" , "islink" : True }, # raw symlink -> keep symlink
26+ {"filename" : "outer_BUILD" , "islink" : False },# nonraw symlink -> copy
27+ ])
28+
29+
30+ if __name__ == "__main__" :
31+ unittest .main ()
Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- import datetime
16- import filecmp
1715import os
1816import sys
1917import unittest
20- import zipfile
2118
2219from python .runfiles import runfiles
2320from tests .zip import zip_test_lib
@@ -150,14 +147,6 @@ def test_compression_stored(self):
150147 {"filename" : "loremipsum.txt" , "crc" : LOREM_CRC , "size" : 543 },
151148 ])
152149
153- def test_symlink (self ):
154- self .assertZipFileContent ("test_zip_symlink.zip" , [
155- {"filename" : "BUILD" , "islink" : False },
156- {"filename" : "fake_symlink" , "islink" : True }, # raw symlink -> keep symlink
157- {"filename" : "outer_BUILD" , "islink" : False },# nonraw symlink -> copy
158- ])
159-
160-
161150
162151if __name__ == "__main__" :
163152 unittest .main ()
You can’t perform that action at this time.
0 commit comments