Giter VIP home page Giter VIP logo

crystal-build's Introduction

crystal-build

Build Status Build Status codecov.io

crystal-build is an crenv plugin that provides an crenv install command.

Warning: This project has been replaced and is no longer in active development

It is being replaced by crystal-build-cr, which is a rewrite of this existing Perl codebase in Crystal. The Crystal replacement should satisfy the needs of anyone wanting to use crystal-build, so we suggest you use it instead of this repository. The rewrite is largely motivated by the previous maintainer no longer being able to maintain and find contributors for the Perl codebase. Pull requests are no longer being accepted for this repository.

Install

$ git clone https://github.com/pine/crystal-build.git ~/.crenv/plugins/crystal-build

crystal-build currently supports only download a compiled tarball.

Usage

Using crenv install with crenv

To install a Crystal version for use with crenv, run crenv install with the exact name of the version you want to install. For example,

crenv install 0.15.0

Crystal versions will be installed into a directory of the same name under ~/.crenv/versions.

To see a list of all available Crystal versions, run crenv install --list.

Special environment variables

  • CRYSTAL_BUILD_CACHE_PATH, if set, specifies a directory to use for caching downloaded package files.

Development

Tests are executed using Carton:

$ carton install
$ carton exec -- prove -r t # all
$ carton exec -- prove t/<dir>/<file>.t

Acknowledgement

Change log

  • 1.3.0 - Support FreeBSD
  • 1.2.0 - Support installing Crystal from Homebrew bottles
  • 1.1.0 - Support shards auto-install
  • 1.0.0 - First release

License

MIT License

crystal-build's People

Contributors

albertico avatar eendroroy avatar gendosu avatar maiha avatar pine avatar shimbaco avatar taylorthurlow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

crystal-build's Issues

Install failed

OS is Cent OS 6.6
cloud service is SAKURA VPS

$ cat /etc/redhat-release
CentOS release 6.6 (Final)

$ perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

$ crenv install -l
Available versions:
can't locate Archive/Tar.pm in @inc (@inc contains: /$HOME/.crenv/plugins/crystal-build/bin/../vendor/lib /$HOME/.crenv/plugins/crystal-build/bin/../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /$HOME/.crenv/plugins/crystal-build/bin/../lib/Crenv/Utils.pm line 8.
BEGIN failed--compilation aborted at /$HOME/.crenv/plugins/crystal-build/bin/../lib/Crenv/Utils.pm line 8.
Compilation failed in require at /$HOME/.crenv/plugins/crystal-build/bin/../lib/Crenv.pm line 11.
BEGIN failed--compilation aborted at /$HOME/.crenv/plugins/crystal-build/bin/../lib/Crenv.pm line 11.
Compilation failed in require at /$HOME/.crenv/plugins/crystal-build/bin/crystal-build line 15.
BEGIN failed--compilation aborted at /$HOME/.crenv/plugins/crystal-build/bin/crystal-build line 15.

show helper messages

Error: execution of command failed with code: 127: `cc -o "/home/ubuntu/.cache/crystal/home-ubuntu-.crenv-cache-0.19.4-shards-0.6.4-src-shards.cr/macro-run-_home_ubuntu_.crenv_versions__.__.__src_ecr_process.cr" "${@}"  -rdynamic  -lpcre -lgc -lpthread /home/ubuntu/.crenv/versions/0.19.4/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`

Deprecation: The build command was renamed to compile and will be removed in a future version.

$ crystal -v
Crystal 0.18.0 [25b7925] (2016-06-14)

$ crystal build
Deprecation: The build command was renamed to compile and will be removed in a future version.
Usage: crystal compile [options] [programfile] [--] [arguments]

Options:
    --cross-compile                  cross-compile
    -d, --debug                      Add symbolic debug info
    -D FLAG, --define FLAG           Define a compile-time flag
    --emit [asm|llvm-bc|llvm-ir|obj] Comma separated list of types of output for the compiler to emit
    -f text|json, --format text|json Output format text (default) or json
    -h, --help                       Show this message
    --ll                             Dump ll to .crystal directory
    --link-flags FLAGS               Additional flags to pass to the linker
    --mcpu CPU                       Target specific cpu type
    --no-color                       Disable colored output
    --no-codegen                     Don't do code generation
    -o                               Output filename
    --prelude                        Use given file as prelude
    --release                        Compile in release mode
    -s, --stats                      Enable statistics output
    --single-module                  Generate a single LLVM module
    --threads                        Maximum number of threads to use
    --target TRIPLE                  Target triple
    --verbose                        Display executed commands

