snowkit / sublime_flow

Sublime Text support for Haxe flow build tool
5 stars 1 forks source link

Doesn't work! (on Ubuntu 14.04 x64 & windows) #2

Closed lostfictions closed 9 years ago

lostfictions commented 9 years ago

I'm following the guide at https://underscorediscovery.github.io/flow/guide/sublimetext.html, using the sample project.flow in luxe/tests/features/draw. Completion seems to... do nothing. Opening the console, looks like there's an exception:

[flow] set flow file to /home/s/Code/haxe/luxe/tests/features/draw/project.flow
[flow] refresh info/hxml on /home/s/Code/haxe/luxe/tests/features/draw/project.flow
[flow] set build target to linux
[flow] refresh info/hxml on /home/s/Code/haxe/luxe/tests/features/draw/project.flow
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 358, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "flow in /home/s/.config/sublime-text-3/Installed Packages/sublime_flow.sublime-package", line 86, in on_query_completions
  File "flow in /home/s/.config/sublime-text-3/Installed Packages/sublime_flow.sublime-package", line 127, in completion
KeyError: 'hxml'
lostfictions commented 9 years ago

What's more, it doesn't seem like building works at all: it'll pop up an information pane at the bottom and show "Running build..." in the status bar, but nothing shows up, even with verbose toggled.

Console output:

[flow] set flow file to /home/s/Code/haxe/luxe/tests/features/draw/project.flow
[flow] refresh info/hxml on /home/s/Code/haxe/luxe/tests/features/draw/project.flow
[flow] toggle build verbose, now at True
[flow] toggle build debug, now at True
[flow] set build target to web
[flow] refresh info/hxml on /home/s/Code/haxe/luxe/tests/features/draw/project.flow
Writing file /home/s/Code/haxe/luxe/tests/features/draw/src/Main.hx with encoding UTF-8 (atomic)
Writing file /home/s/Code/haxe/luxe/tests/features/draw/src/Main.hx with encoding UTF-8 (atomic)
[flow] build haxelib run flow run web --project /home/s/Code/haxe/luxe/tests/features/draw/project.flow --debug --log 3
Running haxelib run flow run web --project /home/s/Code/haxe/luxe/tests/features/draw/project.flow --debug --log 3
<sublime_flow.commands.flow_run_build.AsyncProcess object at 0x7f195ba3fb90>
[flow] build haxelib run flow run web --project /home/s/Code/haxe/luxe/tests/features/draw/project.flow --debug --log 3
Running haxelib run flow run web --project /home/s/Code/haxe/luxe/tests/features/draw/project.flow --debug --log 3
<sublime_flow.commands.flow_run_build.AsyncProcess object at 0x7f195ba43850>

On the other hand, running haxelib run flow run web works just fine:

flow / 1.0.0-alpha.1
flow / target is web 

flow / project - searching project root /home/s/Code/haxe/luxe/tests/features/draw
flow / project - using project file /home/s/Code/haxe/luxe/tests/features/draw/project.flow
flow / build - luxe - test - draw 1.0.0 for web
flow / build - running haxe ...
flow / build - done
flow / launching luxe - test - draw 1.0.0 for web

flow / launch at http://localhost:40404, after 0.3s
Starting up http-server, serving ./ on port: 40404
(...)
ruby0x1 commented 9 years ago

Curious, can you confirm you are running Sublime Text 3?

lostfictions commented 9 years ago

Yep, I definitely am!

Tried it again on Windows -- completions seem to work, but attempting to build fails:

[flow] set build target to web
[flow] refresh info/hxml on C:\Users\s\Haxe\haxe\lib\luxe\git\tests\features\draw\project.flow
[flow] saved file for completion
[haxe completion] complete
[haxe completion] init
[haxe completion] load custom port as 6111
[haxe completion] trying to start cache server haxe:6111
[flow] restore file post completion
[flow] completion took 0.8135440349578857
Writing file /C/Users/s/Haxe/haxe/lib/luxe/git/tests/features/draw/src/Main.hx with encoding UTF-8 (atomic)
[flow] build haxelib run flow run web --project C:\Users\s\Haxe\haxe\lib\luxe\git\tests\features\draw\project.flow
Running haxelib run flow run web --project C:\Users\s\Haxe\haxe\lib\luxe\git\tests\features\draw\project.flow
<sublime_flow.commands.flow_run_build.AsyncProcess object at 0x0000001A1D075320>
[flow] build haxelib run flow run web --project C:\Users\s\Haxe\haxe\lib\luxe\git\tests\features\draw\project.flow
Running haxelib run flow run web --project C:\Users\s\Haxe\haxe\lib\luxe\git\tests\features\draw\project.flow
<sublime_flow.commands.flow_run_build.AsyncProcess object at 0x0000001A1CFB37F0>

