Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

buildozer fails to package as of 4.0.0 #46

Closed
sudoforge opened this issue Apr 29, 2021 · 1 comment
Closed

buildozer fails to package as of 4.0.0 #46

sudoforge opened this issue Apr 29, 2021 · 1 comment
Labels
area/package/buildozer Issue or PR that relates to //buildozer effort/low This issue should be accomplishable in about a day kind/bug Categorizes issue or PR as related to a bug priority/critical-urgent Highest priority. Must be actively worked on above other issues

Comments

@sudoforge
Copy link
Owner

The package is failing to find the bin, I have the same problem in my clean-chroot (using the aur-build tools).

The symlinks to the bazel outputs are:
bazel-bin -> /home/ixil/.cache/bazel/_bazel_ixil/ba49057621d38c7b92c85bf47f82b92c/execroot/com_github_bazelbuild_buildtools/bazel-out/k8-fastbuild/bin

Whereas the actual bin is at:

$cd ~/.cache/bazel; fd -x buildozer-linux;
   ./_bazel_ixil/ba49057621d38c7b92c85bf47f82b92c/execroot/com_github_bazelbuild_buildtools/bazel-out/k8-fastbuild-ST-05b09dfdd2e5/bin/buildozer/buildozer-linux_amd64

makepkg -s

==> Starting build()...
Starting local Bazel server and connecting to it...
WARNING: ignoring _JAVA_OPTIONS in environment.
INFO: Analyzed target //buildozer:buildozer-linux (105 packages loaded, 8159 targets configured).
INFO: Found 1 target...
Target //buildozer:buildozer-linux up-to-date:
  bazel-out/k8-fastbuild-ST-05b09dfdd2e5/bin/buildozer/buildozer-linux_amd64
INFO: Elapsed time: 53.302s, Critical Path: 21.34s
INFO: 567 processes: 24 internal, 543 linux-sandbox.
INFO: Build completed successfully, 567 total actions
==> Entering fakeroot environment...
==> Starting package()...
install: cannot stat './bazel-bin/buildozer/buildozer-linux_amd64': No such file or directory
==> ERROR: A failure occurred in package().
    Aborting...

Originally posted by @ixil in #45 (comment)

@sudoforge
Copy link
Owner Author

This is due to an upgrade to rules_go made during the upstream movement from 3.5.0 to 4.0.0. In short, go_binary no longer places the output for a given target (specified by the out attribute) in a deterministic location. As a workaround, we can apply a patch which uses copy_file (from @bazel_skylib) in order to copy the output file for the //buildozer:buildozer-linux target to the appropriate location.

sudoforge pushed a commit that referenced this issue Apr 29, 2021
…tions

As of buildozer 4.0.0, the `go_binary` rule no longer outputs a file in
a predetermined location, due to the use of starlark configuration
transitions. This commit adds a patch file which adds a new target using
`@bazel_skylib//rules:copy_file.bzl`, which allows us to place the
desired target's output file in a deterministic location.

closes #46

GitOrigin-RevId: 57e63f2722bef22c530ccd3a0767f610eb51115c
@sudoforge sudoforge added area: packages effort/low This issue should be accomplishable in about a day kind/bug Categorizes issue or PR as related to a bug labels Apr 29, 2021
@sudoforge sudoforge added area/package/buildozer Issue or PR that relates to //buildozer priority/critical-urgent Highest priority. Must be actively worked on above other issues and removed area: packages labels Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/package/buildozer Issue or PR that relates to //buildozer effort/low This issue should be accomplishable in about a day kind/bug Categorizes issue or PR as related to a bug priority/critical-urgent Highest priority. Must be actively worked on above other issues
Projects
None yet
Development

No branches or pull requests

1 participant