Warning mesage for installation to 32-bit architecture.

Crystalは現在のところ64bit向けのバイナリしか提供していないので、32bitの環境にインストールしようとする際は warining messageとしてその旨を注記したほうがよいように思いました :)

Fix Perl tests

I've tried but I know next to nothing about Perl and I can't debug the tests. Tests seem like they're passing (sometimes?). Need to debug tests and see if they're truly passing or not.

Crystal 0.24.1 can't be installed because not in install --list

Crystal version 0.24.1 was not available in crenv install --list, as reported by me here.

@pine added it to the list.

But unfortunately is still not working, I can see it in the list, but trying to install it gives a "Version not found" error.

$ crenv install --list
...
0.23.0
0.23.1
0.24.0
0.24.1
0.24.1
$ crenv install 0.24.1
Resolving Crystal download URL by Remote Cache ... ng
Resolving Crystal download URL by GitHub ... ng
Error: Version not found

I also see it 2 times in the list.

Install 0.23.1 failed on Ubuntu 16.04

Issue from crenv/crenv#35

When I'm installing Crystal 0.23.1 with crenv (crenv/crenv@7d55d72) with crystal-build (77f9f5e), and failed on installing Shards (Error: Missing option: --link-flags).

Here's log:

~ > 2.2.1p85 > 0.22.0 > 6.10.3 > $ > crenv install 0.23.1
Resolving Crystal download URL by Remote Cache ... ng
Resolving Crystal download URL by GitHub ... ok
Downloading Crystal binary tarball ...
https://github.com/crystal-lang/crystal/releases/download/0.23.1/crystal-0.23.1-3-linux-x86_64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   625    0   625    0     0    521      0 --:--:--  0:00:01 --:--:--   522
100 18.9M  100 18.9M    0     0  2002k      0  0:00:09  0:00:09 --:--:-- 3246k
ok
Moving the Crystal directory ...ok
Checking if Shards already exists ... ng
Resolving Shards download URL ... ok
Downloading Shards tarball ...
https://github.com/crystal-lang/shards/archive/master.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   127    0   127    0     0     99      0 --:--:--  0:00:01 --:--:--    99
100 29763  100 29763    0     0  11304      0  0:00:02  0:00:02 --:--:-- 70195
ok
Building Shards ... Error: Missing option: --link-flags

Retry building Shards ... crystal: /var/cache/omnibus/src/llvm/llvm-3.8.1.src/lib/CodeGen/LexicalScopes.cpp:160: llvm::LexicalScope* llvm::LexicalScopes::getOrCreateRegularScope(const llvm::DILocalScope*): Assertion `cast<DISubprogram>(Scope)->describes(MF->getFunction())' failed.
/home/davy/.crenv/versions/0.23.1/bin/crystal: line 102: 102819 Aborted                 (core dumped) "$INSTALL_DIR/embedded/bin/crystal" "$@"
shards build faild: /home/davy/.crenv/cache/0.23.1/shards-master at /home/davy/.crenv/plugins/crystal-build/bin/../lib/CrystalBuild/Builder/Shards.pm line 33, <DATA> line 2.

Can't install force

[pine@conoha crystal-build] $ crenv install 0.7.4                                                                                                       [master]
crenv: /home/pine/.anyenv/envs/crenv/versions/0.7.4 already exists
continue with installation? (y/N) y
/home/pine/.anyenv/envs/crenv/cache
resolve: crystal-0.7.4-linux-x64
resolve by mirror: found
fetch: https://github.com/manastech/crystal/releases/download/0.7.4/crystal-0.7.4-1-linux-x86_64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   415    0   415    0     0    648      0 --:--:-- --:--:-- --:--:--   649
100 10.2M  100 10.2M    0     0  2595k      0  0:00:04  0:00:04 --:--:-- 3408k
Error: Directory not empty at /home/pine/.anyenv/envs/crenv/plugins/crystal-build/bin/../lib/Crenv.pm line 44.

Built directories can't be moved across filesystems

Issue

If the CRYSTAL_BUILD_CACHE_PATH is set to a location outside of the filesystem where CRENV_ROOT is located the move will fail.

Apparently the rename function doesn't support moves between filesystems.

Potential fix

Other options seem to be the File::Copy::Recursive module.
I would try and fix it myself, but I don't know anything about Perl.

Error message

With CRYSTAL_BUILD_CACHE_PATH set to /tmp/crystal-build

...
Moving the Crystal directory ...faild to move the Crystal directory Invalid cross-device link

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.