Again, haxelib run flow run web works just fine, though.

ruby0x1 commented 9 years ago

Out of curiosity, did you at any point install hxcpp?

haxelib install hxcpp 3.1.39 or similar, as I think you might be bumping into https://github.com/underscorediscovery/flow/issues/23

lostfictions commented 9 years ago

Nope, both platforms were seeing errors right from a fresh Haxe install. The only thing I could think of that might be interfering is my preexisting Node install...?

Incidentally, I just tried slapping together my own build system and it works fine:

{
    "shell_cmd": "haxelib run flow build web --project $project_path/project.flow",
    "working_dir": "${project_path:${folder}}",
    "file_regex": "^([^\\t\\n\\r]+.hx):(\\d+): characters (\\d+)-\\d+ : ([^\\t\\n\\r]+)"
}
ruby0x1 commented 9 years ago

What I was saying is you MUST have hxcpp installed. Do you? (check with haxelib list)

lostfictions commented 9 years ago

Whoops, okay! I just installed hxcpp and restarted everything, but still no dice. (Was confused because I read that issue and tried flow info and everything seemed to work fine.)

ruby0x1 commented 9 years ago

What does haxelib run flow run linux --log 3 from CLI say with regards to state? Does it build and run as expected?

lostfictions commented 9 years ago

Huh! Yeah, that's not working. Here's the output:

s@tekkon:~/haxelib/luxe/git/tests/features/draw$ haxelib run flow run linux --log 3
flow / 1.0.0-alpha.1
flow / current platform is linux
flow / target is linux ( arch 64 )
flow / process util - running : haxelib config
flow / haxelib path /home/s/haxelib/
flow / process util - running : haxelib list

flow / running in /home/s/haxelib/luxe/git/tests/features/draw/
flow / project - searching project root /home/s/haxelib/luxe/git/tests/features/draw
flow / project - using project file /home/s/haxelib/luxe/git/tests/features/draw/project.flow
flow / project - switch to run in /home/s/haxelib/luxe/git/tests/features/draw
flow / build - luxe - test - draw 1.0.0 for linux
flow / prepare - project luxe - test - draw
flow / prepare - dependency tree ...
flow /    parsing dependencies for luxe - test - draw
flow /         -    - found dependency luxe * 
flow /      parsing dependencies for luxe
flow /         -      - found dependency snow * 
flow /        parsing dependencies for snow
flow / prepare -           snow lists no dependencies
flow /      parsing dependencies for hxcpp
flow / prepare -        hxcpp lists no dependencies
flow / prepare - dependency tree - ok
flow / paths for project { android: { project: 'project' },
  ios: { project: 'ios.project' },
  output: 'bin/linux64/',
  build: 'bin/linux64.build/',
  binary: 
   { source: 'LuxeApp',
     path: 'bin/linux64/',
     name: 'luxe_test_draw',
     full: 'bin/linux64/luxe_test_draw' },
  files: 'bin/linux64/' }
flow / prepare - project ...
flow / prepare - project - conditions ...
flow / prepare - project - conditions - ok
flow / prepare - defines ...
flow / -D linux
-D arch-64
-D desktop
-D hxcpp_static_std
-D snow_audio_openal
-D snow_input_sdl
-D snow_window_sdl
-D luxe_native
-D parcel_thread_disabled
-D snow_dynamic_link
-D snow_native
-D luxe
-D hxcpp
-D snow

flow / prepare - defines - ok
flow / prepare - project - flags ...
flow / prepare - project - flags - ok
flow / prepare - files ...
flow / prepare - files
flow / prepare - files
flow / prepare - files
flow / prepare - files
flow / prepare - files - ok
flow / prepare - project - ok
flow / bake - project luxe - test - draw

