stackb / rules_hugo

Bazel build rules for hugo static website generator
Other
45 stars 36 forks source link

Build failing due to symlinks #1

Closed iridian-ks closed 6 years ago

iridian-ks commented 6 years ago

Not sure if this is just me but I'm getting an odd error regarding symlinks. I'm on Ubuntu 18.04.

$ bazel build //:root                                                                                                                                                              
INFO: Analysed target //:root (0 packages loaded).                                                                                                                                                                  
INFO: Found 1 target...                                                                                                                                                                                             
ERROR: /home/dillon/Projects/websites/BUILD:14:1: error executing shell command: 'external/hugo/hugo --theme aerial --config bazel-out/k8-fastbuild/bin/config.toml --contentDir bazel-out/k8-fastbuild/bin/content 
--themesDir bazel-out/k8-fastbuild/bin/themes --destination bazel-o...' failed (Exit 255)                                                                                                                           
ERROR 2018/05/19 21:06:07 No 'baseURL' set in configuration or as a flag. Features like page menus will not work without one.                                                                                       
ERROR 2018/05/19 21:06:07 Symbolic links for directories not supported, skipping '/home/dillon/.cache/bazel/_bazel_dillon/276d15000fe312ac16b9626985ee1344/sandbox/2456875482650233026/execroot/re_gilm_d_websites/$azel-out/k8-fastbuild/bin/themes/aerial/layouts'
ERROR 2018/05/19 21:06:07 Symbolic links for directories not supported, skipping '/home/dillon/.cache/bazel/_bazel_dillon/276d15000fe312ac16b9626985ee1344/sandbox/2456875482650233026/execroot/re_gilm_d_websites/$azel-out/k8-fastbuild/bin/themes/aerial/layouts'
ERROR 2018/05/19 21:06:07 Symbolic links for directories not supported, skipping '/home/dillon/.cache/bazel/_bazel_dillon/276d15000fe312ac16b9626985ee1344/sandbox/2456875482650233026/execroot/re_gilm_d_websites/$azel-out/k8-fastbuild/bin/themes/aerial/layouts'
ERROR 2018/05/19 21:06:07 Symbolic links for directories not supported, skipping '/home/dillon/.cache/bazel/_bazel_dillon/276d15000fe312ac16b9626985ee1344/sandbox/2456875482650233026/execroot/re_gilm_d_websites/$azel-out/k8-fastbuild/bin/themes/aerial/layouts'
ERROR 2018/05/19 21:06:07 Symbolic links for directories not supported, skipping '/home/dillon/.cache/bazel/_bazel_dillon/276d15000fe312ac16b9626985ee1344/sandbox/2456875482650233026/execroot/re_gilm_d_websites/$azel-out/k8-fastbuild/bin/themes/aerial/layouts'
ERROR 2018/05/19 21:06:07 Symbolic links for directories not supported, skipping '/home/dillon/.cache/bazel/_bazel_dillon/276d15000fe312ac16b9626985ee1344/sandbox/2456875482650233026/execroot/re_gilm_d_websites/$azel-out/k8-fastbuild/bin/themes/aerial/layouts'
Started building sites ...

Built site for language en:
0 draft content
0 future content
0 expired content
0 regular pages created
6 other pages created
0 non-page files copied
0 paginator pages created
0 categories created
0 tags created
total in 1 ms
Target //:root failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.706s, Critical Path: 0.23s
INFO: 40 processes, linux-sandbox.
FAILED: Build did NOT complete successfully

Looking at the directory where Hugo is being run it looks like everything is a symlink. My BUILD and WORKSPACE files are essentially a copy and paste of what's in your test/basic directory. Is there a workaround for this?

Thanks!

tsuri commented 6 years ago

You can workaround this by using --spawn_strategy=standalone. Obviously this is not good enough if this is embedded in a larger project. The error is due to zip. I'd personally replace it w/ tar.