Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move rules_pkg out of Bazel #8857

Closed
aiuto opened this issue Jul 10, 2019 · 22 comments
Closed

move rules_pkg out of Bazel #8857

aiuto opened this issue Jul 10, 2019 · 22 comments
Assignees
Labels
incompatible-change Incompatible/breaking change P2 We'll consider working on this in future. (Assignee optional) team-Rules-Server Issues for serverside rules included with Bazel type: process
Milestone

Comments

@aiuto
Copy link
Contributor

aiuto commented Jul 10, 2019

//tools/build_defs/pkg:{pkg_deb, pkg_rpm, pkg_tar} are being pulled out of Bazel core and moved to https://github.com/bazelbuild/rules_pkg/tree/master/pkg. Users should migrate to the new versions.

Migration:

  1. Add WORKSPACE stanza as specified in a rule_pkg release
    https://github.com/bazelbuild/rules_pkg/releases

  2. Replace instances of

    load("//tools/build_defs/pkg:pkg.bzl", "pkg_tar", "pkg_deb")
    load("//tools/build_defs/pkg:rpm.bzl", "pkg_rpm")
    

    with

    load("@rules_pkg//:pkg.bzl", "pkg_tar", "pkg_deb")
    load("@rules_pkg//:rpm.bzl", "pkg_rpm")
    

    One line solution (for some users)

    find . -name 'BUILD' -o -name '*.bzl' | xargs sed -i -e '/^load/s#//tools/build_defs/pkg:#@rules_pkg//:#'
    

Expected timeline:

  • The bazelbuild/rules_pkg repository is available for use now. Issues against packaging rules are being transferred to that repository and will be addressed there.
  • Flag to be released in Bazel 0.29.
  • Enabled by default in next Bazel incompatible flag flip release after 0.29
  • //tools/build_defs/pkg/... removed from Bazel by EOY 2019
@aiuto aiuto added the incompatible-change Incompatible/breaking change label Jul 10, 2019
@aiuto aiuto added this to the rules_package milestone Jul 10, 2019
@aiuto aiuto self-assigned this Jul 10, 2019
@aiuto aiuto added P2 We'll consider working on this in future. (Assignee optional) team-Rules-Server Issues for serverside rules included with Bazel labels Jul 10, 2019
bazel-io pushed a commit that referenced this issue Jul 17, 2019
This flag turns off the rules //tools/build_defs/pkg:{pkg_deb, pkg_rpm, pkg_tar}.

The code has moved to https://github.com/bazelbuild/rules_pkg/tree/master/pkg. Users should migrate to the new versions.

RELNOTES: Adds flag --//tools/build_defs/pkg:incompatible_no_build_defs_pkg. This flag turns off the rules //tools/build_defs/pkg:{pkg_deb, pkg_rpm, pkg_tar}.

Part of #8857

Closes #8858.

PiperOrigin-RevId: 258574031
@aiuto aiuto added bazel 1.0 and removed P2 We'll consider working on this in future. (Assignee optional) labels Jul 19, 2019
@lberki lberki added P1 I'll work on this now. (Assignee required) and removed untriaged labels Jul 25, 2019
bazel-io pushed a commit that referenced this issue Jul 26, 2019
See #8857

Thoughts:
- The change to discard_graph_edges_test.sh is ridiculous. The test is flaky in CI and super brittle.
- The fact that some integration tests rely on a WORKSPACE that matches that used to build bazel is odd. I should be able to use the built version of Bazel with my own workspace, with rules_cc and rules_pkg at a different revision level. We should have an integration test framework which establishes an entirely different WORKSPACE and runs a variety of tests within that, rather than trying to build a special purpose one for each test.

RELNOTES: None
PiperOrigin-RevId: 260074256
@dslomov
Copy link
Contributor

dslomov commented Aug 5, 2019

Will the migration tooling be available to do this change?

aiuto added a commit to aiuto/buildtools that referenced this issue Aug 7, 2019
@dslomov dslomov changed the title //tools/build_defs/pkg:incompatible_no_build_defs_pkg flag //tools/build_defs/pkg:incompatible_no_build_defs_pkg: move rules_pkg out of Bazel Aug 9, 2019
@aiuto
Copy link
Contributor Author

aiuto commented Aug 9, 2019

Will the migration tooling be available to do this change?

I could do special purpose tooling with a small python script. OR.. I could wait for a migration tool that can update WORKSPACE IFF any of the BUILD or bzl files were transformed.

The other thing we can do is not bother flipping now and get people to migrate by only adding new features to the new repo.

@aiuto
Copy link
Contributor Author

aiuto commented Dec 23, 2020

No one should be using @bazel_tools/rules_pkg any more. They should use github.com/bazelbuild/rules_pkg.
I think we can fix this by removing the migration labels and/or changing the title of this. I'll do both.
That said, it is just going to disappear from Bazel at one point, with no migration warning.