flow / -main LuxeApp
-D no-compilation
-D linux
-D arch-64
-D desktop
-D hxcpp_static_std
-D snow_audio_openal
-D snow_input_sdl
-D snow_window_sdl
-D luxe_native
-D parcel_thread_disabled
-D snow_dynamic_link
-D snow_native
-D luxe
-D hxcpp
-D snow
-cp /home/s/haxelib/luxe/git/
-cp /home/s/haxelib/hxcpp/3,1,48/
-cp /home/s/haxelib/snow/
-cp src/
-resource version@version
-resource build@build
-resource luxe/defaults/ui/tiny.ui.png@tiny.ui.png
-resource luxe/defaults/ui/tiny.button.png@tiny.button.png
-resource luxe/defaults/fonts/default.png@default.png
-resource luxe/defaults/fonts/default.fnt@default.fnt
-resource phoenix/defaults/shaders/vert.glsl@default.vert.glsl
-resource phoenix/defaults/shaders/frag.glsl@default.frag.glsl
-resource phoenix/defaults/shaders/frag.textured.glsl@default.frag.textured.glsl
-resource phoenix/defaults/shaders/frag.bitmapfont.glsl@default.frag.bitmapfont.glsl
-cp bin/linux64.build/haxe
-cpp bin/linux64.build/cpp

flow / hooks - no pre hooks
flow / no icon convert just yet for linux
flow / files - verifying ... 
flow / files - copying project files to bin/linux64/

flow /    copying /home/s/haxelib/snow/ndll/Linux64/snow.ndll to /home/s/haxelib/luxe/git/tests/features/draw/bin/linux64snow.ndll
flow /    copying /home/s/haxelib/luxe/git/tests/features/draw/assets/ to /home/s/haxelib/luxe/git/tests/features/draw/bin/linux64assets/
flow /         - copying /home/s/haxelib/luxe/git/tests/features/draw/assets/logo.png to /home/s/haxelib/luxe/git/tests/features/draw/bin/linux64/assets/logo.png

flow / files - copying build files to bin/linux64.build/

flow /    copying with template project,snow from /home/s/haxelib/luxe/git/flow/boot/LuxeApp.hx to /home/s/haxelib/luxe/git/tests/features/draw/bin/linux64.buildhaxe/LuxeApp.hx
flow / files - writing file list to bin/linux64/manifest

flow / files - done

flow / build - writing hxml to bin/linux64.build/build.hxml
flow / build - running haxe ...
flow / haxe bin/linux64.build/build.hxml
flow / process util - running : haxe bin/linux64.build/build.hxml
/usr/lib/haxe/std/neko/_std/Sys.hx:25: characters 10-28 : Broken pipe
/usr/lib/haxe/extra/haxelib_src/src/tools/haxelib/Main.hx:1371: characters 2-21 : Called from
/usr/lib/haxe/extra/haxelib_src/src/tools/haxelib/Main.hx:311: characters 5-25 : Called from
/usr/lib/haxe/extra/haxelib_src/src/tools/haxelib/Main.hx:1375: characters 2-22 : Called from
--macro:1: character 0 : Called from
Aborted
flow / build - stopping because of errors in haxe compile 
lostfictions commented 9 years ago

No, wait, I tried running the same command again and it worked -- looks like it was the same thing as underscorediscovery/flow#29 causing that error I just posted. Deeper and deeper...

lostfictions commented 9 years ago

So at this point, everything, including completions, seems to (more or less) work except the sublime_flow build system, which doesn't show any output or do anything -- the build info pane pops up blank. This happens for me both on Windows and Linux. Dropping in my own basic Sublime build target works fine, so I guess I can work around that. sublime_flow definitely seems to be launching a process, but if it's getting anything back it's not saying.

ruby0x1 commented 9 years ago

I find it rather strange that 1 person has run into this (recently), I myself test/work on ubuntu x64 14.04 and haven't had any troubles - I'll check and see if it's up to date and see if there is anything weird/new, but countless people are using it on Windows and linux that I know of to good effect.

I wonder if it's permissions related? Though that won't really be a windows thing. Another idea is to start sublime from the terminal such that it's internal log output is visible (although console would show this I think? I have debugged something through terminal started versions of sublime) and see if anything stands out.

lostfictions commented 9 years ago

Yeah -- sorry for being so troublesome! Yesterday was my first day using Haxe in earnest, so it's totally possible I'm doing something silly here. For what it's worth, as soon as I have some time I'll poke at flow_run_build.py and see if I can't get it to be a bit more informative.

This is totally no longer a blocking issue for me anymore, so feel free to close it if that's easier -- I can always reopen if I find something new.

anissen commented 9 years ago

The Broken pipe error only occurs when building using hxcpp so for your standard code/build/test work process you might want to build to web instead (it also builds magnitudes faster).

Simply run haxelib run flow run web (flow run web if you've added flow as a symlink'ed shortcut) or set up Sublime Text 3 to target web instead of native (Ctrl+0 to change flow settings).

ruby0x1 commented 9 years ago

