Skip to content

Commit 87cdb60

Browse files
committed
updating version to 0.2.0
1 parent 2fe15fe commit 87cdb60

File tree

17 files changed

+3362
-74
lines changed

17 files changed

+3362
-74
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build toolchain
2+
description: Installs Dependencies and Compiles Lingo
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- uses: actions-rs/toolchain@v1
8+
with:
9+
profile: minimal
10+
toolchain: stable
11+
override: true
12+
- uses: actions/setup-java@v3
13+
with:
14+
distribution: temurin
15+
java-version: 17
16+
- name: Integration Test
17+
run: |
18+
# setting java17
19+
ls -alh /usr/lib/jvm/
20+
# export JAVA_HOME=/usr/lib/jvm/java-17-temurin-amd64
21+
22+
# building lingo
23+
cargo b --release
24+
25+
# installing lingua-franca tests
26+
git clone https://github.com/lf-lang/lingua-franca.git ./lingua-franca
27+
28+
# installing lfc
29+
curl -Ls https://install.lf-lang.org | bash -s nightly cli
30+
export PATH="$HOME/.local/bin:$PATH"
31+
32+
# going into lfc repo and checking out the vers
33+
cd ./lingua-franca
34+
git reset nightly
35+
cd ..
36+
37+
shell: bash

.github/workflows/ci.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
on:
2+
pull_request:
3+
push:
4+
branches:
5+
- main
6+
7+
name: Test Lingo
8+
jobs:
9+
cpp-test:
10+
name: CPP Test
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Setup
15+
uses: ./.github/actions/environment
16+
- name: Integration Test Cpp
17+
run: |
18+
# copying Lingo.toml
19+
cp test/Lingo-Cpp.toml ./lingua-franca/test/Lingo.toml
20+
21+
cd ./lingua-franca/test/
22+
../../target/release/lingo build
23+
24+
shell: bash
25+
typescript-test:
26+
name: TypeScript Test
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Setup
31+
uses: ./.github/actions/environment
32+
- name: Integration Test TypeScript
33+
run: |
34+
# copying Lingo.toml
35+
cp test/Lingo-TypeScript.toml ./lingua-franca/test/Lingo.toml
36+
37+
cd ./lingua-franca/test/
38+
../../target/release/lingo build
39+
40+
shell: bash
41+
lfc-test:
42+
name: LFC Fallback Test
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
- name: Setup
47+
uses: ./.github/actions/environment
48+
- name: Integration Test TypeScript
49+
run: |
50+
# copying Lingo.toml
51+
cp test/Lingo-LFC.toml ./lingua-franca/test/Lingo.toml
52+
53+
cd ./lingua-franca/test/
54+
../../target/release/lingo build
55+
56+
shell: bash
57+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ sandbox/
1919
build/
2020
**/src-gen/
2121
tmp/
22+
lingua-franca

Cargo.toml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
[package]
2-
name = "lingo"
3-
version = "0.1.2"
2+
name = "lingua-franca"
3+
version = "0.2.0"
44
edition = "2021"
55

6+
description = "Packagemanager for Lingua-Franca"
7+
homepage = "https://lf-lang.org"
8+
repository = "https://github.com/lf-lang/lingo"
9+
10+
11+
[[bin]]
12+
name = "lingo"
13+
publish = true
14+
path = "./src/main.rs"
15+
616
[dependencies]
717

818
clap = { version = "4.1", features = ["derive"] }
919
os-version = "0.2"
10-
11-
serde = "*"
12-
serde_json = "*"
13-
serde_derive = "*"
14-
which = "*"
15-
regex = "1.8.4"
16-
lazy_static = "1.4.0"
20+
serde = "1.0"
21+
serde_json = "1.0"
22+
serde_derive = "1.0"
23+
which = "5.0"
24+
regex = "1.8"
25+
lazy_static = "1.4"
1726
rayon = "1.7"
18-
19-
toml = {version = "0"}
20-
crossbeam = "*"
21-
22-
termion = "1.5"
23-
git2 = "*"
27+
toml = {version = "0.8"}
28+
crossbeam = "0.8"
29+
termion = "2.0"
30+
git2 = "0.18"
2431
run_script = "0.10"
25-
tempfile = "*"
32+
tempfile = "3.0"

