These are chat archives for opal/opal

18th
Aug 2015
@elia ping
Elia Schito
@elia
Aug 18 2015 13:26 UTC
now I'm here :)
elia, did you have time to test cherry with opal-jquery and opal-rspec?
Elia Schito
@elia
Aug 18 2015 13:27 UTC
yes, opal-jquery + the current opal-rspec release are ok
cool
Elia Schito
@elia
Aug 18 2015 13:27 UTC
but
there's still an error with the updated (beta) opal-rspec
does it work on master?
Elia Schito
@elia
Aug 18 2015 13:27 UTC
I tracked it down but had to stop
yep
any way I can test it myself?
Elia Schito
@elia
Aug 18 2015 13:27 UTC
sure
opal-rspec master
but don't use rake
the current suite is a bit hackish but at least expects both successes and failures
elia, so how do I run it?
Elia Schito
@elia
Aug 18 2015 13:29 UTC
rackup is fine
cool
elia @elia searching for the rake task
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 UTC
agree but I think a counscious opt-in is needed
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 UTC
I experimented with $OPAL_STUB_FREEZE etc. and naming apart seems easy and clear enough
yeah, I meant opting in to have them stubbed
ah
ok, cool
I'll do something
Elia Schito
@elia
Aug 18 2015 13:32 UTC
oh, opal-jq passes but with the fixes above (i.e. the empty stdlib/{encoding,math})
and stubbing the unsupported methods
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 UTC
freeze
where is it using it?
Elia Schito
@elia
Aug 18 2015 13:34 UTC
meh, just a heads up, in opal-rspec the error is somewhere related to #define_example_group_method
uh dunno
I see
I'll check it out
Elia Schito
@elia
Aug 18 2015 13:35 UTC
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 :)
with rackup I get an error
it can't find 'rspec'
Elia Schito
@elia
Aug 18 2015 13:38 UTC
git submodule update --init
welp
Elia Schito
@elia
Aug 18 2015 13:38 UTC
maybe
yeah
didn't know it had submodules
:D
Elia Schito
@elia
Aug 18 2015 13:38 UTC
hehe
TMYK
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 UTC
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
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 UTC
fine, will check the commit once it's up
elia, any idea where the compiler options are set up for running mspec?
Elia Schito
@elia
Aug 18 2015 13:57 UTC
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
elia, check the latest cherry commit
Elia Schito
@elia
Aug 18 2015 14:30 UTC
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
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 UTC
so the idea is to prepare work for per file compiler flags in the future?
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 UTC
not sure it works as intended now
what do you mean?
Elia Schito
@elia
Aug 18 2015 14:43 UTC
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?
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 UTC
that would make the unsupported check respect the OPTIONS they've been compiled with
elia, yeah, that's what I wanted to do
it's a part of the runtime
Elia Schito
@elia
Aug 18 2015 14:45 UTC
compiling another file with freezing set to raise changes nothing
elia, yeah, for now
but I have to do it like that as things stand
Elia Schito
@elia
Aug 18 2015 14:46 UTC
ok, seemed a bit overkill to have a compile option just for that
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 UTC
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 UTC
:+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
it was the old version :)
@elia ok, check now, tested nothing broke
Elia Schito
@elia
Aug 18 2015 15:40 UTC
@meh mind if I merge? ;)
I mean cherrypicking
I'll do it
since I have to rebase numeric-redux
Elia Schito
@elia
Aug 18 2015 15:42 UTC
:shipit:
ok, should be good
@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 UTC
I removed that account a couple months ago to keep sanity but maybe it's time to give it some love : )
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
@elia ~350 more passing specs since I merged my stuff
Elia Schito
@elia
Aug 18 2015 22:23 UTC
:bouquet:
I suspected that, definitely good stuff HT :tophat:
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 UTC
:+1:
great, need to check the status of metaclasses to see how deep they can go
and maybe we can start talking about prepend…
hahaha
yeah, maybe next year when I'm recharged
Elia Schito
@elia
Aug 18 2015 22:27 UTC
yeah lol
(now picturing you as the duracell :rabbit:)
lol
Elia Schito
@elia
Aug 18 2015 22:28 UTC
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 UTC
@meh I'm thinking about moving guides from the site repo to the opal repo and maintain them by on *-stable branches
why not have branches in the site repo?
Elia Schito
@elia
Aug 18 2015 22:40 UTC
because it's too far
and I'm lazy
lol
Elia Schito
@elia
Aug 18 2015 22:41 UTC
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:
yeah, I'll do that when I'm done
Elia Schito
@elia
Aug 18 2015 22:44 UTC
:+1:
@elia there's a problem
Elia Schito
@elia
Aug 18 2015 22:58 UTC
ugh
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 UTC
uhm, so the two files have the same module path?
maybe we can just run rubyspecs and our copy separately
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 UTC
Probably some of the once cloned rubyspec dirs can go away now
But I think running rubyspecs separately is the right thing
well, I can't even run the specs until that's fixed
Elia Schito
@elia
Aug 18 2015 23:17 UTC
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)
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 UTC
I see to failures keeping only rubyspecs
what are they?
Elia Schito
@elia
Aug 18 2015 23:22 UTC
  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"
yeah, I'm seeing those too
Elia Schito
@elia
Aug 18 2015 23:22 UTC
At least it's consistent :)
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 UTC
well the opal/shared stuff is still valuable with its 883 passing specs
on the other hand some of them overlap with rubyspec
yeah but we can't boast about passing 6k+ rubyspecs anymore :(
poor vais
Elia Schito
@elia
Aug 18 2015 23:34 UTC
ha! yeah
he'll be disappoint
Elia Schito
@elia
Aug 18 2015 23:35 UTC
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
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 UTC
that needs be ported to the mspec_phantom task too and the whole travis config re-arranged
I removed the test run from phantom
what was it for?
Elia Schito
@elia
Aug 18 2015 23:48 UTC
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
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 UTC
yeah, lol, maybe I'll do a massive cleanup, could be much simpler actually