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

bazel: create genrules to produce debs and RPMs without arch-specific names #74467

Merged
merged 1 commit into from
Feb 24, 2019

Conversation

ixdy
Copy link
Member

@ixdy ixdy commented Feb 23, 2019

What type of PR is this?
/kind bug
/kind cleanup

What this PR does / why we need it: this is a follow-up to #73930.

In that PR I implemented support for cross-compilation using Bazel.

One issue I ran into is that the pkg_deb and pkg_rpm rules have an architecture attribute which is used in their package metadata, but is also used in the output filenames. (For example, pkg_deb actually creates both a $NAME.deb and a $NAME-$ARCH.deb.) Bazel disallows output filenames to be configured - you can't do something like

  out = select(...),

and similarly disallows configuring attributes which affect output filenames (like architecture).

To work around this, instead of configuring the architecture attribute, I used macros and list comprehensions to create multiple rules, each with a -$ARCHITECTURE suffix in their name.
This meant that the debs and RPMs now had different filenames.

I created aliases to maintain the old target names, but these aliases had no effect on the output filenames. Thus downstream projects like Kind were broken, as the debs had new filenames.

In this PR I'm basically restoring the old end-user functionality by replacing the aliases with simple genrules that copy to the non-arched filename. The arch-specific outputs still exist, but are generally to be used indirectly.

Which issue(s) this PR fixes:
Fixes kubernetes-sigs/kind#336

Does this PR introduce a user-facing change?:

NONE

/assign @BenTheElder
cc @neolit123

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 23, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ixdy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 23, 2019
@spiffxp
Copy link
Member

spiffxp commented Feb 24, 2019

/priority important-soon
/sig release
/milestone v1.14

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/release Categorizes an issue or PR as relevant to SIG Release. labels Feb 24, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.14 milestone Feb 24, 2019
@k8s-ci-robot k8s-ci-robot removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 24, 2019
@spiffxp
Copy link
Member

spiffxp commented Feb 24, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2019
@k8s-ci-robot k8s-ci-robot merged commit ba8fcaf into kubernetes:master Feb 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/release Categorizes an issue or PR as relevant to SIG Release. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jobs are broken on kubernetes master (build)
4 participants