Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint_prettify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: 1.96.0
components: rustfmt
override: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/step_cli_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
toolchain: 1.96.0
components: rustfmt
override: true
target: x86_64-unknown-linux-musl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2024-08-02
toolchain: 1.96.0
components: rustfmt
override: true

Expand Down
26 changes: 18 additions & 8 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
{ pkgs, ... }:

let
rustOverlay = import (builtins.fetchTarball {
url = "https://github.com/oxalica/rust-overlay/archive/107c334f141854f563f8adf1db781dc453d92639.tar.gz";
sha256 = "138jwq564qji7dc5yav2j2c1c1mr65smqqk00mni9lvqhx0n45w4";
});

pkgs' = pkgs.extend rustOverlay;

rustStable = pkgs'.rust-bin.stable."1.96.0".default.override {
targets = [ "wasm32-unknown-unknown" "wasm32-wasip1" "wasm32-wasip2" ];
extensions = [ "rust-src" "rust-analyzer-preview" ];
};
in
{
# https://devenv.sh/basics/
env = {
Expand All @@ -16,6 +29,9 @@

# https://devenv.sh/packages/
packages = with pkgs; [
# Binary Rust
rustStable

# AWS
(aws-sam-cli.overridePythonAttrs { doCheck = false; })

Expand Down Expand Up @@ -83,15 +99,9 @@
export LD_LIBRARY_PATH=${pkgs.openssl.out}/lib:$LD_LIBRARY_PATH
export PATH=/workspaces/step/packages/step-cli/rust-local-target/release:$PATH
set +a
'';

# https://devenv.sh/languages/
languages.rust = {
enable = true;
# https://devenv.sh/reference/options/#languagesrustchannel
channel = "nightly";
toolchain.rust-src = pkgs.rustPlatform.rustLibSrc;
};
export RUST_SRC_PATH=${rustStable}/lib/rustlib/src/rust/library
'';

languages.java = {
enable = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/Dockerfile.cargo-packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# for example packages/windmill/Dockerfile, packages/harvest/Dockerfile, etc.


FROM rustlang/rust:nightly-bookworm-slim
FROM rust:1.96.0-slim-bookworm

WORKDIR /app

Expand Down
5 changes: 1 addition & 4 deletions packages/Dockerfile.immudb-init-vstl-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.82.0-slim-bookworm
FROM rust:1.96.0-slim-bookworm

WORKDIR /app

Expand All @@ -13,9 +13,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

# copy projects
#TODO: Copy only necessary files
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion packages/Dockerfile.immudb-init.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.90.0-slim-bookworm as builder
FROM rust:1.96.0-slim-bookworm as builder

WORKDIR /app

Expand Down
5 changes: 1 addition & 4 deletions packages/b3/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rustlang/rust:nightly-bookworm-slim as builder
FROM rust:1.96.0-slim-bookworm as builder

WORKDIR /app

Expand All @@ -13,9 +13,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

# copy projects
#TODO: Copy only necessary files
WORKDIR /app
Expand Down
5 changes: 1 addition & 4 deletions packages/b3/Dockerfile.prod-vstl-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.82.0-slim-bookworm
FROM rust:1.96.0-slim-bookworm

WORKDIR /app

Expand All @@ -16,9 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

#TODO: Copy only necessary files
COPY ./braid/Cargo.toml ./braid/Cargo.toml
COPY ./b3/Cargo.toml ./b3/Cargo.toml
Expand Down
6 changes: 1 addition & 5 deletions packages/braid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rustlang/rust:nightly-bookworm-slim
FROM rust:1.96.0-slim-bookworm

# Copy projects
WORKDIR /app
Expand All @@ -25,10 +25,6 @@ RUN apt-get update \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install the specific nightly toolchain
RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

ARG VAULT_VERSION=1.15.5

# Install vault
Expand Down
5 changes: 1 addition & 4 deletions packages/braid/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rustlang/rust:nightly-bookworm-slim as builder
FROM rust:1.96.0-slim-bookworm as builder

WORKDIR /app

Expand All @@ -18,9 +18,6 @@ RUN apt-get update \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

# copy projects
#TODO: Copy only necessary files
WORKDIR /app
Expand Down
5 changes: 1 addition & 4 deletions packages/braid/Dockerfile.prod-vstl-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rustlang/rust:nightly-bookworm-slim as builder
FROM rust:1.96.0-slim-bookworm as builder

WORKDIR /app

Expand All @@ -13,9 +13,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
make \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

# copy projects
#TODO: Copy only necessary files
WORKDIR /app
Expand Down
5 changes: 1 addition & 4 deletions packages/e2e/src/mock_server/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.82.0-slim-bookworm AS builder
FROM rust:1.96.0-slim-bookworm AS builder

WORKDIR /app

Expand All @@ -16,9 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

#TODO: Copy only necessary files
COPY ./ ./

Expand Down
3 changes: 1 addition & 2 deletions packages/harvest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.82.0
FROM rust:1.96.0-slim-bookworm

ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8400
Expand All @@ -19,7 +19,6 @@ COPY ./wrap-map-err ./wrap-map-err
COPY ./velvet ./velvet

RUN apt-get update && apt-get install -y chromium protobuf-compiler libprotobuf-dev
RUN rustup default nightly

WORKDIR /app/harvest
RUN cargo build
Expand Down
5 changes: 1 addition & 4 deletions packages/harvest/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.82.0-slim-bookworm as builder
FROM rust:1.96.0-slim-bookworm as builder

WORKDIR /app

Expand All @@ -16,9 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

#TODO: Copy only necessary files
COPY ./braid ./braid
COPY ./b3 ./b3
Expand Down
5 changes: 1 addition & 4 deletions packages/harvest/Dockerfile.prod-vstl-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: AGPL-3.0-only

FROM rust:1.82.0-slim-bookworm
FROM rust:1.96.0-slim-bookworm

WORKDIR /app

Expand All @@ -16,9 +16,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*

RUN rustup toolchain install nightly-2024-09-01 \
&& rustup default nightly-2024-09-01

#TODO: Copy only necessary files
COPY ./braid/Cargo.toml ./braid/Cargo.toml
COPY ./b3/Cargo.toml ./b3/Cargo.toml
Expand Down
2 changes: 1 addition & 1 deletion packages/orare/doc_renderer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARG AWS_S3_MAX_UPLOAD_BYTES=""
ARG AWS_S3_UPLOAD_EXPIRATION_SECS=""
ARG AWS_S3_FETCH_EXPIRATION_SECS=""

FROM rustlang/rust:nightly AS builder
FROM rust:1.96.0-slim-bookworm AS builder
ARG FEATURES

RUN apt-get update && \
Expand Down
11 changes: 9 additions & 2 deletions packages/sequent-core/src/ballot_codec/raw_ballot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ impl RawBallotCodec for Contest {
let base_bits = (char_map.base() as f64).log2().ceil() as i32;

if remaining_bits > 0 {
Ok(remaining_bits.div_ceil(base_bits))
// div_ceil: round up for positive numbers
Ok((remaining_bits as u32).div_ceil(base_bits as u32) as i32)
} else {
Ok(remaining_bits.div_floor(base_bits))
// div_floor: round toward negative infinity for negative numbers
Ok((remaining_bits / base_bits)
- if remaining_bits % base_bits != 0 {
1
} else {
0
})
}
}

Expand Down
1 change: 0 additions & 1 deletion packages/sequent-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: 2022 Felix Robles <felix@sequentech.io>
//
// SPDX-License-Identifier: AGPL-3.0-only
#![feature(int_roundings)]
#[macro_use]
extern crate quick_error;
extern crate cfg_if;
Expand Down
6 changes: 5 additions & 1 deletion packages/ui-core/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: AGPL-3.0-only

import React from "react"

Check warning on line 5 in packages/ui-core/src/index.tsx

View workflow job for this annotation

GitHub Actions / Check frontend linting

'React' is defined but never used

export {
default as i18n,
Expand All @@ -25,7 +25,11 @@
export {downloadBlob, downloadUrl} from "./services/downloadBlob"
export {shuffle, splitList, keyBy} from "./utils/array"
export {normalizeWriteInText} from "./services/normalizeWriteInText"
export {translate, translateFromPresentation} from "./services/translate"
export {
isTranslatablePresentation,
translate,
translateFromPresentation,
} from "./services/translate"
export * from "./types/ElectionEventPresentation"
export * from "./services/percentFormatter"
export * from "./services/wasm"
Expand Down
Loading
Loading