Skip to content

Commit

Permalink
updating version to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Nov 17, 2023
1 parent 2fe15fe commit 87cdb60
Show file tree
Hide file tree
Showing 17 changed files with 3,362 additions and 74 deletions.
37 changes: 37 additions & 0 deletions .github/actions/environment/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build toolchain
description: Installs Dependencies and Compiles Lingo

runs:
using: "composite"
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Integration Test
run: |
# setting java17
ls -alh /usr/lib/jvm/
# export JAVA_HOME=/usr/lib/jvm/java-17-temurin-amd64
# building lingo
cargo b --release
# installing lingua-franca tests
git clone https://github.com/lf-lang/lingua-franca.git ./lingua-franca
# installing lfc
curl -Ls https://install.lf-lang.org | bash -s nightly cli
export PATH="$HOME/.local/bin:$PATH"
# going into lfc repo and checking out the vers
cd ./lingua-franca
git reset nightly
cd ..
shell: bash
57 changes: 57 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
on:
pull_request:
push:
branches:
- main

name: Test Lingo
jobs:
cpp-test:
name: CPP Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/environment
- name: Integration Test Cpp
run: |
# copying Lingo.toml
cp test/Lingo-Cpp.toml ./lingua-franca/test/Lingo.toml
cd ./lingua-franca/test/
../../target/release/lingo build
shell: bash
typescript-test:
name: TypeScript Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/environment
- name: Integration Test TypeScript
run: |
# copying Lingo.toml
cp test/Lingo-TypeScript.toml ./lingua-franca/test/Lingo.toml
cd ./lingua-franca/test/
../../target/release/lingo build
shell: bash
lfc-test:
name: LFC Fallback Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/environment
- name: Integration Test TypeScript
run: |
# copying Lingo.toml
cp test/Lingo-LFC.toml ./lingua-franca/test/Lingo.toml
cd ./lingua-franca/test/
../../target/release/lingo build
shell: bash

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ sandbox/
build/
**/src-gen/
tmp/
lingua-franca
39 changes: 23 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
[package]
name = "lingo"
version = "0.1.2"
name = "lingua-franca"
version = "0.2.0"
edition = "2021"

description = "Packagemanager for Lingua-Franca"
homepage = "https://lf-lang.org"
repository = "https://github.com/lf-lang/lingo"


[[bin]]
name = "lingo"
publish = true
path = "./src/main.rs"

[dependencies]

clap = { version = "4.1", features = ["derive"] }
os-version = "0.2"

serde = "*"
serde_json = "*"
serde_derive = "*"
which = "*"
regex = "1.8.4"
lazy_static = "1.4.0"
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"
which = "5.0"
regex = "1.8"
lazy_static = "1.4"
rayon = "1.7"

toml = {version = "0"}
crossbeam = "*"

termion = "1.5"
git2 = "*"
toml = {version = "0.8"}
crossbeam = "0.8"
termion = "2.0"
git2 = "0.18"
run_script = "0.10"
tempfile = "*"
tempfile = "3.0"
6 changes: 3 additions & 3 deletions derivation.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ naersk, src, lib, pkg-config, cmake, zlib, openssl }:
{ naersk, src, lib, pkg-config, cmake, zlib, openssl, glibc}:

naersk.buildPackage {
pname = "lingo";
Expand All @@ -8,8 +8,8 @@ naersk.buildPackage {

cargoSha256 = lib.fakeSha256;

nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ zlib openssl ];
nativeBuildInputs = [ pkg-config cmake zlib openssl glibc];
buildInputs = [ ];

meta = with lib; {
description = "Simple package manager for lingua franca";
Expand Down
30 changes: 14 additions & 16 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;

naersk = {
url = github:nix-community/naersk;
};
Expand Down
6 changes: 3 additions & 3 deletions sandbox/Lingo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ fast = true
[[app]]
name = "git-hook"
target = "Cpp"
main_reactor = "src/Main.lf"
main = "src/Main.lf"
dependencies = {}
# main_reactor defaults to src/Main.lf
# main defaults to src/Main.lf

# dependencies
#[[app.dependencies]]
Expand All @@ -31,7 +31,7 @@ logging = "info"
# second binary
[[app]]
name = "embedded"
main_reactor = "src/Main2.lf"
main = "src/Main2.lf"
dependencies = {}
target = "Cpp"

Expand Down
10 changes: 8 additions & 2 deletions src/backends/cmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ fn gen_cmake_files(app: &App, options: &BuildCommandOptions) -> BuildResult {
cmake.arg("-DREACTOR_CPP_VALIDATE=ON");
cmake.arg("-DREACTOR_CPP_TRACE=OFF");
cmake.arg("-DREACTOR_CPP_LOG_LEVEL=3");
cmake.arg(format!("-DLF_SRC_PKG_PATH={}", app.root_path.display()));
cmake.arg(format!(
"-DLF_SRC_PKG_PATH={}",
app.src_dir_path()
.expect("not a valid main reactor path")
.display()
));
cmake.arg(app.src_gen_dir());
cmake.arg(format!("-B {}", build_dir.display()));
cmake.current_dir(&build_dir);
Expand All @@ -42,7 +47,8 @@ fn gen_cmake_files(app: &App, options: &BuildCommandOptions) -> BuildResult {
}

fn do_cmake_build(results: &mut BatchBuildResults, options: &BuildCommandOptions) {
super::lfc::LFC::do_parallel_lfc_codegen(options, results, false);
results.keep_going(options.keep_going);
super::lfc::LFC::do_parallel_lfc_codegen(options, results, true);
if !options.compile_target_code {
return;
}
Expand Down
8 changes: 6 additions & 2 deletions src/backends/lfc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ impl LFC {
results: &mut BatchBuildResults,
compile_target_code: bool,
) {
results.par_map(|app| LFC::do_lfc_codegen(app, options, compile_target_code));
results.keep_going(options.keep_going);
// TODO: using map_par introduced a race condition
results.map(|app| LFC::do_lfc_codegen(app, options, compile_target_code));
}

/// Do codegen for a single app.
Expand Down Expand Up @@ -89,10 +91,12 @@ impl<'a> LfcJsonArgs<'a> {
.unwrap()
.as_object_mut()
.unwrap();

// lfc does not support no-compile:false
if self.no_compile {
properties.insert("no-compile".to_string(), self.no_compile.into());
properties.insert("no-compile".to_string(), serde_json::Value::Bool(true));
}

Ok(value)
}
}
Expand Down
Loading

0 comments on commit 87cdb60

Please sign in to comment.