google / bazel_rules_install

Bazel rules for installing build results. Similar to `make install`.
Apache License 2.0
37 stars 14 forks source link

installer installs only the FilesToRunProvider main executable and ignores other files #24

Closed hzeller closed 4 years ago

hzeller commented 4 years ago

Currently, install seems to not work around this line: https://github.com/google/bazel_rules_install/blob/master/installer/def.bzl#L33

there is a short_path accessed on the file object, but apparently that file is a broken object. This is with bazel 2.2.0, trying to compile https://github.com/google/verible

ERROR: /tmp/verible/BUILD:15:1: in _gen_installer rule //:_install_gen: Traceback (most recent call last): File "/tmp/verible/BUILD", line 15 _gen_installer(name = '_install_gen') File "/home/hzeller/.cache/bazel/_bazel_hzeller/738e401e7245498e1452e2a408c408c7/external/com_github_google_rules_install/installer/def.bzl", line 33, in _gen_install_binary_impl sources.append(file.short_path) File "/home/hzeller/.cache/bazel/_bazel_hzeller/738e401e7245498e1452e2a408c408c7/external/com_github_google_rules_install/installer/def.bzl", line 33, in sources.append file.short_path 'NoneType' value has no field or method 'short_path'

hzeller commented 4 years ago

b/153238985

hzeller commented 4 years ago

Now worke-ed around by commenting out one destination https://github.com/google/verible/blob/a4c46f2862319919e2ca3e46f7a168f2a18e99de/BUILD#L19

Need to uncomment to test. I suspect this is because the target is a filegroup ? https://github.com/google/verible/blob/a4c46f2862319919e2ca3e46f7a168f2a18e99de/verilog/tools/formatter/BUILD#L25

bttk commented 4 years ago

I don't know what I was thinking in 2018.

installer is looking only at FilesToRunProvider of items in data attribute - only the main executables are being copied. I think I had some unwanted extra files coming from some build rules.

I'm trying if other ways of reading runfiles will work.

bttk commented 4 years ago

In #26 I'm also adding DefaultInfo.files to the set of installed files, which should help with google/verible#254