Comments (12)
It's because crystal-lang/crystal#7282 moved Crystal::Codegen::Target
somewhere where it's not required when doing require "compiler/crystal/crystal_path"
..
One way to fix this would be to stop requiring tiny parts of the compiler and just require everything with require "compiler/crystal/**"
but I personally don't like it..
Until then, we can require "compiler/crystal/codegen/target"
before requiring crystal_path
:
diff --git a/src/scry/completion_provider.cr b/src/scry/completion_provider.cr
index 29e0d36..f67438c 100644
--- a/src/scry/completion_provider.cr
+++ b/src/scry/completion_provider.cr
@@ -1,4 +1,5 @@
require "./log"
+require "compiler/crystal/codegen/target"
require "compiler/crystal/crystal_path"
require "./completion/*"
diff --git a/src/scry/parse_analyzer.cr b/src/scry/parse_analyzer.cr
index d87eca4..bbe9ed5 100644
--- a/src/scry/parse_analyzer.cr
+++ b/src/scry/parse_analyzer.cr
@@ -1,4 +1,5 @@
require "compiler/crystal/syntax"
+require "compiler/crystal/codegen/target"
require "compiler/crystal/crystal_path"
require "./workspace"
require "./text_document"
WDYT @crystal-lang-tools/scry ?
from scry.
Until then, we can
require "compiler/crystal/codegen/target"
before requiringcrystal_path
This doesn't seem to work for me:
➜ shards build -v
Dependencies are satisfied
Building: scry
crystal build -o /home/melvisntnormal/.cache/sources/scry/bin/scry src/scry.cr
Error target scry failed to compile:
Error in src/scry.cr:4: while requiring "./scry/context"
require "./scry/context"
^
in src/scry/context.cr:7: while requiring "./parse_analyzer"
require "./parse_analyzer"
^
in src/scry/parse_analyzer.cr:2: while requiring "compiler/crystal/codegen/target"
require "compiler/crystal/codegen/target"
^
in /usr/lib/crystal/compiler/crystal/codegen/target.cr:1: while requiring "llvm"
require "llvm"
^
in /usr/lib/crystal/llvm.cr:1: while requiring "./llvm/**"
require "./llvm/**"
^
in /usr/lib/crystal/llvm/di_builder.cr:1: while requiring "./lib_llvm"
require "./lib_llvm"
^
in /usr/lib/crystal/llvm/lib_llvm.cr:1: expanding macro
{% begin %}
^
in /usr/lib/crystal/llvm/lib_llvm.cr:4: error executing command: [ -n "$LLVM_CONFIG" ] && command -v "$LLVM_CONFIG" || command -v llvm-config-6.0 || command -v llvm-config60 || (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 6.0*) command -v llvm-config;; *) false;; esac)) || command -v llvm-config-5.0 || command -v llvm-config50 || (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 5.0*) command -v llvm-config;; *) false;; esac)) || command -v llvm-config-4.0 || command -v llvm-config40 || (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 4.0*) command -v llvm-config;; *) false;; esac)) || command -v llvm-config-3.9 || command -v llvm-config39 || (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.9*) command -v llvm-config;; *) false;; esac)) || command -v llvm-config-3.8 || command -v llvm-config38 || (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.8*) command -v llvm-config;; *) false;; esac)) || command -v llvm-config
, got exit status 1
`[ -n "$LLVM_CONFIG" ] && command -v "$LLVM_CONFIG" || \
^
from scry.
@MelvIsntNormal it works for me, so there's probably something wrong with your install.
Do you have llvm
installed? Do you have a llvm-config
program?
What's the output of this (loong) shell command:
[ -n "$LLVM_CONFIG" ] && command -v "$LLVM_CONFIG" || \
command -v llvm-config-6.0 || command -v llvm-config60 || \
(command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 6.0*) command -v llvm-config;; *) false;; esac)) || \
command -v llvm-config-5.0 || command -v llvm-config50 || \
(command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 5.0*) command -v llvm-config;; *) false;; esac)) || \
command -v llvm-config-4.0 || command -v llvm-config40 || \
(command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 4.0*) command -v llvm-config;; *) false;; esac)) || \
command -v llvm-config-3.9 || command -v llvm-config39 || \
(command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.9*) command -v llvm-config;; *) false;; esac)) || \
command -v llvm-config-3.8 || command -v llvm-config38 || \
(command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.8*) command -v llvm-config;; *) false;; esac)) || \
command -v llvm-config
from scry.
@bew thanks, turns out I didn't have LLVM, once that was installed the build worked as expected
from scry.
@bew yeah I don't think we want to include the entire compiler, we did that in the past. Here was the PR that removed it #53
Scry needs to updated to be compatible w/ 0.28.0 I think, we are only on 0.27.0, which should fix this issue (and maybe others).
from scry.
@bmulvihill require "compiler/crystal/**"
won't necessarily put the whole compiler inside scry
, it just means that all the compiler files will be made available in the global namespace (and it'll put some pressure during scry compile time also...).
And I don't like that when you only need a tiny part of the compiler (here, crystal_path
)
from scry.
I'm still hitting this on macOS and Manjaro Linux. LLVM installed, llvm-config
in path. Is there an easy fix?
Thanks!
from scry.
Same crystal version and llvm version as the OP?
Did you tried adding the lines mentioned in #155 (comment) ?
from scry.
I have the same issue compiling using 0.30 on OSX. What branch has the fix?
Error target scry failed to compile:
Showing last frame. Use --error-trace for full trace.
In /usr/local/Cellar/crystal/0.30.0/src/compiler/crystal/config.cr:37:24
37 | @@default_target : Crystal::Codegen::Target?
^-----------------------
Error: undefined constant Crystal::Codegen::Target
from scry.
@bew Can we get this fix merged? I get the same issue
from scry.
Recloning the repo and build it. The error still exists.
Crystal 0.30.1 (2019-08-13)
LLVM: 8.0.1
Default target: x86_64-apple-macosx
from scry.
@iambudi I know, I did a PR #158 but I can't get the ci to work... (no idea how to fix, and no time to debug right now)
from scry.
Related Issues (20)
- test failure with latest commit on master and crystal 0.26 HOT 5
- `flag?` crashes compiler HOT 4
- https://github.com/crystal-lang/crystal/issues/7151 HOT 6
- This library should have a set of benchmarks HOT 1
- What unit does scry use in lsp ranges HOT 1
- Extract LSP protocol to a shard? HOT 2
- Stop depending on the real stdlib for our specs
- Speedup by going full async and manage tasks intelligently HOT 1
- Debug idea: use lsp-inspector
- Prelude Error Message HOT 2
- Completion fails using Emacs and lsp-mode
- Incorrect path reference
- specs failing... HOT 1
- Is the project abandoned? HOT 4
- Fails to build with crystal 0.36 HOT 1
- Broken JSON-RPC message HOT 3
- Build failure on master branch, Crystal 1.0.0; dependency resolution problem. HOT 1
- Can't build with Crystal 1.3.2 (Error: no overload matches 'Crystal.exit' with types Int32) HOT 3
- scry starts itself up and take over 3 gigs of memory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scry.