Skip to content
Snippets Groups Projects
Commit 115c2ac6 authored by Michael Aaron Murphy's avatar Michael Aaron Murphy
Browse files

System Allocator & Makefile Vendoring Improvements

parent e4b1c355
Branches
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (git+https://gitlab.redox-os.org/redox-os/termion)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
......@@ -435,16 +435,6 @@ dependencies = [
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termion"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.40 (git+https://gitlab.redox-os.org/redox-os/syscall.git?branch=relibc)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "textwrap"
version = "0.10.0"
......@@ -589,7 +579,6 @@ source = "git+https://github.com/whitequark/rust-xdg#090afef2509d746e48d6bfa9b2e
"checksum syn 0.15.17 (registry+https://github.com/rust-lang/crates.io-index)" = "3391038ebc3e4ab24eb028cb0ef2f2dc4ba0cbf72ee895ed6a6fad730640b5bc"
"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015"
"checksum termion 1.5.1 (git+https://gitlab.redox-os.org/redox-os/termion)" = "<none>"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
"checksum ucd-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0f8bfa9ff0cadcd210129ad9d2c5f145c13e9ced3d3e5d948a6213487d52444"
......
......@@ -62,5 +62,6 @@ lto = true
panic = "abort"
[patch.crates-io]
termion = { git = "https://gitlab.redox-os.org/redox-os/termion" }
liner = { git = "https://gitlab.redox-os.org/redox-os/liner" }
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git", branch = "relibc" }
......@@ -2,8 +2,9 @@ prefix ?= usr/local
BINARY = $(prefix)/bin/ion
RELEASE = debug
DEBUG ?= 0
VENDORED = 0
ifeq (0, $(DEBUG))
ifeq (0,$(DEBUG))
ARGS += --release
RELEASE = release
endif
......@@ -12,16 +13,15 @@ ifeq (1,$(REDOX))
ARGS += --target x86_64-unknown-redox
endif
ifneq ($(wildcard vendor.tar.xz),)
VENDORED = 1
ARGSV += --frozen
endif
.PHONY: all clean distclean install uninstall
all: .cargo/config
if [ -f vendor.tar.xz ]; \
then \
tar pxf vendor.tar.xz; \
cargo build $(ARGS) --frozen; \
else \
cargo build $(ARGS); \
fi
all: extract .cargo/config
cargo build $(ARGS) $(ARGSV)
clean:
cargo clean
......@@ -30,12 +30,11 @@ distclean:
rm -rf vendor vendor.tar.xz .cargo
tests:
cargo test --manifest-path members/braces/Cargo.toml
cargo test --manifest-path members/builtins/Cargo.toml
cargo test --manifest-path members/lexers/Cargo.toml
cargo test --manifest-path members/ranges/Cargo.toml
cargo test
cargo test $(ARGSV)
bash examples/run_examples.sh
for crate in members/*; do \
cargo test $(ARGSV) --manifest-path $$crate/Cargo.toml; \
done
install:
install -Dm0755 target/$(RELEASE)/ion $(DESTDIR)/$(BINARY)
......@@ -58,14 +57,17 @@ vendor.tar.xz:
vendor: .cargo/config vendor.tar.xz
extract:
ifeq (1,$(VENDORED)$(wildcard vendor))
tar pxf vendor.tar.xz
endif
update-shells:
if ! grep ion /etc/shells >/dev/null; then \
echo $(BINARY) >> /etc/shells; \
else \
shell=$(shell grep ion /etc/shells); \
if [ $$shell != $(BINARY) ]; then \
before=$$(echo $$shell | sed 's/\//\\\//g'); \
after=$$(echo $(BINARY) | sed 's/\//\\\//g'); \
sed -i -e "s/$$before/$$after/g" /etc/shells; \
sed -i -e "s#$$shell#$(BINARY)#g" /etc/shells; \
fi \
fi
......@@ -5,12 +5,16 @@ extern crate smallvec;
use ion_shell::{flags::NO_EXEC, Binary, JobControl, ShellBuilder, MAN_ION};
use smallvec::SmallVec;
use std::{
alloc::System,
env,
error::Error,
io::{stdin, stdout, BufRead, BufReader, Write},
iter::FromIterator,
};
#[global_allocator]
static A: System = System;
fn main() {
let stdin_is_a_tty = sys::isatty(sys::STDIN_FILENO);
let mut shell = ShellBuilder::new().install_signal_handler().block_signals();
......
......@@ -24,5 +24,10 @@ git = "https://gitlab.redox-os.org/redox-os/syscall.git"
branch = "relibc"
replace-with = "vendored-sources"
[source."https://gitlab.redox-os.org/redox-os/termion"]
git = "https://gitlab.redox-os.org/redox-os/termion"
branch = "master"
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment