Skip to content

Commit e770cea

Browse files
bors[bot]Marwes
andauthored
Merge #829
829: Release take 3 r=Marwes a=Marwes Co-authored-by: Markus Westerlind <[email protected]>
2 parents 281949b + 25b22f8 commit e770cea

File tree

6 files changed

+38
-26
lines changed

6 files changed

+38
-26
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ matrix:
3232
env: WASM=1
3333

3434
# Only for deployment
35-
- if: tag IS present
36-
env:
37-
- TARGET=x86_64-unknown-freebsd
38-
- DEPLOY=1
39-
- DISABLE_TESTS=1
35+
# - if: tag IS present
36+
# env:
37+
# - TARGET=x86_64-unknown-freebsd
38+
# - DEPLOY=1
39+
# - DISABLE_TESTS=1
4040
- if: tag IS present
4141
env:
4242
- TARGET=x86_64-pc-windows-gnu

Cargo.lock

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

doc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ documentation = "https://docs.rs/gluon"
1414
[dependencies]
1515
clap = "2.22.0"
1616
env_logger = "0.7"
17-
failure = { version = "0.1", features = ["backtrace"] }
17+
failure = "0.1"
1818
futures = "0.3"
1919
handlebars = "2"
2020
itertools = "0.8"

repl/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ gluon_format = { version = "0.14.1", path = "../format" } # GLUON
2828
gluon_doc = { version = "0.14.1", path = "../doc" } # GLUON
2929

3030
app_dirs = "1.0.0"
31+
failure = "0.1"
3132
futures = "0.3"
3233
tokio = { version = "0.2", features = ["rt-threaded", "rt-core", "macros", "signal"] }
3334
clap = "2.22.0"
@@ -39,7 +40,7 @@ rustyline = "5.0.1"
3940
walkdir = "2"
4041
codespan = "0.3"
4142
codespan-reporting = "0.3"
42-
43+
quick-error = "1.0.0"
4344

4445
serde = "1"
4546
serde_derive = "1"

repl/src/main.rs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use std::{
1919
sync::Arc,
2020
};
2121

22+
use quick_error::quick_error;
2223
use codespan_reporting::termcolor;
2324
use structopt::StructOpt;
2425
use walkdir::WalkDir;
@@ -28,12 +29,28 @@ use gluon::{base, parser, vm};
2829
use crate::base::filename_to_module;
2930

3031
use gluon::{
31-
new_vm_async, vm::thread::ThreadInternal, vm::Error as VMError, Error, Result, Thread,
32+
new_vm_async, vm::thread::ThreadInternal, vm::Error as VMError, Result, Thread,
3233
ThreadExt,
3334
};
3435

3536
mod repl;
3637

38+
quick_error! {
39+
/// Error type wrapping all possible errors that can be generated from gluon
40+
#[derive(Debug)]
41+
#[allow(deprecated)]
42+
enum Error {
43+
Failure(err: failure::Error) {
44+
display("{}", err)
45+
from()
46+
}
47+
Gluon(err: gluon::Error) {
48+
display("{}", err)
49+
from()
50+
}
51+
}
52+
}
53+
3754
const APP_INFO: app_dirs::AppInfo = app_dirs::AppInfo {
3855
name: "gluon-repl",
3956
author: "gluon-lang",
@@ -212,7 +229,7 @@ async fn fmt_stdio(opt: &Opt) -> Result<()> {
212229
Ok(())
213230
}
214231

215-
async fn run(opt: &Opt, color: Color, vm: &Thread) -> std::result::Result<(), gluon::Error> {
232+
async fn run(opt: &Opt, color: Color, vm: &Thread) -> std::result::Result<(), Error> {
216233
vm.global_env().set_debug_level(opt.debug_level.clone());
217234
match opt.subcommand_opt {
218235
Some(SubOpt::Fmt(ref fmt_opt)) => {
@@ -248,8 +265,7 @@ async fn run(opt: &Opt, color: Color, vm: &Thread) -> std::result::Result<(), gl
248265
let input = &doc_opt.input;
249266
let output = &doc_opt.output;
250267
let thread = new_vm_async().await;
251-
gluon_doc::generate_for_path(&thread, input, output)
252-
.map_err(|err| format!("{}\n{}", err, err.backtrace()))?;
268+
gluon_doc::generate_for_path(&thread, input, output)?;
253269
}
254270
None => {
255271
if opt.interactive {
@@ -283,15 +299,18 @@ async fn main() {
283299
let result = run(&opt, opt.color, &vm).await;
284300
if let Err(err) = result {
285301
match err {
286-
Error::VM(VMError::Message(_)) => eprintln!("{}\n{}", err, vm.context().stacktrace(0)),
287-
_ => {
302+
Error::Gluon(gluon::Error::VM(VMError::Message(_))) => eprintln!("{}\n{}", err, vm.context().stacktrace(0)),
303+
Error::Gluon(err) => {
288304
let mut stderr = termcolor::StandardStream::stderr(color.into());
289305
if let Err(err) = err.emit(&mut stderr) {
290306
eprintln!("{}", err);
291307
} else {
292308
eprintln!("");
293309
}
294310
}
311+
Error::Failure(err) => {
312+
eprintln!("{}", err);
313+
}
295314
}
296315
::std::process::exit(1);
297316
}

scripts/publish.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ VERSION=$(echo $1 | sed 's/v//')
44
shift
55

66
declare -a PROJECTS=(
7-
gluon_base
87
gluon_codegen
8+
gluon_base
99
gluon_parser
1010
gluon_check
1111
gluon_completion
@@ -20,20 +20,10 @@ declare -a PROJECTS=(
2020
for PROJECT in "${PROJECTS[@]}"
2121
do
2222
PROJECT_PATH=$(echo "$PROJECT" | sed 's/gluon_//' | sed 's/gluon/./')
23-
echo $PROJECT_PATH
2423

25-
if cd "${PROJECT_PATH}" && cargo publish "$@"; then
24+
if ! (cd "${PROJECT_PATH}" && cargo publish "$@"); then
2625
exit 1
2726
fi
2827
echo "Waiting for ${PROJECT} to publish"
29-
N=0
30-
while ! cargo search "${PROJECT}" | head -1 | grep "${VERSION}"; do
31-
printf '.'
32-
sleep 3
33-
N=$((N+1))
34-
if [[ $N -gt 10 ]]; then
35-
echo "${PROJECT} did not get published!"
36-
exit 1
37-
fi
38-
done
28+
sleep 15
3929
done

0 commit comments

Comments
 (0)