derivation.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ naersk, src, lib, pkg-config, cmake, zlib, openssl }:
1+
{ naersk, src, lib, pkg-config, cmake, zlib, openssl, glibc}:
22

33
naersk.buildPackage {
44
pname = "lingo";
@@ -8,8 +8,8 @@ naersk.buildPackage {
88

99
cargoSha256 = lib.fakeSha256;
1010

11-
nativeBuildInputs = [ pkg-config cmake ];
12-
buildInputs = [ zlib openssl ];
11+
nativeBuildInputs = [ pkg-config cmake zlib openssl glibc];
12+
buildInputs = [ ];
1313

1414
meta = with lib; {
1515
description = "Simple package manager for lingua franca";

flake.lock

Lines changed: 14 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
inputs = {
3-
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
4-
53
naersk = {
64
url = github:nix-community/naersk;
75
};

sandbox/Lingo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ fast = true
1414
[[app]]
1515
name = "git-hook"
1616
target = "Cpp"
17-
main_reactor = "src/Main.lf"
17+
main = "src/Main.lf"
1818
dependencies = {}
19-
# main_reactor defaults to src/Main.lf
19+
# main defaults to src/Main.lf
2020

2121
# dependencies
2222
#[[app.dependencies]]
@@ -31,7 +31,7 @@ logging = "info"
3131
# second binary
3232
[[app]]
3333
name = "embedded"
34-
main_reactor = "src/Main2.lf"
34+
main = "src/Main2.lf"
3535
dependencies = {}
3636
target = "Cpp"
3737

src/backends/cmake.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ fn gen_cmake_files(app: &App, options: &BuildCommandOptions) -> BuildResult {
3333
cmake.arg("-DREACTOR_CPP_VALIDATE=ON");
3434
cmake.arg("-DREACTOR_CPP_TRACE=OFF");
3535
cmake.arg("-DREACTOR_CPP_LOG_LEVEL=3");
36-
cmake.arg(format!("-DLF_SRC_PKG_PATH={}", app.root_path.display()));
36+
cmake.arg(format!(
37+
"-DLF_SRC_PKG_PATH={}",
38+
app.src_dir_path()
39+
.expect("not a valid main reactor path")
40+
.display()
41+
));
3742
cmake.arg(app.src_gen_dir());
3843
cmake.arg(format!("-B {}", build_dir.display()));
3944
cmake.current_dir(&build_dir);
@@ -42,7 +47,8 @@ fn gen_cmake_files(app: &App, options: &BuildCommandOptions) -> BuildResult {
4247
}
4348

4449
fn do_cmake_build(results: &mut BatchBuildResults, options: &BuildCommandOptions) {
45-
super::lfc::LFC::do_parallel_lfc_codegen(options, results, false);
50+
results.keep_going(options.keep_going);
51+
super::lfc::LFC::do_parallel_lfc_codegen(options, results, true);
4652
if !options.compile_target_code {
4753
return;
4854
}

src/backends/lfc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ impl LFC {
1919
results: &mut BatchBuildResults,
2020
compile_target_code: bool,
2121
) {
22-
results.par_map(|app| LFC::do_lfc_codegen(app, options, compile_target_code));
22+
results.keep_going(options.keep_going);
23+
// TODO: using map_par introduced a race condition
24+
results.map(|app| LFC::do_lfc_codegen(app, options, compile_target_code));
2325
}
2426

2527
/// Do codegen for a single app.
@@ -89,10 +91,12 @@ impl<'a> LfcJsonArgs<'a> {
8991
.unwrap()
9092
.as_object_mut()
9193
.unwrap();
94+
9295
// lfc does not support no-compile:false
9396
if self.no_compile {
94-
properties.insert("no-compile".to_string(), self.no_compile.into());
97+
properties.insert("no-compile".to_string(), serde_json::Value::Bool(true));
9598
}
99+
96100
Ok(value)
97101
}
98102
}

0 commit comments

Comments
 (0)