Skip to content

Commit

Permalink
Merge pull request #45 from gracig/v.0.5.0
Browse files Browse the repository at this point in the history
V.0.5.0
  • Loading branch information
njfio authored Aug 6, 2024
2 parents b59b57b + e742548 commit 5a05b47
Show file tree
Hide file tree
Showing 15 changed files with 1,875 additions and 812 deletions.
18 changes: 18 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[profile.rust-analyzer]
inherits = "dev"
debug-assertions = true

[profile.dev]
debug = true
debug-assertions = false
incremental = true


[target.x86_64-unknown-linux-musl]
linker = "rust-lld"

[profile.release]
opt-level = "z" # Optimize for size
lto = true # Enable Link Time Optimization
codegen-units = 1 # Reduce codegen units to increase optimization
strip = "debuginfo" # Strip debug information
58 changes: 58 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Use the official Amazon Linux image
FROM amazonlinux:latest

ARG USERNAME=amazonlinux
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN yum update -y \
&& yum install -y shadow-utils sudo \
&& yum clean all

# Create the user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Install development tools and dependencies
RUN yum groupinstall -y "Development Tools" \
&& yum install -y \
git \
vim \
tar \
gzip \
openssl-devel \
perl \
perl-core \
perl-IPC-Cmd \
wget \
glibc-langpack-en \
&& yum clean all

# Switch to the created user
USER $USERNAME

# Install Rust and Cargo tools as the amazonlinux user
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& ~/.cargo/bin/cargo install cargo-lambda \
&& ~/.cargo/bin/cargo install just \
&& ~/.cargo/bin/cargo install --git https://github.com/fpco/amber \
&& ~/.cargo/bin/cargo install pqrs \
&& ~/.cargo/bin/cargo install --git https://github.com/helix-editor/helix helix-term --locked \
&& ~/.cargo/bin/rustup install nightly \
&& ~/.cargo/bin/rustup target add x86_64-unknown-linux-musl \
&& ~/.cargo/bin/cargo install cargo-udeps

# Set environment variables
ENV PATH="/home/$USERNAME/.cargo/bin:${PATH}"
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV OPENSSL_DIR=/usr \
OPENSSL_LIB_DIR=/usr/lib64 \
OPENSSL_INCLUDE_DIR=/usr/include \
CC=gcc

# Set the working directory
WORKDIR /workspace
73 changes: 73 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "Amazon Linux Rust Dev Container",
"context": "..",
"dockerFile": "Dockerfile",
"postCreateCommand": "rustup update",
"runArgs": [
"--env-file",
".devcontainer/.env"
],
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"source=/home/ggraciani/.ssh/id_ed25519hit,target=/home/amazonlinux/.ssh/id_ed25519hit,type=bind,consistency=cached",
"source=/home/ggraciani/.ssh/known_hosts,target=/home/amazonlinux/.ssh/known_hosts,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"extensions": [
"amazonwebservices.aws-toolkit-vscode",
"arrterian.nix-env-selector",
"bbenoist.nix",
"bierner.markdown-preview-github-styles",
"bradlc.vscode-tailwindcss",
"brettm12345.nixfmt-vscode",
"dbaeumer.vscode-eslint",
"earthly.earthfile-syntax-highlighting",
"editorconfig.editorconfig",
"github.copilot",
"github.copilot-chat",
"github.vscode-github-actions",
"golang.go",
"hashicorp.terraform",
"hediet.vscode-drawio",
"janisdd.vscode-edit-csv",
"jeremyrajan.webpack",
"mark-hansen.hledger-vscode",
"marp-team.marp-vscode",
"mechatroner.rainbow-csv",
"mkhl.shfmt",
"ms-azuretools.vscode-docker",
"ms-playwright.playwright",
"ms-python.debugpy",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-vscode-remote.remote-containers",
"ms-vscode.hexeditor",
"ms-vscode.vscode-speech",
"octref.vscode-ts-config-plugin",
"phu1237.vs-browser",
"polymeilex.wgsl",
"rangav.vscode-thunder-client",
"rebornix.ruby",
"redhat.vscode-yaml",
"rust-lang.rust-analyzer",
"skellock.just",
"tamasfe.even-better-toml",
"timonwong.shellcheck",
"tomoki1207.pdf",
"usernamehw.errorlens",
"vadimcn.vscode-lldb",
"wgsl-analyzer.wgsl-analyzer",
"wingrunr21.vscode-ruby",
"zxh404.vscode-proto3",
"fill-labs.dependi"
]
}
}
}
9 changes: 8 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ jobs:
./target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test --verbose
run: cargo test --verbose --target x86_64-unknown-linux-gnu

build:
strategy:
fail-fast: false
matrix:
include:
- TARGET: x86_64-unknown-linux-musl
OS: ubuntu-latest
- TARGET: x86_64-unknown-linux-gnu
OS: ubuntu-latest
- TARGET: x86_64-apple-darwin
Expand Down Expand Up @@ -74,6 +76,11 @@ jobs:
sudo apt-get update
sudo apt-get install -qq crossbuild-essential-arm64 crossbuild-essential-armhf
fi
- name: Add musl target
if: ${{ matrix.TARGET == 'x86_64-unknown-linux-musl' }}
run: sudo apt-get update && sudo apt-get install -y musl-dev musl-tools

- name: Run build
run: cargo build --release --verbose --target $TARGET
- name: Run tests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk

**/.env

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
.idea/vcs.xml
Expand Down
11 changes: 5 additions & 6 deletions crates/fluent-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ edition = "2021"
clap = { version = "4.5.8", features = ["derive"] }
fluent-core = { path = "../fluent-core" }
fluent-engines = { path = "../fluent-engines" }
fluent-storage = { path = "../fluent-storage" }

tokio = { version = "1", features = ["full"] }
anyhow = "1.0"
log = "0.4.22"
atty = "0.2.14"
uuid = { version = "1.9.1", features = ["v4"] }
clap_complete = "4.5.1"
serde_json = "1.0.120"
indicatif = "0.17.8"
owo-colors = "3.5.0"
owo-colors = "4.0.0"
regex = "1.10.5"
serde_yaml = "0.9.34+deprecated"
serde_yaml = "0.9.34+deprecated"
#fluent-storage = { path = "../fluent-storage" } # is not used
#clap_complete = "4.5.1" #is not used
#atty = "0.2.14" "use standard std::io::IsTerminal"
Loading

0 comments on commit 5a05b47

Please sign in to comment.