mozilla :: #jsapi

12 Sep 2017
00:06mrgigglesthe mozilla-inbound tree is now open
04:17mrgigglesthe mozilla-inbound tree is now closed (mass bustage)
06:38mrgigglesthe mozilla-inbound tree is now open
10:13nbptjr: In C++ or masm?
10:14nbptjr: ^ sorry, outdated question related to shift having impact on the sign bit.
12:08mrgigglesthe mozilla-inbound tree is now closed (hazards and unexpected passes from bug 1359017)
12:08firebothttps://bugzil.la/1359017 NEW, amarchesini@mozilla.com Implement messageerror event
12:18mrgigglesthe mozilla-inbound tree is now open
12:19bbouvierhello world
12:20pboneHello bbouvier
14:50Yoricstandups: Starting to implement multipart binjs container encoding.
14:50standupsOk, submitted #50815 for https://www.standu.ps/user/Yoric/
15:04mrgigglesthe mozilla-inbound tree is now closed (pypi download failures for Windows buildbot jobs)
16:12nbpevilpie: "Loop unswitching was introduced in gcc in version 3.4."
16:12nbpevilpie: maybe we do not enable it by default.
16:40sfinkdoes anyone have a copy of the mozjs-45 tarball? Sadly, I didn't keep a copy of the one on my people account
17:06nbpsfink: do you still have the hashes of it? https://pkgs.org/download/mozjs45(x86-64)
17:08Yoricjorendorff: arai So, I have tried to apply all of your feedback. I'll be happy as soon as I have more reviews :)
17:08nbpsfink: you might ask the Fedora packager, if he still has it.
17:08jorendorffwill look today
17:10evilpieshould we have mozjs-52 now?
17:10sfinknbp: thanks, good thought. Though the RPM version is 45.9.0-2, as compared to the official release of 45.0.2. Probably doesn't mean anything, though.
17:10sfinkwe *should*
17:10sfinkwe probably could now
17:11sfinkI felt it was kind of too broken to release, but I think ptomato-M has fixed everything at this point
17:11sfinkbut I'm still trying to get IT to give me an upload location
17:11nbpsfink: These persons otherwise? https://patches.linaro.org/patch/71813/
17:11nbpsfink: since they have patches, they might also have a copy of the source.
17:12sfinkooh, yeah, that looks good
17:12sfinkI could check the srpm too, it might have it
17:13ptomato-Msfink: I have a copy
17:13ptomato-Mit matches the SHA on https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/45 so I assume it's the same one
17:13sfinkawesome, thanks!
17:14sfinksomebody emailed me asking for a copy, and I felt dumb for not having it
17:15ptomato-Mwhat's the best way to get it to you
17:16sfinkgood question. I miss the people server.
17:16sfinkuh... I guess email works
17:16sfinksuch a sad day when that's my best answer
17:17sfinkthe last time I needed to transfer a binary, I stuck it into one of my existing github repos and uploaded it that way :(
17:18sfinkptomato-M: do you think mozjs-52 is ready to go, other than release notes? You'd know best at this point.
17:25sfinkheh, the fedora spec file has a handful of useful patches
17:25ptomato-Msfink: indeed
17:26ptomato-Msfink: I have my patches collected here https://github.com/ptomato/mozjs/commits/mozjs52
17:26ptomato-Mbut all are now committed except for the MOZ_GLUE_IN_PROGRAM one and the 64-bit tests one
17:26ptomato-M(the latter was taken from the fedora spec file)
17:27sfinkexcellent
17:27ptomato-MI will rebase that list but I was waiting for a 52.4.0 to appear on treeherder
17:28sfinkyou don't enable ctypes, it looks like?
17:28ptomato-Mno, although some linux distros might
17:29sfinkif they do, it depends on nspr again
17:29ptomato-Myeah I think arai recently committed a patch that makes those two flags mutually exclusive
17:29sfinkyes
17:30sfinkit's a nuisance, especially since I use ctypes
17:30sfink(ctypes's usage of nspr is a nuisance, I mean)
17:31jorendorff?
17:31sfink??
17:32oddcoderhello i have a question,
17:32oddcoderI read somewhere in mozilla wiki that spidermonkey doesn't include standard Javascript apis like document.write
17:32oddcoderso where are those apis ?
17:33sfinkjorendorff: I mean that it would be nice if ctypes didn't use nspr to do its library loading, but had some stub portability code (similar to the posix stuff)
17:33jorendorffyeah
17:33sfinkbut when I looked at it, the library loading stuff was a huge hairball of platform #ifdefs
17:33jorendorffoddcoder: They're part of the DOM.
17:34ptomato-Msfink: the MOZ_GLUE_IN_PROGRAM is still a problem, without that patch from bug 1176787 it won't build
17:34firebothttps://bugzil.la/1176787 NEW, mh+mozilla@glandium.org MOZ_GLUE_IN_PROGRAM breaks static linking of SM into executables
17:34jorendorffoddcoder: I imagine document.write() ends up here: http://searchfox.org/mozilla-central/source/dom/html/nsHTMLDocument.cpp#2012
17:34oddcoderthanks alot
17:34sfinkugh, that was always the big blocker. fitzgen got around it for the rust stuff, I guess.
17:35jorendorffoddcoder: The code that gets you from JS to that C++ method is complex. dom/bindings contains the infrastructure for that.
17:36fitzgenwhen JS_STANDALONE && !MOZ_MEMORY, it works somehow
17:36oddcoderwhat do you mean by that ?
17:36oddcoderisn't is just JSAPI ?
17:36sfinkoddcoder: spidermonkey is just the JS engine. Web stuff (the DOM, including things like document) is from Gecko, which embeds spidermonkey as its JS engine.
17:37sfinkso no, document.write is not part of JSAPI
17:37oddcoderI meant it is built using js api
17:37sfinkJSAPI includes enough for an embedding to register things like document.write
17:37oddcoderso where does the complexity comes from ?
17:37evilpiewhich complexity?
17:38oddcoder>> <jorendorff> oddcoder: The code that gets you from JS to that C++ method is complex
17:39ptomato-Msfink: various linux distros are coming up with various broken ways to fix the mozglue linking issue so it would be good to fix that authoritatively in spidermonkey :-)
17:39evilpieoddcoder: that is auto generated to couple JS to C++, which is inherently complex
17:39evilpiehttps://dxr.mozilla.org/mozilla-central/source/obj-x86_64-pc-linux-gnu/dom/bindings/HTMLDocumentBinding.cpp?q=HTMLDocumentBinding.cpp&redirect_type=direct
17:40ptomato-Mlike Arch is/was shipping mozglue as a shared, unversioned library, so their libmozjs52 was linking to libmozglue from mozilla 41
17:40jorendorffoddcoder: it&#39;s not *just* JSAPI. By default, the JSAPI uses JSNative for this
17:40evilpiesome documentation https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings
17:40oddcoderaha thanks
17:41jorendorffoddcoder: a JSNative receives a JSContext and an array of Values (the arguments), and figuring out if those arguments are valid or not is the JSNative&#39;s responsibility
17:41mrgigglesthe mozilla-inbound tree is now open
17:41jorendorffand it&#39;s a lot of work, for anything significant, so we autogenerate that code
17:41oddcodersince I have 1 day experience
17:41oddcoderwhat is gecko ?
17:41oddcoder**1 day experience with the code base**
17:41jorendorffwelcome :)
17:41sfinkptomato-M: yes, it&#39;s a mess. And the people who know how to deal with it have found it difficult to deal with, at least in a way that makes sense in the context of what the firefox build system wants to do (?). I&#39;m still hoping for some simple workaround.
17:42sfinklike maybe --disable-jemalloc ? Is that enough?
17:42evilpieoddcoder: the Firefox web browser engine i.e https://en.wikipedia.org/wiki/Gecko_(software)
17:42oddcoderso building this will give me access to full firefox js Apis from terminal right ?
17:43sfinkno
17:43evilpieoddcoder: the rest of the engine does not really have a terminal
17:43evilpieyou will usually get a firefox application
17:43sfinkwhat would document.write do?
17:43oddcoderprint to terminal I assume ?
17:43sfinkwhy? That&#39;s not what it does in a web page.
17:43jorendorffwellll, that&#39;s kind of not what document.write does at all
17:44oddcoderevilpie so how would one interact with it without gui ?
17:44jorendorffyeah, exactly, right? headless gecko is pretty new, I don&#39;t know anything about it
17:44evilpiethis might be a solotuon https://developer.mozilla.org/en-US/Firefox/Headless_mode
17:44oddcoderso compiling gecko is basically equivalent to compiling whole firefox ?
17:45jorendorffyep
17:45sfinkwhat are you trying to do? It might be easier to go from that, because there&#39;s a long, long series of misconceptions you&#39;ll need to get through otherwise. (I should know, I had to get through them all myself.)
17:45* jorendorff is still full of misconceptions
17:45oddcoderI am trying to access firefox js APIs from terminal to play with them while attaching it to debugger
17:46jorendorffoddcoder: ok. what kind of debugger, GDB?
17:46oddcoderyup
17:46jorendorffgreat. (i had to ask because there&#39;s also a JS debugger0
17:46jorendorff)
17:46evilpie&quot;is it software? we probably have it somewhere in firefox&quot;
17:47jorendorffoddcoder: You&#39;ll have an easier time just building firefox and running it under the debugger
17:47jorendorffit&#39;s ... actually pretty easy these days
17:47oddcoderis it ?
17:47oddcoderit should take infinite amount of time :P ?
17:48oddcoderI thought It wouldbe faster If I build only the js engine with no browser no http(s)/ssl things at all ?
17:48ptomato-Msfink: gjs definitely has to have spidermonkey without jemalloc
17:48jorendorffnah, grab the source code, install prerequisites, make a two-line mozconfig file, then `./mach build`
17:48jorendorffthen `./mach run --debugger=gdb`
17:48ptomato-Msfink: so that would not be a problem
17:48sfinkptomato-M: that was my perception, that basically the only thing that wants to compile with --enable-jemalloc is the JS shell
17:48jorendorffmy two lines would be `ac_add_options --disable-optimize` and `ac_add_options --enable-debug`, not sure if those are the default or not
17:49oddcoderI just read they are not :P
17:49sfinkeven gecko effectively disables it, because it provides jemalooc (mozmalloc or whatever?) in libxul
17:49oddcodercan&#39;t one do it with autoconf and make ?
17:49evilpieno
17:50ptomato-Mwe have a bunch of legacy code that calls free() on strings that were allocated by spidermonkey, so I assume that jemalloc would crash badly, never tried though
17:50ptomato-Msfink: is it likely that https://bugzilla.mozilla.org/attachment.cgi?id=8903235&action=diff could be backported to esr52? it seems like it has the potential to break stuff
17:51sfinkwe&#39;ve experimented at various times with giving SM its own heap to play with, to make vulnerabilities less damaging, which would break that sort of thing too
17:51jorendorffoddcoder: projects the size of Firefox have their own build systems. I&#39;m not sure why. It seems to be the way things work
17:51oddcoderthis the code base I should be working with right ? https://github.com/mozilla/gecko-dev.git
17:51jorendorffyes
17:52oddcodergreat
17:52oddcoderwill it really re-compile rust ? :/
17:53oddcoder 0:02.26 To compile Rust language sources please install at least
17:53oddcoder 0:02.26 version 1.19.0 of the &#39;rustc&#39; toolchain and make sure it is
17:53oddcoder 0:02.26 first in your path.
17:53tcampbelloddcoder: just to double-check. what sort of APIs do you want to call? Things like console.log/print still work in the stand-alone jsshell
17:53oddcoderI was interested in learning how are they implemented in general nothing specific in mind
17:54oddcoderthe more options availabe the better it would be
17:54sfinkyou could also consider downloading a debug build from our continuous integration system and debugging that
17:54tcampbellah, then likely full browser is more interesting
17:54sfinkbut getting symbols isn&#39;t entirely straightforward, I don&#39;t think
17:54jorendorffbuilding your own is easy enough. you do need prerequisites though.
17:54tcampbellI&#39;ve never managed to success
17:54tcampbell*ignore that
17:55jorendorffoddcoder: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Linux_Prerequisites
17:55sfinkptomato-M: that seems like a tough sell. We could consider having a separate fork for spidermonkey releases.
17:56sfinkor doing the ugly, and applying patches from make-source-package.sh
17:56ptomato-Msfink: in any case I&#39;ll give that patch a try and see if it makes things work for me
17:56ptomato-Mat least we&#39;ll know if the problem will go away in esr59 :-)
17:56sfinkyeah, it looks great
17:56oddcoderthanks
17:57sfinkat some point soon, when this stuff is resolved, I&#39;d like to start doing a spidermonkey release every release, not just every esr
17:57sfink(but still do esrs too)
17:58sfinkalthough really, if that patch doesn&#39;t break everything for firefox, it should be safe
18:00sfinkmaybe I&#39;ll just request it and see what happens
18:02ptomato-Msfink: let me try it out and see if it actually fixes things though, otherwise it might be backported for nothing :-)
18:03sfinkok. I won&#39;t submit this bugzilla form until you let me know.
18:03sfink(I&#39;d try it, but I really need to be making headway on this other thing atm.)
18:06ptomato-Msfink: when does 52.4 go out btw?
18:07RyanVMroughly two weeks from now is when ESR 52.4 is being released
18:07sfinkRyanVM: ... heh
18:07RyanVMgive or take
18:07RyanVMand SM is its own thing :)
18:11ptomato-Mok, so still time :-)
18:11sfinkI wouldn&#39;t worry about time either way. We can release whenever, early and often.
18:12RyanVMsfink: regardless, the version number on ESR52 *is* going to change when we release Firefox :)
18:13sfinksure, we&#39;ll just rerelease if we already released, to provide for the warm fuzzies of matching release numbers.
18:22ptomato-Msfink: any thoughts about bug 1357593?
18:22firebothttps://bugzil.la/1357593 UNCONFIRMED, nobody@mozilla.org spidermonkey tests fail on other 64-bit architectures
18:25sfinkI see no reason not to land and backport that
18:25sfinkseems like it&#39;d be nice to detect &quot;any 64 bit&quot;, but whatever
18:26sfinksorry, I meant &quot;good to have a nicer way...&quot;
18:27oddcoderwhat is the difference between
18:27oddcoder1. Firefox for Desktop Artifact Mode
18:27oddcoder2. Firefox for Desktop
18:28sfinkyou want 2
18:28sfink1 is for when you&#39;re not touching C++ code and want to use a prebuilt firefox or something
18:28oddcoderaha thanks
18:29ptomato-Msfink: who would be a good reviewer for that patch? I guess someone who knows why those tests were skipped on amd64 in the first place :-)
18:29sfinkptomato-M: I care so little that I already marked it r=me
18:29sfink:)
18:29ptomato-Mheh
18:33ptomato-Mcould you mark it checkin-needed as well? apparently I can only do that on bugs I&#39;ve opened
18:33sfinkok
18:56oddcoderis there a way to force using pre installed clang/gcc ?
18:56oddcoderinstead of compiling its own
19:27oddcoderany idea how long can it take compiling ? I am using 2 cores (4 threads) + 8 gb ram and 8 gb swap ?
19:27oddcoderjust approx
19:28araiare you building whole firefox or js shell?
19:28mrgigglesthe mozilla-inbound tree is now closed (Build bustage)
19:29araiptomato-M: sorry, I forgot to fix the patch about ctypes/nspr
19:29oddcoderI am doing ./mach build so that sounds like whole firefox ?
19:29oddcoderI am not that much experienced
19:29araithen, maybe 30 minutes to 2 hours
19:29oddcoderok
19:45oddcoderis there a way to show progress ?
19:45oddcoderlike percentage of left to finished or at least number of modules compiled to that remaining ?
19:46araiI thought it shows rough progress at the bottom of the screen by default
19:46arainot a number tho
19:48oddcoderat bottom of screen only &quot;TIER: pre-export export compile misc libs tools&quot; is printed
19:51ptomato-Marai: thanks! I thought actually that you had already committed it
19:52ptomato-Msfink: the patch seems not to work, at least out of the box
19:54ptomato-MI get a crash in JS::detail::initWithFailureDiagnostic(), top frame of the stack is 0x0 so looks actually like some corruption going on
19:55ptomato-Mthe offending line is this one http://searchfox.org/mozilla-central/source/js/src/vm/Initialization.cpp#91
19:55ptomato-Mwhich is the same place that the folks from Arch Linux were crashing when they had mis-linked mozglue
19:58djvjjandem: have you made a bug for the boxing changes investigation?
20:00jandemdjvj: there&#39;s an older bug on file with some discussion. I&#39;m not near my laptop but I can send it later if you&#39;re unable to find it
20:18ptomato-Msfink: actually it seems to work if I explicitly configure with `--disable-jemalloc`
20:18ptomato-MI thought that was the default, but maybe it&#39;s not
20:19ptomato-MI&#39;m going to try on macosx as well, it seems like we might still need to change https://github.com/ptomato/mozjs/commit/7e6d628456af3e99ebcb9a01a27e1461585082a4#diff-4b97a1ff0cd6fa66e9a135e182fe8c4bL9
20:39oddcoderwohooo it is finally done
20:39oddcoderI thought for a moment that building firefox is like building chromium
20:39oddcoderI heard chromium could take > 1 day or so
20:51jdmwe aim for <1 day build times
20:52oddcoderthat is so amazing
20:52oddcoderI have 1 last question so I don&#39;t be spammy
20:52jdmquestions are good
20:52oddcoderis this chat room for firefox/gecko development in general
20:52oddcoderor it is just for spider monkey
20:52oddcoder?
20:52jdmthis is for spidermonkey in particular
20:53jdm#developers is general development, and then there are channels for more specific areas (like spidermonkey)
20:53oddcoderwhich one is for the dom ?
20:53jdm#content
20:53oddcoderthanks
21:01sfinkptomato-M: yes, I think you&#39;d still need to --disable-jemalloc, my reading of that patch was that it would make that do the right thing in a few more places (plus pass the option through autospider.py)
21:03ptomato-Msfink: ok, then it works on my main workstation on linux, but not yet on macosx
21:04sfink:( ok, good to know
21:04ptomato-Msfink: I think http://searchfox.org/mozilla-central/source/mozglue/build/moz.build#9 needs to be changed to parallel the change in old-configure
21:04ptomato-MI&#39;ll try that
21:36fitzgenits always the case that one of either JS_PUNBOX64 or JS_NUNBOX32 is defined, right?
21:41bzYes
21:41bzhttp://searchfox.org/mozilla-central/rev/e76c0fee79a34a3612740b33508276f4b37c3ee8/js/src/old-configure.in#867-871
21:52fitzgenbz: thanks
21:56ptomato-Msfink: with turning mozglue back into a static library on macosx, I&#39;m getting a build failure
21:56ptomato-Mthis look familiar? https://pastebin.com/68ZZUKzA
22:02ptomato-Mhere&#39;s the patches that I&#39;m currently compiling with https://github.com/ptomato/mozjs/commits/next
13 Sep 2017
No messages
   
Last message: 8 days and 7 hours ago