These are chat archives for opal/opal

18th
Aug 2015
meh.
@meh
Aug 18 2015 13:25
@elia ping
Elia Schito
@elia
Aug 18 2015 13:26
now I'm here :)
meh.
@meh
Aug 18 2015 13:26
elia, did you have time to test cherry with opal-jquery and opal-rspec?
Elia Schito
@elia
Aug 18 2015 13:27
yes, opal-jquery + the current opal-rspec release are ok
meh.
@meh
Aug 18 2015 13:27
cool
Elia Schito
@elia
Aug 18 2015 13:27
but
there's still an error with the updated (beta) opal-rspec
meh.
@meh
Aug 18 2015 13:27
does it work on master?
Elia Schito
@elia
Aug 18 2015 13:27
I tracked it down but had to stop
yep
meh.
@meh
Aug 18 2015 13:27
any way I can test it myself?
Elia Schito
@elia
Aug 18 2015 13:27
sure
opal-rspec master
but don't use rake
the current suite is a bit hackish but at least expects both successes and failures
meh.
@meh
Aug 18 2015 13:28
elia, so how do I run it?
Elia Schito
@elia
Aug 18 2015 13:29
rackup is fine
meh.
@meh
Aug 18 2015 13:29
cool
elia @elia searching for the rake task
meh.
@meh
Aug 18 2015 13:29
by the way, I think it's a bad idea to dummy freeze and taint
it will make people think they are working, when they are not
Elia Schito
@elia
Aug 18 2015 13:30
agree but I think a counscious opt-in is needed
meh.
@meh
Aug 18 2015 13:30
it should be opt-out if that was the case, but one can already opt-out by monkeypatching it if needed
Elia Schito
@elia
Aug 18 2015 13:30
I experimented with $OPAL_STUB_FREEZE etc. and naming apart seems easy and clear enough
yeah, I meant opting in to have them stubbed
meh.
@meh
Aug 18 2015 13:31
ah
ok, cool
I'll do something
Elia Schito
@elia
Aug 18 2015 13:32
oh, opal-jq passes but with the fixes above (i.e. the empty stdlib/{encoding,math})
and stubbing the unsupported methods
meh.
@meh
Aug 18 2015 13:33
yeah I already added the deprecation stuff
but you should find where it's requiring those
also what methods are causing the crashes?
freeze or dump?
Elia Schito
@elia
Aug 18 2015 13:34
freeze
meh.
@meh
Aug 18 2015 13:34
where is it using it?
Elia Schito
@elia
Aug 18 2015 13:34
meh, just a heads up, in opal-rspec the error is somewhere related to #define_example_group_method
uh dunno
meh.
@meh
Aug 18 2015 13:34
I see
I'll check it out
Elia Schito
@elia
Aug 18 2015 13:35
heads up: the ensure in the above method makes the backtrace wrong (at least in safari) due to the js finally
and also #populate_location_attributes passes a nil to Metadata.relative_path causing it to fail
I patched it locally to file_path = Metadata.relative_path(file_path.to_s)
just to keep going
hope this saves you a couple minutes :)
meh.
@meh
Aug 18 2015 13:37
with rackup I get an error
it can't find 'rspec'
Elia Schito
@elia
Aug 18 2015 13:38
git submodule update --init
meh.
@meh
Aug 18 2015 13:38
welp
Elia Schito
@elia
Aug 18 2015 13:38
maybe
meh.
@meh
Aug 18 2015 13:38
yeah
didn't know it had submodules
:D
Elia Schito
@elia
Aug 18 2015 13:38
hehe
TMYK
meh.
@meh
Aug 18 2015 13:44
elia, I just tested opal-rspec on master
it has the same issue
it fails in #populate_location_attributes for the same reason
can you verify I'm not seeing things or having cache issues please?
and yes, I'm sure I'm on opal master
I checked the source
Elia Schito
@elia
Aug 18 2015 13:48
u right
I think it passes on 0.8
meh, then green light for those awesome PRs from here :traffic_light:
whatever is broken already needs fixing and doesn't depend on the PRs
meh.
@meh
Aug 18 2015 13:53
cool
elia, I also decided it's going to be the other way around for freeze and taint
it's opt-in
mostly because shit will break, and warnings are ok
but we want them to raise when running rubyspecs
so I'm gonna add an option
Elia Schito
@elia
Aug 18 2015 13:54
fine, will check the commit once it's up
meh.
@meh
Aug 18 2015 13:56
elia, any idea where the compiler options are set up for running mspec?
Elia Schito
@elia
Aug 18 2015 13:57
we have two mspec runners
one for node and another for phantomjs
the latter integrates with sprockets
the one for node is the simpler and uses the CLI iirc
see tasks/testing.rake
meh.
@meh
Aug 18 2015 14:22
elia, check the latest cherry commit
Elia Schito
@elia
Aug 18 2015 14:30
lol, was looking at an old commit and couldn't make sense of what changed
meh, why not using a gvar, e.g. $OPAL_OPTIONS that can be controlled at runtime?
also warnings are noisy, if I explicitly tell opal I want the stub methods I'd rather prefer them to be silent
meh.
@meh
Aug 18 2015 14:40
elia, problem is, that's the default option
I'll just make them warn the first time
elia, also because the compiler options are only bound to the compilation unit
and a gvar would get overriden
Elia Schito
@elia
Aug 18 2015 14:41
so the idea is to prepare work for per file compiler flags in the future?
meh.
@meh
Aug 18 2015 14:41
compiler flags are already per file basically
except the config don't change with each file
but the compilation unit is always the file
so yeah
Elia Schito
@elia
Aug 18 2015 14:43
not sure it works as intended now
meh.
@meh
Aug 18 2015 14:43
what do you mean?
Elia Schito
@elia
Aug 18 2015 14:43
the unsupported file is a different file from rspec lib files and the check happens at runtime
also isn't the OPTIONS var bound to the closure?
meh.
@meh
Aug 18 2015 14:44
elia, it is, it is supposed to be
it's generated for each file
elia, also it doesn't really matter
the default is warning
Elia Schito
@elia
Aug 18 2015 14:44
that would make the unsupported check respect the OPTIONS they've been compiled with
meh.
@meh
Aug 18 2015 14:44
elia, yeah, that's what I wanted to do
it's a part of the runtime
Elia Schito
@elia
Aug 18 2015 14:45
compiling another file with freezing set to raise changes nothing
meh.
@meh
Aug 18 2015 14:45
elia, yeah, for now
but I have to do it like that as things stand
Elia Schito
@elia
Aug 18 2015 14:46
ok, seemed a bit overkill to have a compile option just for that
meh.
@meh
Aug 18 2015 14:46
I couldn't find any other way to access compiler options at runtime
for now it's gonna be like that
Elia Schito
@elia
Aug 18 2015 14:46
helpers maybe
that's fine, still don't like the OPTIONS preable in every module closure but it's internal
we can refine it with time I guess
it's not that noisy now
Elia Schito
@elia
Aug 18 2015 14:48
:+1:
tmp/jshint.js: line 1771, col 19, Extra comma. (it breaks older versions of IE) (W070) lol
the extra comma is too noisy! plz remove it :D
meh.
@meh
Aug 18 2015 14:50
it was the old version :)
@elia ok, check now, tested nothing broke
Elia Schito
@elia
Aug 18 2015 15:40
@meh mind if I merge? ;)
I mean cherrypicking
meh.
@meh
Aug 18 2015 15:41
I'll do it
since I have to rebase numeric-redux
Elia Schito
@elia
Aug 18 2015 15:42
:shipit:
meh.
@meh
Aug 18 2015 15:47
ok, should be good
meh.
@meh
Aug 18 2015 16:08
@elia if you can tweet about bridging-redux and cherry from the @opalrb account it could be a good idea
Elia Schito
@elia
Aug 18 2015 18:03
I removed that account a couple months ago to keep sanity but maybe it's time to give it some love : )
meh.
@meh
Aug 18 2015 18:05
lol
someone gotta do it
Complex(Float::NAN, 2)
Complex(Float::NAN, 2).fdiv(2)
=> (NaN+(1/1)*i)
=> (NaN+2i)
Complex(Float::NAN, 2) / 2
=> (NaN+1.0i)
by the gods
meh.
@meh
Aug 18 2015 22:21
@elia ~350 more passing specs since I merged my stuff
Elia Schito
@elia
Aug 18 2015 22:23
:bouquet:
I suspected that, definitely good stuff HT :tophat:
meh.
@meh
Aug 18 2015 22:24
and almost done with the reflection bullshit
method_added, method_removed, method_undefined, singleton_method_added, singleton_method_removed, singleton_method_undefined
Elia Schito
@elia
Aug 18 2015 22:25
:+1:
great, need to check the status of metaclasses to see how deep they can go
and maybe we can start talking about prepend…
meh.
@meh
Aug 18 2015 22:26
hahaha
yeah, maybe next year when I'm recharged
Elia Schito
@elia
Aug 18 2015 22:27
yeah lol
(now picturing you as the duracell :rabbit:)
meh.
@meh
Aug 18 2015 22:27
lol
Elia Schito
@elia
Aug 18 2015 22:28
wrt metaclasses I always dream about finishing up this inception implementation: https://github.com/elia/inception.rb
Elia Schito
@elia
Aug 18 2015 22:40
@meh I'm thinking about moving guides from the site repo to the opal repo and maintain them by on *-stable branches
meh.
@meh
Aug 18 2015 22:40
why not have branches in the site repo?
Elia Schito
@elia
Aug 18 2015 22:40
because it's too far
and I'm lazy
meh.
@meh
Aug 18 2015 22:41
lol
Elia Schito
@elia
Aug 18 2015 22:41
and you can commit changelog and docs updatees along with a code change
yeh :D
And I want to do the same for docs with different sets for corelib, stdlib and opal (need a better name for this, I mean the lib/ dir)
@meh :point_up: ehm, you need to add a changelog entry with the remaining charge :battery:
meh.
@meh
Aug 18 2015 22:43
yeah, I'll do that when I'm done
Elia Schito
@elia
Aug 18 2015 22:44
:+1:
meh.
@meh
Aug 18 2015 22:58
@elia there's a problem
Elia Schito
@elia
Aug 18 2015 22:58
ugh
meh.
@meh
Aug 18 2015 22:58
spec/rubyspec/core/module/fixtures/classes.rb spec/opal/core/module/fixtures/classes.rb
those two files are the same and they both get compiled in
and they collide
or more likey, there's something broken with undef_method :P
I mean, with the redefinition of undef'd methods
but I'm getting two calls to undef_method for the same class and same method name
from two different files
I don't know which of the two should be fixed
to have two files with the same contents
but it sounds like a really bad idea
Elia Schito
@elia
Aug 18 2015 23:03
uhm, so the two files have the same module path?
maybe we can just run rubyspecs and our copy separately
meh.
@meh
Aug 18 2015 23:06
it's a bug in undef too
but better fix both
elia, nope, it's not a bug in undef_method
it's the proper behavior
it's a bug in how we run things
Elia Schito
@elia
Aug 18 2015 23:10
Probably some of the once cloned rubyspec dirs can go away now
But I think running rubyspecs separately is the right thing
meh.
@meh
Aug 18 2015 23:14
well, I can't even run the specs until that's fixed
Elia Schito
@elia
Aug 18 2015 23:17
comment this line (or the following alternatively) in testing.rake:
specs = add_specs.(:shared, shared)
does that make sense? not sure I follow completely (I'm tired)
meh.
@meh
Aug 18 2015 23:20
I don't know, I've never touched those files
but it does weird things after I commented that lin
the problem is the opal/ stuff
wait actually
yeah, shared should work
now I'm starting to think it was even shadowing issues
because I'm getting a bunch of unrelated failures without the shared stuff
Elia Schito
@elia
Aug 18 2015 23:21
I see to failures keeping only rubyspecs
meh.
@meh
Aug 18 2015 23:21
what are they?
Elia Schito
@elia
Aug 18 2015 23:22
  1. StandardError is a superclass of ThreadError

    NameError: uninitialized constant Object::ThreadError


  2. Module#include does not override existing constants in modules and classes

    Expected "a" to equal "b"
meh.
@meh
Aug 18 2015 23:22
yeah, I'm seeing those too
Elia Schito
@elia
Aug 18 2015 23:22
At least it's consistent :)
meh.
@meh
Aug 18 2015 23:28
on one hand, we now have opal and rubyspecs run separately
on the other now we're down at 5903 actual rubyspecs running
Elia Schito
@elia
Aug 18 2015 23:34
well the opal/shared stuff is still valuable with its 883 passing specs
on the other hand some of them overlap with rubyspec
meh.
@meh
Aug 18 2015 23:34
yeah but we can't boast about passing 6k+ rubyspecs anymore :(
poor vais
Elia Schito
@elia
Aug 18 2015 23:34
ha! yeah
meh.
@meh
Aug 18 2015 23:34
he'll be disappoint
Elia Schito
@elia
Aug 18 2015 23:35
yep, -114
in the meanwhile was thinking about passing a SUITE env var to select the suite:
  case
  when pattern
    custom = Dir[pattern]
    custom &= rubyspecs if whitelist_pattern
    specs = add_specs.(:custom, custom)
  when ENV['SUITE'] == 'opal'
    specs = add_specs.(:shared, shared)
  when ENV['SUITE'] == 'rubyspec'
    specs = add_specs.(:rubyspecs, rubyspecs)
  else
    warn 'Please provide at lease one of the following ENV vars:'
    warn 'PATTERN # e.g. env PATTERN="spec/rubyspec/core/numeric/**_spec.rb"'
    warn 'SUITE   # can be either SUITE=opal or SUITE=rubyspec'
    exit 1
  end
the specs stuff is ugly and needs refactoring, but after all they're just runners
meh.
@meh
Aug 18 2015 23:43
let's see what travis thinks about it
he didn't like it
ah no it did
they're the shadowed failures
Elia Schito
@elia
Aug 18 2015 23:48
that needs be ported to the mspec_phantom task too and the whole travis config re-arranged
meh.
@meh
Aug 18 2015 23:48
I removed the test run from phantom
what was it for?
Elia Schito
@elia
Aug 18 2015 23:48
excercises a different code path
uses sprockets instead of Opal::Builder
it's valuable to get sprockets errors, also runs in a more real browser (phantom) instead of node
meh.
@meh
Aug 18 2015 23:51
yeah
I'll fix it back after I'm done with jshint
where does the mspec_phantom one come from?
ah, here
eeeh
no thanks :D
I'll leave that to you
Elia Schito
@elia
Aug 18 2015 23:54
yeah, lol, maybe I'll do a massive cleanup, could be much simpler actually