Giter Club home page Giter Club logo

popsicle's Introduction

Popsicle 🍧

Build Status

Popsicle creates toolchain tarballs for Icecream (also known as IceCC).

If you have ever been frustrated by the slowness and feebleness of the icecc-create-env script included as part of Icecream, then Popsicle is for you:

  • Popsicle is smart enough to detect compilers that point to ccache, and it will figure out by itself where to find the actual location of the program.
  • Generated toolchain tarballs will be cached and reused. When any file from the tarball is changed (or any of its dependencies), it will be recreated on demand.
  • The popsicle program is stand-alone and does not have external dependencies other than the compilers it will package.

Both GCC and Clang are supported.

Building

You will need a stable version of the Rust compiler and tools, including Cargo:

git clone https://github.com/aperezdc/popsicle && cd $_
cargo build --release

Using

Popsicle assembles and caches a tarball with all the tools needed for compilation, including —but not limited to— the dependency libraries. Generated tarballs will be cached under $XDG_CACHE_HOME (typically ~/.cache), and reused whenever possible:

aperez@momiji ~ % popsicle gcc
/home/aperez/.cache/popsicle/gcc/gcc-7.2.0.tar.gz

As shown above, the full path to the toolchain tarball is printed. The output from Popsicle can be used to set $ICECC_VERSION directly:

# Create a toolchain tarball (if needed) and get its location.
export ICECC_VERSION=$(popsicle gcc)

# Now compile some big project.
PATH="/usr/lib/ccache:${PATH}" CCACHE_PREFIX=/usr/bin/icecc make CC=gcc -j50

This is indeed the kind of usage for which Popsicle was designed.

Licensing

Distributed under the terms of the MIT license.

popsicle's People

Contributors

aperezdc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

leftybc

popsicle's Issues

Include IceCC's compilerwrapper binary

From compilerwrapper.cpp:

/*
Older icecream versions assume the compiler is always GCC. This can
be fixed on the local side, but remote nodes would need icecream upgrade.
As a workaround icecc-create-env includes this wrapper binary in the environment
if clang is to be used as well, that will either call clang or the real gcc.
Which one depends on an extra argument added by icecream.
*/

While not strictly needed with newer version of IceCC, it would be good to include it in the same way as icecc-create-env does to ensure compatibility of the generated tarballs with older IceCC versions.

Propagate errors from compiler_binaries() outwards

The compiler_binaries() function (including the _clang / _gcc variants) do not propagate errors upwards, and will panic! on certain errors. Returning the errors would allow for better reporting and (potentially) recovery.

Checksums should be done over the tarball contents

Currently the checksum used to determine whether a new tarball is needed is done over the contents of the scanned executables, but this does not take into account other data added to the tarball symbolic links or text files.

While the current approach works decently, when something in the Popsicle code changes, the cache will be considered to be valid, when it might not.

popsicle doesn't seem to support relative paths

$ ~/git/popsicle/target/release/popsicle ./src/third_party/llvm-build/Release+Asserts/bin/clang
Error: cannot find external program: "./src/third_party/llvm-build/Release+Asserts/bin/clang"
$ ~/git/popsicle/target/release/popsicle `pwd`/src/third_party/llvm-build/Release+Asserts/bin/clang
$HOME/.cache/popsicle/clang/clang-6.0.0.tar.gz

The pointed clang is a normal binary file:

$ file ./src/third_party/llvm-build/Release+Asserts/bin/clang
clang: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, stripped

Old compiler tarballs are not removed

Today I updated to Clang 5.0.0 from version 4.0.1, and after running Popsicle once, the cache directory looks as follows:

% ls -l ~/.cache/popsicle/clang/
total 93448
-rw-r--r-- 1 aperez aperez       64 sep 14 10:43 checksum
-rw-r--r-- 1 aperez aperez 46277102 sep 13 20:20 clang-4.0.1.tar.gz
-rw-r--r-- 1 aperez aperez 49399653 sep 14 10:43 clang-5.0.0.tar.gz
-rw-r--r-- 1 aperez aperez        5 sep 14 10:43 compiler-version
% cat ~/.cache/popsicle/clang/compiler-version 
5.0.0
%

In one hand, checksumming did correctly detect the need to generate a new tarball, but the old clang-4.0.1.tar.gz one was left behind.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.