Skip to content

Commit e93bca8

Browse files
committed
Use bazel vendor for f2fs-tools
This sometimes fails to download. See https://bazel.build/external/vendor Only hand-written changes are in `base/cvd/vendor_src/.gitignore` and `base/cvd/.bazelrc`. The rest are from `bazel vendor --repo=@f2fs_tools` The buildozer build file validation is narrowed to `base/cvd/cuttlefish` to avoid detecting issues in vendored code we don't own. Bug: b/465511388
1 parent 9f273b3 commit e93bca8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+41797
-4
lines changed

.github/workflows/presubmit.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
working-directory: base/cvd
3030
if: '!cancelled()'
3131
run: |
32-
if [[ $(buildozer '//...:__pkg__' format 2>&1) ]]; then
33-
echo "Please format BUILD.bazel files with \"buildozer '//...:__pkg__' format\"";
32+
if [[ $(buildozer '//cuttlefish/...:__pkg__' format 2>&1) ]]; then
33+
echo "Please format BUILD.bazel files with \"buildozer '//cuttlefish/...:__pkg__' format\"";
3434
exit 1;
3535
fi
3636
- name: Validate no cc_binary targets under //cuttlefish
@@ -64,9 +64,9 @@ jobs:
6464
if: '!cancelled()'
6565
working-directory: base/cvd
6666
run: |
67-
if [[ $(buildozer -stdout=true '//...:__pkg__' 'fix unusedLoads') ]]; then
67+
if [[ $(buildozer -stdout=true '//cuttlefish/...:__pkg__' 'fix unusedLoads') ]]; then
6868
buildozer '//...:__pkg__' 'fix unusedLoads'
69-
echo "Please remove unused 'load' statements with \"buildozer '//...:__pkg__' 'fix unusedLoads'\"";
69+
echo "Please remove unused 'load' statements with \"buildozer '//cuttlefish/...:__pkg__' 'fix unusedLoads'\"";
7070
exit 1;
7171
fi
7272
staticcheck:

base/cvd/.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
common --vendor_dir=vendor_src
2+
13
build --build_tag_filters=-clang_tidy,-clang-tidy
24
build --copt=-fdiagnostics-color=always
35
build --output_filter='^//((?!(external/libarchive|external/libevent|external/rules_flex|external/rules_m4):).)*$'
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
.*
2+
*~
3+
*.[ao]
4+
*.orig
5+
*.tar.*
6+
*.s
7+
*.lo
8+
*.la
9+
*.so
10+
*.so.dbg
11+
*.mod.c
12+
*.lst
13+
*.orig
14+
*.rej
15+
16+
CVS
17+
!.gitignore
18+
tags
19+
TAGS
20+
GPATH
21+
GRTAGS
22+
GSYMS
23+
GTAGS
24+
25+
#
26+
# Generated files
27+
#
28+
compile
29+
install-sh
30+
missing
31+
depcomp
32+
INSTALL
33+
aclocal.m4
34+
autoconf-[0-9].*
35+
autom4te.cache
36+
build-aux
37+
Makefile
38+
Makefile.in
39+
config.*
40+
configure
41+
configure.scan
42+
ltmain.sh
43+
libtool
44+
stamp-h
45+
stamp-h1
46+
47+
/mkfs/mkfs.f2fs
48+
/fsck/fsck.f2fs
49+
/tools/fibmap.f2fs
50+
/tools/parse.f2fs
51+
/tools/f2fscrypt
52+
/tools/f2fs_io/f2fs_io
53+
54+
# cscope files
55+
cscope.*
56+
ncscope.*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This package has been developed by Praesto Team at Samsung Electronics Co., Ltd.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
package(
2+
default_visibility = ["@//:android_cuttlefish"],
3+
)
4+
5+
cc_binary(
6+
name = "fsck.f2fs",
7+
srcs = [
8+
"fsck/common.h",
9+
"fsck/compress.h",
10+
"fsck/defrag.c",
11+
"fsck/dict.c",
12+
"fsck/dict.h",
13+
"fsck/dir.c",
14+
"fsck/dqblk_v2.h",
15+
"fsck/dump.c",
16+
"fsck/f2fs.h",
17+
"fsck/fsck.c",
18+
"fsck/fsck.h",
19+
"fsck/main.c",
20+
"fsck/mkquota.c",
21+
"fsck/mount.c",
22+
"fsck/node.c",
23+
"fsck/node.h",
24+
"fsck/quotaio.c",
25+
"fsck/quotaio.h",
26+
"fsck/quotaio_tree.c",
27+
"fsck/quotaio_tree.h",
28+
"fsck/quotaio_v2.c",
29+
"fsck/quotaio_v2.h",
30+
"fsck/resize.c",
31+
"fsck/segment.c",
32+
"fsck/xattr.c",
33+
"fsck/xattr.h",
34+
],
35+
local_defines = [
36+
"WITH_RESIZE",
37+
],
38+
deps = [
39+
":libf2fs_format_utils",
40+
],
41+
)
42+
43+
cc_library(
44+
name = "libf2fs",
45+
srcs = [
46+
"lib/libf2fs.c",
47+
"lib/libf2fs_io.c",
48+
"lib/libf2fs_zoned.c",
49+
"lib/nls_utf8.c",
50+
"lib/utf8data.h",
51+
"mkfs/f2fs_format.c",
52+
"mkfs/f2fs_format_utils.h",
53+
],
54+
includes = [
55+
"include",
56+
"lib",
57+
"mkfs",
58+
],
59+
hdrs = glob([
60+
"include/*.h",
61+
]),
62+
strip_include_prefix = "include",
63+
defines = [
64+
"F2FS_MAJOR_VERSION=1",
65+
"F2FS_MINOR_VERSION=16",
66+
"F2FS_TOOLS_DATE=\\\"2023-04-11\\\"",
67+
"F2FS_TOOLS_VERSION=\\\"1.16.0\\\"",
68+
"WITH_ANDROID",
69+
],
70+
deps = [
71+
"@//libbase",
72+
"@//libsparse",
73+
"@e2fsprogs//:libext2_uuid",
74+
],
75+
)
76+
77+
cc_library(
78+
name = "libf2fs_format_utils",
79+
srcs = [
80+
"mkfs/f2fs_format_utils.c",
81+
],
82+
includes = [
83+
"mkfs",
84+
],
85+
hdrs = [
86+
"mkfs/f2fs_format_utils.h",
87+
],
88+
strip_include_prefix = "mkfs",
89+
deps = [
90+
":libf2fs",
91+
],
92+
)
93+
94+
cc_library(
95+
name = "libf2fs_format_utils_blkdiscard",
96+
srcs = [
97+
"mkfs/f2fs_format_utils.c",
98+
],
99+
includes = [
100+
"mkfs",
101+
],
102+
hdrs = [
103+
"mkfs/f2fs_format_utils.h",
104+
],
105+
strip_include_prefix = "mkfs",
106+
local_defines = [
107+
"WITH_BLKDISCARD",
108+
],
109+
deps = [
110+
":libf2fs",
111+
],
112+
)
113+
114+
cc_binary(
115+
name = "make_f2fs",
116+
srcs = [
117+
"mkfs/f2fs_format_main.c",
118+
],
119+
deps = [
120+
":libf2fs_format_utils_blkdiscard",
121+
],
122+
)

0 commit comments

Comments
 (0)