Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Commit

Permalink
Fix build process for deno 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmcd committed Aug 28, 2018
1 parent 28d28a4 commit 29abf5c
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 57 deletions.
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ script:
- set -e
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
- docker-compose build deno
- docker-compose run deno ./out/Default/test_cc
- docker-compose run deno ./out/Default/deno_cc foo bar
- docker-compose run deno ./out/Default/deno_cc_nosnapshot foo bar
- docker-compose run deno ./out/Default/deno meow
- docker-compose run deno ./out/Default/deno_nosnapshot meow
- docker-compose build slim
- docker-compose push deno
- docker-compose push slim
env:
global:
- secure: D9u/uHAJF1d25aD7clBEVDVgvtPH7MyETa4/YbWI9vm0d0Oh64aLPB97BRsdTf0SyuAZBMNhu0tI9E7tialElhKUmgcmFwFMCNLFtwLS9bC1AioiVCnkAL18ZYxjEu6nHkQyZrimyMSby23rquSZduCPEL9Tdl7x8hwahYwJt9ziCDhiqOLgqHDgcjfXaGsDpqWsGzFoQ6hZ47FPBG8a8DV8dpvyqcw1c5/AxuXN1ED+FVq8b8rCFATyFVU4L0PbhY3qWWV2hjKa1N8200Pb6zX+xepdjmiRsuvaGjAn1TblHTN5eIW1MCURdP7pIsvnIM064Okll9DmuGZIA265XDq0Apb7OPm8/lEJIdL2jWpQ8rEexjcuCgOr61PwqQEoLLTbGn+gPNj38WFMDNMDQ8OYtEzcykTRly5rIx6Af4OskLQbv8wmLFJyqeovhroxvZFmRPMpTTTBvw4HOhL4Ow3IiyLTG/+3OGrCSpgI5JxXmrudEEaP6eEx8krnvaw+IM11LX4JXjKuYk3Vum5msAHDdvOjO0CASs4XLAoJ9lRIIXTcda0rsDo0J6Rjeakjf6JzAFPo2tM9EDd+1LRaJD/tQIb8Fb31yWnG0gnsr6fGaUpvYyrNyQ0hHVnq49wlLoLwyUNy+UJpOOXy6+iVOepTST0BpTkHpV3NCWIB2Es=
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM maxmcd/deno:_build-cache

RUN git pull origin master
RUN ./tools/build_third_party.py
RUN gn gen out/Default/ --args='is_debug=false use_allocator="none" cc_wrapper="ccache" use_custom_libcxx=false use_sysroot=false'
RUN ccache -s
RUN ninja -C out/Default/ :all
RUN ./tools/build.py


2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

Docker images for [ry/deno](https://github.com/ry/deno)

This repo no longer containes images that can run Typescript. There is a `build-cache.Dockerfile` and a `Dockerfile` as references on how to build deno. As soon as deno is at the point where it can execute arbitrary Typescript again this repo will be updated.

If you're using this as a build reference ensure to check out the build details in deno's [.travis.yml](https://github.com/ry/deno/blob/master/.travis.yml).
42 changes: 22 additions & 20 deletions build-cache.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM phusion/baseimage

# complete ccache setup
ENV PATH="/usr/lib/ccache/:$PATH"
ENV CCACHE_SLOPPINESS=time_macros
ENV CCACHE_CPP2=yes
ENV PATH=/root/.cargo/bin:$PATH

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libgtk-3-dev \
Expand All @@ -10,27 +16,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
git \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

ENV PATH="/usr/lib/ccache/:$PATH"
RUN mkdir -p /root/.ccache/ && touch /root/.ccache/ccache.conf
ENV CCACHE_SLOPPINESS=time_macros
ENV CCACHE_CPP2=yes

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& rm -rf /var/lib/apt/lists/* \
# set up ccache
&& mkdir -p /root/.ccache/ && touch /root/.ccache/ccache.conf \
# install nodejs
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get update && apt-get install -y nodejs \
&& npm install -g yarn

RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH

RUN cd /opt/ && git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
ENV PATH=$PATH:/opt/depot_tools
&& npm install -g yarn \
# install rust
&& curl -sSf https://sh.rustup.rs | sh -s -- -y \
# deno
&& cd /opt/ && git clone https://github.com/ry/deno.git \
&& cd deno && git submodule update --init --recursive \
&& ccache -s \
&& ./tools/setup.py \
&& ./tools/build.py
# Accepts ninja build args
# https://github.com/ninja-build/ninja/blob/ca041d88f4d610332aa48c801342edfafb622ccb/src/ninja.cc#L197-L220

RUN cd /opt/ && git clone https://github.com/ry/deno.git
WORKDIR /opt/deno
RUN ./tools/build_third_party.py
RUN gn gen out/Default/ --args='is_debug=false use_allocator="none" cc_wrapper="ccache" use_custom_libcxx=false use_sysroot=false'
RUN ccache -s
RUN ninja -C out/Default/ :all

7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ services:
build:
context: .
dockerfile: ./Dockerfile
image: maxmcd/deno:deno
image: maxmcd/deno:master
slim:
build:
context: .
dockerfile: ./slim.Dockerfile
image: maxmcd/deno:slim
2 changes: 1 addition & 1 deletion example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM maxmcd/deno:slim

COPY . .

CMD deno main.ts
CMD deno ./main.ts
26 changes: 1 addition & 25 deletions example/main.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@
import * as deno from "deno";


deno.sub("echo", (ui8: Uint8Array) => {
const str = String.fromCharCode.apply(null, ui8);
console.log("Got message", str);
});

function str2ui8(str: string): Uint8Array {
const ui8 = new Uint8Array(str.length);
for (let i = 0; i < str.length; i++) {
ui8[i] = str.charCodeAt(i);
}
return ui8;
}

console.log("Before deno.pub()");
deno.pub("echo", str2ui8("hello"));
console.log("After deno.pub()");


const data = deno.readFileSync("main.ts");
const decoder = new TextDecoder("utf-8");
const json = decoder.decode(data);
console.log(json);
console.log("Hello World");
7 changes: 7 additions & 0 deletions slim.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM maxmcd/deno:master as deno_from_scratch
FROM debian:stretch-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates
WORKDIR /opt/
COPY --from=deno_from_scratch /opt/deno/out/debug/deno /usr/local/bin/
CMD ["deno"]

0 comments on commit 29abf5c

Please sign in to comment.