It's no big deal @lostfictions I prefer to root out any potential bugs that are hiding around, it's (as ever) just tricky remote debugging something obscure like this. I am happy to try figure it out though.

ruby0x1 commented 9 years ago

@nadako has also encountered this on windows, still to no clear reasoning :/

lostfictions commented 9 years ago

That's a shame!

To be honest, random errors with no clear reasoning are what made me give up on trying to use Haxe for anything, at least for now. For a statically-typed language with a fairly complex type system, compilation errors are frustratingly vague and ambiguous, and documentation is remarkably sparse. (I actually discovered a bunch of new syntax that doesn't seem to be documented anywhere just by browsing one of @ncannasse's personal game jam repos, which was a worrisome sign.)

(Contrast this with, say, Rust -- it's also a statically-typed language with an advanced type system, but they've made it a top priority to have descriptive, helpful error messages to match. They've also made documentation a first-class entity -- notice how the top header on their site has both Docs (Nightly) and Docs (Alpha)? It's right in their pipeline.)

In general I've also found the Haxe community at large to be pretty fragmented, without many reliable sources of practical nuts-and-bolts info. (Doesn't help that the Haxe Foundation seems to have shuttered its forums at some point at switched to something else without migrating any of the old posts.)

Anyway, sorry to rant -- I just really wanted Haxe to work for me, and it hasn't. I should note that the Snowkit community's been really friendly and helpful where nobody else seemed to be, but it's been the exception in this regard.

ncannasse commented 9 years ago

@lostfictions I would be happy if you report me which syntax I'm using which are not documented, so I can make sure they become so :)

If you're looking help from the Haxe community, the best place have always been either the IRC channel or the Google Group "haxelang"

Also, it seems the issue you're experiencing is quite flow-specific.

lostfictions commented 9 years ago

It was a little while back so I don't remember everything, but the first thing that jumped out at me was import aliasing, like import x in y.

I just googled around for a few minutes and it looks like this actually is documented after all -- but just like a lot of critical Haxe documentation, it lives on old.haxe.org and is thus pretty hard to find unless you somehow already know it exists.

ruby0x1 commented 9 years ago

This discussion is unrelated to the flow issue, so hopefully won't take up much of the space here. I do also find it odd that in is not documented on the manual yet. Luckily anybody can contribute to the manual, so the community can help the team resolve these type of stragglers in the new (significantly better) manual.

I have an article in draft that mentions some of this around haxe that you may want to keep an eye out for, it especially mentions the fact that the foundation and team are working hard, and have consistently improved things year after year since I entered the community (~2011). I can't speak for your experience specifically, but the documentation, features, and consistently taking feedback seriously has me feeling pretty confident in the haxe eco system overall - even if there are things to be desired along the way. I mean, you got a reply from Nicolas within half an hour, curious about the experience to see these things resolved.

The second key component in all of this is us, the community. As much as people like to sidestep open source facts, contributions (including this type of feedback!) are critical to any project continuing to get better for the users/developers. I suspect with that feedback at the time would have had the documentation amended in short time.

This is my perspective of course, I'm not dismissing your experience at all, but my experience is that things are massively trending upward and with the communities help these type of concerns fall away pretty quickly.

We, the community, can make a lot of difference by putting in the time. Case in point :

I should note that the Snowkit community's been really friendly and helpful where nobody else seemed to be, but it's been the exception in this regard.

Much appreciated :)

nadako commented 9 years ago

I do believe that in is not documented intentionally because it's just wrong english. :) Current haxe actually supports as importing which indeed should be documented (with trivia noting that it was in before).

ruby0x1 commented 9 years ago

Back to the issue at hand:

I managed to reproduce this behaviour on Mac by running against the Dev Channel of ST3.

That is: Works Stable Channel, Build 3065 Doesn't work Dev Channel, Build 3069

The good part : I can debug it from my end now as it's reproducible.

anissen commented 9 years ago

That is: Works Stable Channel, Build 3065 Doesn't work Dev Channel, Build 3069

That seems odd as I've also encountered this issue using flow directly from the command line (related: https://github.com/underscorediscovery/flow/issues/29).

ruby0x1 commented 9 years ago

You can't get this behaviour from cli, this is very localized to sublime text. The broken pipe isn't even related to this, this is a sublime text issue that's 100% predictable, and just does not work at all on dev channel. Not once, not sporadically, it just quietly dies somewhere after trying to execute the command.

If you are seeing flow just sit doing nothing report that as a separate bug, they are not related. I am hesitant to just draw connections here where none exists, the broken pipe is a flow specific issue, this is sublime specific.