@aiuto aiuto changed the title //tools/build_defs/pkg:incompatible_no_build_defs_pkg: move rules_pkg out of Bazel move rules_pkg out of Bazel - //tools/build_defs/pkg:incompatible_no_build_defs_pkg Dec 23, 2020
@aiuto aiuto changed the title move rules_pkg out of Bazel - //tools/build_defs/pkg:incompatible_no_build_defs_pkg move rules_pkg out of Bazel Jan 22, 2021
@aiuto
Copy link
Contributor Author

aiuto commented Jan 22, 2021

Status update
github.com/bazelbuild/rules_pkg now has .deb packaging working on linux, macos and Windows.
I plan to remove pkg_deb from Bazel around March 2021.

No timeline for pkg_tar removal.

bazel-io pushed a commit that referenced this issue Feb 19, 2021
*** Reason for rollback ***

While this worked at the time. Upgrading rules_pkg to current versions requires adding rules_python to the test WORKSPACE.  This makes the complexity worse.

I'm falling back to a different solution where bazel builds in a mini-tar that is sufficient for these tests but is not tempting for users to use.

*** Original change description ***

Switch Android rules runtime deps builder to use rules_pkg for pkg_tar.

See #8857

Thoughts:
- The change to discard_graph_edges_test.sh is ridiculous. The test is flaky in CI and super brittle.
- The fact that some integration tests rely on a WORKSPACE that matches that used to build bazel is odd. I should be able to use the built version of Bazel with my own workspace, with rules_cc and rules_pkg at a different revision level. We should have an integr...

***

RELNOTES: None
PiperOrigin-RevId: 358382248
bazel-io pushed a commit that referenced this issue Mar 2, 2021
#8857

Fixes #11217 (#11217)

RELNOTES:
pkg_deb is no longer part of @bazel_tools//build_defs/pkg:pkg.bzl.
Use https://github.com/bazelbuild/rules_pkg/tree/main/pkg instead
PiperOrigin-RevId: 360464481
bazel-io pushed a commit that referenced this issue Apr 6, 2021
Needed to unblock #8857

Closes #11270.

PiperOrigin-RevId: 366994484
@aiuto
Copy link
Contributor Author

aiuto commented Apr 14, 2021

Closing this out.

@aiuto aiuto closed this as completed Apr 14, 2021
aiuto added a commit to aiuto/bazel that referenced this issue Mar 2, 2022
No one should be using this any more.

See: bazelbuild#8857
bazel-io pushed a commit that referenced this issue Mar 3, 2022
No one should be using this any more.

See: #8857

Closes #14934.

PiperOrigin-RevId: 432147816
@janpfeifer
Copy link

For pkg_tar use instead:

load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

@sspathare97
Copy link
Contributor

For pkg_tar use instead:

load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

Aren't they the same thing? pkg:pkg.bzl and pkg:tar.bzl

@aiuto
Copy link
Contributor Author

aiuto commented Mar 24, 2023

No. They are different files. pkg.bzl is going to disappear shortly and you must use pkg/tar.bzl.

lyarwood added a commit to lyarwood/kubevirt that referenced this issue Jul 28, 2023
These rules have been extracted from the Bazel sources and are now
available at bazelbuild/rules_pkg.

See the following issue for more details:

bazelbuild/bazel#8857

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
lyarwood added a commit to lyarwood/kubevirt that referenced this issue Jul 28, 2023
hese rules have been extracted from the Bazel sources and are now
available at bazelbuild/rules_pkg.

See the following issue for more details:

bazelbuild/bazel#8857

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
lyarwood added a commit to lyarwood/kubevirt that referenced this issue Jul 28, 2023
These rules have been extracted from the Bazel sources and are now
available at bazelbuild/rules_pkg.

See the following issue for more details:

bazelbuild/bazel#8857

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
lyarwood added a commit to lyarwood/kubevirt that referenced this issue Jul 31, 2023
These rules have been extracted from the Bazel sources and are now
available at bazelbuild/rules_pkg. See the following issue for more
details:

bazelbuild/bazel#8857

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
alicefr pushed a commit to alicefr/kubevirt that referenced this issue Aug 4, 2023
These rules have been extracted from the Bazel sources and are now
available at bazelbuild/rules_pkg. See the following issue for more
details:

bazelbuild/bazel#8857

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
VirrageS pushed a commit to VirrageS/kubevirt that referenced this issue Nov 17, 2023
These rules have been extracted from the Bazel sources and are now
available at bazelbuild/rules_pkg. See the following issue for more
details:

bazelbuild/bazel#8857

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible-change Incompatible/breaking change P2 We'll consider working on this in future. (Assignee optional) team-Rules-Server Issues for serverside rules included with Bazel type: process
Projects
None yet
Development

No branches or pull requests