Skip to content

Commit

Permalink
Remove snapcraft build and runtime support entirely
Browse files Browse the repository at this point in the history
Snap was a best effort effort for Rustup, is currently broken, and we
have no capacity to develop it.

Remove it to signal clearly that issues with it are not something we're
focusing on - allowing other people to step up and maintain a
distribution of Rustup for Snap if desired.
  • Loading branch information
rbtcollins committed Jul 12, 2022
1 parent 727167a commit 2dcf924
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 223 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/linux-builds-on-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
- target: armv7-unknown-linux-gnueabihf
#snap_arch: armhf
steps:
- uses: actions/checkout@v2
- name: Clone repo
uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
Expand Down Expand Up @@ -145,25 +146,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-1
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Build a snapcraft configuration file
run: |
bash ci/snapcraft.bash
if: matrix.snap_arch != ''
env:
DO_SNAP: 1
SNAP_ARCH: ${{ matrix.snap_arch }}
SNAP_EDGE: 1 # skip-stable
- uses: snapcore/action-build@v1
id: snapcraftbuild
with:
path: snapcraft
if: matrix.snap_arch != ''
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.SNAPCRAFT_TOKEN }}
snap: ${{ steps.snapcraftbuild.outputs.snap }}
release: edge # skip-pr skip-stable
if: matrix.snap_arch != '' # skip-pr
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/linux-builds-on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
- target: armv7-unknown-linux-gnueabihf
#snap_arch: armhf
steps:
- uses: actions/checkout@v2
- name: Clone repo
uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
Expand Down Expand Up @@ -138,24 +139,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-1
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Build a snapcraft configuration file
run: |
bash ci/snapcraft.bash
if: matrix.snap_arch != ''
env:
DO_SNAP: 1
SNAP_ARCH: ${{ matrix.snap_arch }}
SNAP_EDGE: 1 # skip-stable
- uses: snapcore/action-build@v1
id: snapcraftbuild
with:
path: snapcraft
if: matrix.snap_arch != ''
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.SNAPCRAFT_TOKEN }}
snap: ${{ steps.snapcraftbuild.outputs.snap }}
if: matrix.snap_arch == 'not-for-prs' # skip-master skip-stable
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/linux-builds-on-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ jobs:
- target: s390x-unknown-linux-gnu # skip-pr skip-master
#snap_arch: s390x # skip-pr skip-master
steps:
- uses: actions/checkout@v2
- name: Clone repo
uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
Expand Down Expand Up @@ -168,24 +169,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-1
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Build a snapcraft configuration file
run: |
bash ci/snapcraft.bash
if: matrix.snap_arch != ''
env:
DO_SNAP: 1
SNAP_ARCH: ${{ matrix.snap_arch }}
- uses: snapcore/action-build@v1
id: snapcraftbuild
with:
path: snapcraft
if: matrix.snap_arch != ''
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.SNAPCRAFT_TOKEN }}
snap: ${{ steps.snapcraftbuild.outputs.snap }}
release: beta # skip-pr skip-master
if: matrix.snap_arch != '' # skip-pr
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
Expand Down
24 changes: 2 additions & 22 deletions ci/actions-templates/linux-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ jobs:
- target: s390x-unknown-linux-gnu # skip-pr skip-master
#snap_arch: s390x # skip-pr skip-master
steps:
- uses: actions/checkout@v2
- name: Clone repo
uses: actions/checkout@v2
with:
# v2 defaults to a shallow checkout, but we need at least to the previous tag
fetch-depth: 0
Expand Down Expand Up @@ -176,27 +177,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-1
if: github.event_name == 'push' && github.ref == 'refs/heads/stable'
- name: Build a snapcraft configuration file
run: |
bash ci/snapcraft.bash
if: matrix.snap_arch != ''
env:
DO_SNAP: 1
SNAP_ARCH: ${{ matrix.snap_arch }}
SNAP_EDGE: 1 # skip-stable
- uses: snapcore/action-build@v1
id: snapcraftbuild
with:
path: snapcraft
if: matrix.snap_arch != ''
- uses: snapcore/action-publish@v1
with:
store_login: ${{ secrets.SNAPCRAFT_TOKEN }}
snap: ${{ steps.snapcraftbuild.outputs.snap }}
release: edge # skip-pr skip-stable
release: beta # skip-pr skip-master
if: matrix.snap_arch != '' # skip-pr
if: matrix.snap_arch == 'not-for-prs' # skip-master skip-stable
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
Expand Down
125 changes: 0 additions & 125 deletions ci/snapcraft.bash

This file was deleted.

2 changes: 1 addition & 1 deletion doc/src/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ info: downloading self-updates
If your `rustup` was built with the [no-self-update feature](https://github.com/rust-lang/rustup/blob/master/Cargo.toml#L25), it can not update
itself. This is not the default, and only versions of `rustup` built with
`--no-default-features`, or obtained from a third-party distributor who has
disabled it (such as the Ubuntu snap store).
disabled it (such as Nixos).

Otherwise Rustup can update itself. It is possible to control Rustup's automatic
self update mechanism with the `auto-self-update` configuration variable. This
Expand Down
17 changes: 0 additions & 17 deletions src/cli/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,23 +292,6 @@ pub(crate) fn self_update_permitted(explicit: bool) -> Result<SelfUpdatePermissi
Ok(SelfUpdatePermission::Permit)
} else {
// Detect if rustup is not meant to self-update
match process().var("SNAP") {
Ok(_) => {
// We're running under snappy so don't even bother
// trying to self-update
// TODO: Report this to the user?
// TODO: Maybe ask snapd if there's an update and report
// that to the user instead?
debug!("Skipping self-update because SNAP was detected");
if explicit {
return Ok(SelfUpdatePermission::HardFail);
} else {
return Ok(SelfUpdatePermission::Skip);
}
}
Err(env::VarError::NotPresent) => {}
Err(e) => return Err(e).context("Could not interrogate SNAP environment variable"),
}
let current_exe = env::current_exe()?;
let current_exe_dir = current_exe.parent().expect("Rustup isn't in a directory‽");
if let Err(e) = tempfile::Builder::new()
Expand Down

0 comments on commit 2dcf924

Please sign in to comment.