Skip to content

Commit

Permalink
Properly fixup socket enablement on older systemd versions (#1095)
Browse files Browse the repository at this point in the history
* Properly fixup socket enablement on older systemd versions

I completely ignored the other branch of the `if`, oops.

* fixup: remove i686-linux from CI too
  • Loading branch information
cole-h authored Aug 16, 2024
1 parent 39cfa6d commit 9010178
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 104 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/build-i686-linux.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/release-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ jobs:
uses: ./.github/workflows/build-x86_64-linux.yml
with:
cache-key: release-x86_64-linux-artifacts-${{ github.sha }}
build-i686-linux:
uses: ./.github/workflows/build-i686-linux.yml
with:
cache-key: release-i686-linux-artifacts-${{ github.sha }}
build-aarch64-linux:
uses: ./.github/workflows/build-aarch64-linux.yml
with:
Expand All @@ -42,7 +38,6 @@ jobs:
id-token: write # In order to request a JWT for AWS auth
needs:
- build-x86_64-linux
- build-i686-linux
- build-aarch64-linux
- build-x86_64-darwin
- build-aarch64-darwin
Expand All @@ -60,14 +55,6 @@ jobs:
- name: Move artifact to artifacts directory
run: mv ./nix-installer ./artifacts/nix-installer-x86_64-linux

- name: Fetch cached i686-linux binary
uses: actions/cache/restore@v3
with:
path: nix-installer
key: release-i686-linux-artifacts-${{ github.sha }}
- name: Move artifact to artifacts directory
run: mv ./nix-installer ./artifacts/nix-installer-i686-linux

- name: Fetch cached aarch64-linux binary
uses: actions/cache/restore@v3
with:
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/release-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ jobs:
uses: ./.github/workflows/build-x86_64-linux.yml
with:
cache-key: release-x86_64-linux-artifacts-${{ github.sha }}
build-i686-linux:
# Only intra-repo PRs are allowed to have PR artifacts uploaded
# We only want to trigger once the upload once in the case the upload label is added, not when any label is added
if: |
always() && !failure() && !cancelled()
&& github.event.pull_request.head.repo.full_name == 'DeterminateSystems/nix-installer'
&& (
(github.event.action == 'labeled' && github.event.label.name == 'upload to s3')
|| (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'upload to s3'))
)
uses: ./.github/workflows/build-i686-linux.yml
with:
cache-key: release-i686-linux-artifacts-${{ github.sha }}
build-aarch64-linux:
# Only intra-repo PRs are allowed to have PR artifacts uploaded
# We only want to trigger once the upload once in the case the upload label is added, not when any label is added
Expand Down Expand Up @@ -95,7 +82,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- build-x86_64-linux
- build-i686-linux
- build-aarch64-linux
- build-x86_64-darwin
- build-aarch64-darwin
Expand All @@ -113,14 +99,6 @@ jobs:
- name: Move artifact to artifacts directory
run: mv ./nix-installer ./artifacts/nix-installer-x86_64-linux

- name: Fetch cached i686-linux binary
uses: actions/cache/restore@v3
with:
path: nix-installer
key: release-i686-linux-artifacts-${{ github.sha }}
- name: Move artifact to artifacts directory
run: mv ./nix-installer ./artifacts/nix-installer-i686-linux

- name: Fetch cached aarch64-linux binary
uses: actions/cache/restore@v3
with:
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ jobs:
uses: ./.github/workflows/build-x86_64-linux.yml
with:
cache-key: release-x86_64-linux-artifacts-${{ github.sha }}
build-i686-linux:
uses: ./.github/workflows/build-i686-linux.yml
with:
cache-key: release-i686-linux-artifacts-${{ github.sha }}
build-aarch64-linux:
uses: ./.github/workflows/build-aarch64-linux.yml
with:
Expand All @@ -38,7 +34,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- build-x86_64-linux
- build-i686-linux
- build-aarch64-linux
- build-x86_64-darwin
- build-aarch64-darwin
Expand All @@ -56,14 +51,6 @@ jobs:
- name: Move artifact to artifacts directory
run: mv ./nix-installer ./artifacts/nix-installer-x86_64-linux

- name: Fetch cached i686-linux binary
uses: actions/cache/restore@v3
with:
path: nix-installer
key: release-i686-linux-artifacts-${{ github.sha }}
- name: Move artifact to artifacts directory
run: mv ./nix-installer ./artifacts/nix-installer-i686-linux

- name: Fetch cached aarch64-linux binary
uses: actions/cache/restore@v3
with:
Expand Down
38 changes: 18 additions & 20 deletions src/action/common/configure_init_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,26 +459,24 @@ impl Action for ConfigureInitService {
}

for SocketFile { name, src, .. } in socket_files.iter() {
if *start_daemon || any_socket_was_active {
match src {
UnitSrc::Path(path) => {
// NOTE(cole-h): we have to enable by path here because older
// systemd's (e.g. on our Ubuntu 16.04 test VMs) had faulty (or too-
// strict) symlink detection, which causes the symlink chain of
// `/etc/systemd/system/nix-daemon.socket` ->
// `/nix/var/nix/profiles/default` -> `/nix/store/............/nix-
// daemon.socket` to fail with "Failed to execute operation: Too
// many levels of symbolic links"
enable(path.display().to_string().as_ref(), true)
.await
.map_err(Self::error)?;
},
UnitSrc::Literal(_) => {
enable(name, true).await.map_err(Self::error)?;
},
}
} else {
enable(name, false).await.map_err(Self::error)?;
let enable_now = *start_daemon || any_socket_was_active;

match src {
UnitSrc::Path(path) => {
// NOTE(cole-h): we have to enable by path here because older systemd's
// (e.g. on our Ubuntu 16.04 test VMs) had faulty (or too- strict)
// symlink detection, which causes the symlink chain of
// `/etc/systemd/system/nix-daemon.socket` ->
// `/nix/var/nix/profiles/default` -> `/nix/store/............/nix-
// daemon.socket` to fail with "Failed to execute operation: Too many
// levels of symbolic links"
enable(path.display().to_string().as_ref(), enable_now)
.await
.map_err(Self::error)?;
},
UnitSrc::Literal(_) => {
enable(name, enable_now).await.map_err(Self::error)?;
},
}
}
},
Expand Down

0 comments on commit 9010178

Please sign in to comment.