text1
stringlengths 0
536k
| text2
stringlengths 0
536k
| label
int64 0
1
|
---|---|---|
<p dir="auto">The waypoint throws an error asking you to make sure your li element has a closing tag even though all of them do. The reason for this error is really the fact that the element has a class assigned to it. I read the waypoint instructions as saying to replace the </p><p dir="auto"> elements with </p><li> elements but keep the class. Maybe consider creating an additional check/error for </li><li> elements with classes assigned to them.<p dir="auto"></p>
<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-create-a-bulleted-unordered-list" rel="nofollow">Waypoint: Create a Bulleted Unordered List</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<a href="#"><img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat"></a>
<ul>
<li>Click here for <a href="#">cat photos</a>.</li>
<li class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</li>
<li class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</li>
</ul>
"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">link</span> <span class="pl-c1">href</span>="<span class="pl-s">http://fonts.googleapis.com/css?family=Lobster</span>" <span class="pl-c1">rel</span>="<span class="pl-s">stylesheet</span>" <span class="pl-c1">type</span>="<span class="pl-s">text/css</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">style</span><span class="pl-kos">></span>
.<span class="pl-c1">red-text</span> {
<span class="pl-c1">color</span><span class="pl-kos">:</span> red;
}
<span class="pl-ent">h2</span> {
<span class="pl-c1">font-family</span><span class="pl-kos">:</span> Lobster<span class="pl-kos">,</span> Monospace;
}
<span class="pl-ent">p</span> {
<span class="pl-c1">font-size</span><span class="pl-kos">:</span> <span class="pl-c1">16<span class="pl-smi">px</span></span>;
<span class="pl-c1">font-family</span><span class="pl-kos">:</span> Monospace;
}
.<span class="pl-c1">thick-green-border</span> {
<span class="pl-c1">border-color</span><span class="pl-kos">:</span> green;
<span class="pl-c1">border-width</span><span class="pl-kos">:</span> <span class="pl-c1">10<span class="pl-smi">px</span></span>;
<span class="pl-c1">border-style</span><span class="pl-kos">:</span> solid;
<span class="pl-c1">border-radius</span><span class="pl-kos">:</span> <span class="pl-c1">50<span class="pl-smi">%</span></span>;
}
.<span class="pl-c1">smaller-image</span> {
<span class="pl-c1">width</span><span class="pl-kos">:</span> <span class="pl-c1">100<span class="pl-smi">px</span></span>;
}
<span class="pl-kos"></</span><span class="pl-ent">style</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h2</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">></span>CatPhotoApp<span class="pl-kos"></</span><span class="pl-ent">h2</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">a</span> <span class="pl-c1">href</span>="<span class="pl-s">#</span>"<span class="pl-kos">></span><span class="pl-kos"><</span><span class="pl-ent">img</span> <span class="pl-c1">class</span>="<span class="pl-s">smaller-image thick-green-border</span>" <span class="pl-c1">src</span>="<span class="pl-s">https://bit.ly/fcc-relaxing-cat</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">a</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">ul</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>Click here for <span class="pl-kos"><</span><span class="pl-ent">a</span> <span class="pl-c1">href</span>="<span class="pl-s">#</span>"<span class="pl-kos">></span>cat photos<span class="pl-kos"></</span><span class="pl-ent">a</span><span class="pl-kos">></span>.<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">></span>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">></span>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">ul</span><span class="pl-kos">></span></pre></div></li> | <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/13215331/9533172/92f6c0f8-4d10-11e5-9d5f-42d2c99f1ba3.png"><img width="983" alt="screen shot 2015-08-27 at 23 07 53" src="https://cloud.githubusercontent.com/assets/13215331/9533172/92f6c0f8-4d10-11e5-9d5f-42d2c99f1ba3.png" style="max-width: 100%;"></a></p>
Challenge http://freecodecamp.com/challenges/waypoint-create-a-bulleted-unordered-list has an issue. Please describe how to reproduce it, and include links to screenshots if possible. | 1 |
<p dir="auto"><em>Please make sure that this is a build/installation issue. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS 10.13</li>
<li>TensorFlow installed from (source or binary): source</li>
<li>TensorFlow version: v1.13.1</li>
<li>Python version: 3.6.7</li>
<li>Installed using virtualenv? pip? conda?: conda</li>
<li>Bazel version (if compiling from source): 0.19.2</li>
<li>GCC/Compiler version (if compiling from source): Apple LLVM version 9.1.0 (clang-902.0.39.2)</li>
<li>CUDA/cuDNN version: 10/7.4.2.24</li>
<li>GPU model and memory: GTX 1060</li>
</ul>
<p dir="auto"><strong>Describe the problem</strong><br>
I am unable to build a static version of tensorflow as described for a solution to:</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="367620400" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/22810" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/22810/hovercard?comment_id=433225466&comment_type=issue_comment" href="https://github.com/tensorflow/tensorflow/issues/22810#issuecomment-433225466">#22810 (comment)</a></p>
<p dir="auto"><strong>Provide the exact sequence of commands / steps that you executed before running into the problem</strong></p>
<p dir="auto">Trying to use tensorflow/contrib/cmake results in a number of errors</p>
<p dir="auto"><strong>Any other info / logs</strong><br>
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.</p>
<p dir="auto">Can you describe the approach to creating a static version of the libraries needed for the following headers:</p>
<p dir="auto">#include <tensorflow/core/platform/init_main.h><br>
#include <tensorflow/core/public/session.h><br>
#include <tensorflow/core/framework/tensor_shape.h></p>
<p dir="auto">To link against my software?</p>
<p dir="auto">Or alternatively solve this issue:</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="367620400" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/22810" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/22810/hovercard" href="https://github.com/tensorflow/tensorflow/issues/22810">#22810</a></p>
<p dir="auto">Dated in October of last year.</p>
<p dir="auto">Static linking seems to be doable.</p> | <p dir="auto">I tried the tensorflow demo for android and it looks really promising, but there is a big problem, every time I completely cover the camera my cellphone will horribly crash and reboot, which has never happened to me, I have never encountered an error in an application that will reboot my phone completely, so in order to take this into production I have to find the reason for this, and try to fix it, I hope someone here can provide some guidance or feedback as to why this is happening, it might be that the app is working too hard, but still it would be weird for the whole phone to crash, the scenario is like this, the app is working fine and then when I cover the camera with my finger it will recognize a nematode and immediately crash, any comments would be appreciated, I wonder if anybody else has run into this issue, my cellphone is a samsung galaxy s6 by the way.</p> | 0 |
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-bring-your-javascript-slot-machine-to-life" rel="nofollow">http://www.freecodecamp.com/challenges/waypoint-bring-your-javascript-slot-machine-to-life</a> has an issue. When entering the three lines required for the code to execute:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" $($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);"><pre class="notranslate"><code class="notranslate"> $($(".slot")[0]).html(slotOne);
$($(".slot")[1]).html(slotTwo);
$($(".slot")[2]).html(slotThree);
</code></pre></div>
<p dir="auto">If you use single quotes (') instead of double (") the code will pass, but the grader will fail you for:</p>
<p dir="auto"><code class="notranslate">You should have used the the selector given in the description to select each slot and assign it the value of slotOne, slotTwo and slotThree respectively</code></p> | <p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/6ff9592d9504972d8aa6038ff3abe50cda5bdcb50736577f6d95f1a6b2a5bf2a/68747470733a2f2f7777772e657665726e6f74652e636f6d2f6c2f41723859493051787339704c4c34454f7852445f6b562d734649467161475a56494967422f696d6167652e706e67"><img src="https://camo.githubusercontent.com/6ff9592d9504972d8aa6038ff3abe50cda5bdcb50736577f6d95f1a6b2a5bf2a/68747470733a2f2f7777772e657665726e6f74652e636f6d2f6c2f41723859493051787339704c4c34454f7852445f6b562d734649467161475a56494967422f696d6167652e706e67" alt="" data-canonical-src="https://www.evernote.com/l/Ar8YI0Qxs9pLL4EOxRD_kV-sFIFqaGZVIIgB/image.png" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">i have it set to false but format replaces tabs with spaces and there is no tabify command to repair it? thanks</p> | <p dir="auto"><em>From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/TJSoftware/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/TJSoftware">@TJSoftware</a> on January 29, 2016 17:35</em></p>
<h5 dir="auto">Summary</h5>
<p dir="auto">I am unable to format code for <code class="notranslate">xml</code> and <code class="notranslate">c#</code>. <code class="notranslate">json</code> and <code class="notranslate">javascript</code> do not have any issues.</p>
<h5 dir="auto">What I have done</h5>
<p dir="auto">Originally I modified my <code class="notranslate">editor.tabSize</code> to be 2 (in workspace). I removed this override and just left in the defaults. I also overwrote the keybinding for <code class="notranslate">editor.action.format</code> to use <code class="notranslate">ctrl+k ctrl+d</code>. I also removed those and left just the default in. Working with test files of each type mentioned above I am able to format some file types, but not others. This does not seem to be dependent on any of my settings, I have just added that information in just in case it is relevant.</p>
<h5 dir="auto">C# example - what I expect</h5>
<p dir="auto">The following screenshot the brackets should line up in MyClass.</p>
<p dir="auto">In this case while the tab size is set to 2 I would also expect that <code class="notranslate">MyClass</code> would be moved left to adjust to the correct tab size.</p>
<p dir="auto">Officially the starting bracket would be on the same line as the class definition for my company policy, but I do not see that option available. Bonus points if you can mention how to set this in <code class="notranslate">VSCode</code>. <code class="notranslate">VS Enterprise</code> was able to do this with just a checkbox in settings, I am ok with a bool in json, I just do not see the value anywhere.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4823412/12682728/4263c060-c672-11e5-9958-4dd9f3aa1900.png"><img src="https://cloud.githubusercontent.com/assets/4823412/12682728/4263c060-c672-11e5-9958-4dd9f3aa1900.png" alt="image" style="max-width: 100%;"></a></p>
<h5 dir="auto">XML example - what I expect</h5>
<p dir="auto">Here I expect that <code class="notranslate">subLevel3</code> would be tabbed in to whatever the current tab setting is.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4823412/12682872/0b85cc90-c673-11e5-8e65-b870065e79d8.png"><img src="https://cloud.githubusercontent.com/assets/4823412/12682872/0b85cc90-c673-11e5-8e65-b870065e79d8.png" alt="image" style="max-width: 100%;"></a></p>
<h5 dir="auto">Tech Specs</h5>
<p dir="auto">Windows 10 Pro<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4823412/12682585/71c74e0e-c671-11e5-97c0-46db54335eea.png"><img src="https://cloud.githubusercontent.com/assets/4823412/12682585/71c74e0e-c671-11e5-97c0-46db54335eea.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><em>Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="129833316" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/2554" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/2554/hovercard" href="https://github.com/microsoft/vscode/issues/2554">microsoft/vscode#2554</a></em></p> | 1 |
<p dir="auto">This is a feature request.<br>
Can we have variable-sized (non-square) GridView widgets? E.g. the example from <a href="https://docs.flutter.io/flutter/widgets/GridView-class.html" rel="nofollow">https://docs.flutter.io/flutter/widgets/GridView-class.html</a>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="new GridView.count(
primary: false,
padding: const EdgeInsets.all(20.0),
crossAxisSpacing: 10.0,
crossAxisCount: 2,
children: <Widget>[
const Text('He\'d have you all unravel at the'),
const Text('Heed not the rabble'),
const Text('Sound of screams but the'),
const Text('Who scream'),
const Text('Revolution is coming...'),
const Text('Revolution, they...'),
],
)"><pre class="notranslate"><code class="notranslate">new GridView.count(
primary: false,
padding: const EdgeInsets.all(20.0),
crossAxisSpacing: 10.0,
crossAxisCount: 2,
children: <Widget>[
const Text('He\'d have you all unravel at the'),
const Text('Heed not the rabble'),
const Text('Sound of screams but the'),
const Text('Who scream'),
const Text('Revolution is coming...'),
const Text('Revolution, they...'),
],
)
</code></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/3357543/34391314-a3782fdc-eaf9-11e7-8263-c8bcddf4c08e.png"><img width="311" alt="screen shot 2017-12-27 at 11 32 21 am" src="https://user-images.githubusercontent.com/3357543/34391314-a3782fdc-eaf9-11e7-8263-c8bcddf4c08e.png" style="max-width: 100%;"></a></p>
<p dir="auto">This results in a lot of extra space below the text, since each grid item is square. It would be neat to set the height of each grid item. The simplest would be to set all the grid items to the same height. But we could envision the height being determined based on the height of the child widgets.</p>
<p dir="auto">We could use a Wrap widget to have child widgets of variable heights, but then there is no scrolling.</p> | <p dir="auto">We should consider adding a sliver wrap widget. This widget would function like the Wrap widget, but support scrolling.</p>
<p dir="auto">SliverGrid currently relies on users specifying a fixed cross axis count, or a max extent for the cross axis. Further, the only layout we support (SliverGridRegularTileLayout) assumes that the items in the grid are all the same size as well as evenly spaced.</p>
<p dir="auto">Adding a SliverWrap widget could provide a lot more flexibility for users' layouts.</p> | 1 |
<p dir="auto">I have a form type that incorporates another form type.</p>
<p dir="auto">I've added an event-listener to the sub-form but the listener is never executed.</p>
<p dir="auto">The first Form Type :</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class AFormType extends AbstractType {
public function buildForm(FormBuilderInterface $builder, array $options) {
$builder
->add('aSubFormType', new SubFormType());
}
//[...]
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">AFormType</span> <span class="pl-k">extends</span> <span class="pl-v">AbstractType</span> {
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">buildForm</span>(<span class="pl-smi"><span class="pl-smi">FormBuilderInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>builder</span>, <span class="pl-smi">array</span> <span class="pl-s1"><span class="pl-c1">$</span>options</span>) {
<span class="pl-s1"><span class="pl-c1">$</span>builder</span>
-><span class="pl-en">add</span>(<span class="pl-s">'aSubFormType'</span>, <span class="pl-k">new</span> <span class="pl-v">SubFormType</span>());
}
<span class="pl-c">//[...]</span>
}</pre></div>
<p dir="auto">The second Form Type :</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class SubFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add("metier", "text");
$builder->addEventListener(
\Symfony\Component\Form\FormEvents::PRE_SET_DATA,
function(\Symfony\Component\Form\FormEvent $event){
// Some Stuff never executed
});
}
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">SubFormType</span> <span class="pl-k">extends</span> <span class="pl-v">AbstractType</span>
{
<span class="pl-k">public</span> <span class="pl-k">function</span> <span class="pl-en">buildForm</span>(<span class="pl-smi"><span class="pl-smi">FormBuilderInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>builder</span>, <span class="pl-smi">array</span> <span class="pl-s1"><span class="pl-c1">$</span>options</span>)
{
<span class="pl-s1"><span class="pl-c1">$</span>builder</span>-><span class="pl-en">add</span>("<span class="pl-s">metier</span>", "<span class="pl-s">text</span>");
<span class="pl-s1"><span class="pl-c1">$</span>builder</span>-><span class="pl-en">addEventListener</span>(
\<span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Form</span>\<span class="pl-v">FormEvents</span>::<span class="pl-c1">PRE_SET_DATA</span>,
<span class="pl-k">function</span>(<span class="pl-smi"><span class="pl-smi">\<span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Form</span>\<span class="pl-v">FormEvent</span></span></span> <span class="pl-s1"><span class="pl-c1">$</span>event</span>){
<span class="pl-c">// Some Stuff never executed</span>
});
}
}</pre></div>
<p dir="auto">I don't know if this behaviour is the right or if this is a bug? And how I can use EventListner in sub-form ?</p> | <p dir="auto">Hi @bschussek</p>
<p dir="auto">I'm having an issue since I've updated my code to Symfony v2.3.1, I have an embed form defined as virtual and neither <code class="notranslate">FormEvents::PRE_SET_DATA</code> event nor <code class="notranslate">setData</code> method are called anymore.</p>
<p dir="auto">I wrote a test to be more explicit on the problem I have: <a href="https://gist.github.com/jeremyb/5764427">https://gist.github.com/jeremyb/5764427</a>. I ran this test on the Symfony 2.2 and 2.3 branches and I think there's a regression on <code class="notranslate">testVirtualAndEvents</code>.</p>
<table role="table">
<thead>
<tr>
<th>Test</th>
<th>2.2</th>
<th>2.3</th>
</tr>
</thead>
<tbody>
<tr>
<td>testVirtual</td>
<td>success</td>
<td>success</td>
</tr>
<tr>
<td>testVirtualWithCountry</td>
<td>fails</td>
<td>fails</td>
</tr>
<tr>
<td>testVirtualAndEvents</td>
<td>success</td>
<td>fails</td>
</tr>
</tbody>
</table>
<p dir="auto">I'm trying to understand the differences made on Form component between 2.2 and 2.3 and I see some PR that can be related to this issue:</p>
<ul dir="auto">
<li>I would have thought that PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="9705925" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/6573" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/6573/hovercard" href="https://github.com/symfony/symfony/pull/6573">#6573</a> fixes the <code class="notranslate">setData</code> call for virtual forms but it seems that it's not the case and the latest comment of <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Strate/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Strate">@Strate</a> confirms that ;</li>
<li>the PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="13765895" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/7878" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/7878/hovercard" href="https://github.com/symfony/symfony/pull/7878">#7878</a> introduces the <code class="notranslate">auto_initialize</code> option, so the <code class="notranslate">setData</code> isn't called anymore on children if I understand it correctly?</li>
</ul>
<p dir="auto">So I think my problem comes from the fact that <code class="notranslate">setData</code> isn't called for virtual forms and because <code class="notranslate">auto_initialize</code> prevents initialization of children (according to this the exception <code class="notranslate">Automatic initialization is only supported on root forms.</code>), so without initialization and data the <code class="notranslate">FormEvents::PRE_SET_DATA</code> event isn't called anymore. Is this correct?</p>
<p dir="auto">I'm not sure whether it's a bug or an evolution of the Form component but is there a new way to do this kind of code and adapt the behavior of a virtual form from the data?</p>
<p dir="auto">Let me know if you want me to commit my <code class="notranslate">FormVirtualTest.php</code> test somewhere, I can do a PR to your symfony fork if you want.</p> | 1 |
<p dir="auto">Hello everyone. I have some issues that i can't find in the internet. I have two screen on the extends mode and i want to change it in the electron on duplicate mode in time. Does electron has this properties.</p> | <p dir="auto">I do not know whether this is a bug or just not installed dependencies. Code:<br>
home/gs/Рабочий стол/PROECT/image_editor/node_modules/electron/dist/electron: /lib/i386-linux-gnu/libdbus-1.so.3: no version information available (required by /home/gs/Рабочий стол/PROECT/image_editor/node_modules/electron/dist/electron)<br>
/home/gs/Рабочий стол/PROECT/image_editor/node_modules/electron/dist/electron: /lib/i386-linux-gnu/libdbus-1.so.3: no version information available (required by /home/gs/Рабочий стол/PROECT/image_editor/node_modules/electron/dist/electron)</p> | 0 |
<p dir="auto">For example, we have interface</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="interface A {
a: string;
b: number;
c: string;
d: number;
//etc
}"><pre class="notranslate"><span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
<span class="pl-c1">a</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-c1">b</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-c1">c</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-c1">d</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-c">//etc</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">and we want interface which contains all members except <code class="notranslate">{c: string}</code> and includes</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
f: number;
}"><pre class="notranslate"><span class="pl-kos">{</span>
f: <span class="pl-s1">number</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Ofcource we can split interface A, but, for example, this interface stored in another npm package.</p>
<p dir="auto">Another example</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
interface BemProps {
modifications?: Array<{
[index: string]: boolean;
} | string>;
prefix?: string;
additionalClasses?: string;
}
// we want to pass all HTMLButtonElement valid props except className
// for set className we use bem.
function UiButton(props: BemProps & React.HTMLProps<HTMLButtonElement>) {
return (
<button disabled className={GetBEMClassNames(props) } {...props}>
{props.children}
</button>
);
}"><pre class="notranslate"><span class="pl-s1">interface</span> <span class="pl-v">BemProps</span> <span class="pl-kos">{</span>
<span class="pl-s1">modifications</span>?: <span class="pl-v">Array</span><span class="pl-c1"><</span><span class="pl-kos">{</span>
<span class="pl-kos">[</span><span class="pl-s1">index</span>: <span class="pl-s1">string</span><span class="pl-kos">]</span>: <span class="pl-s1">boolean</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-c1">|</span> <span class="pl-s1">string</span><span class="pl-c1">></span><span class="pl-kos">;</span>
<span class="pl-s1">prefix</span>?: <span class="pl-s1">string</span><span class="pl-kos">;</span>
<span class="pl-s1">additionalClasses</span>?<span class="pl-s1"></span>: <span class="pl-s1">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// we want to pass all HTMLButtonElement valid props except className</span>
<span class="pl-c">// for set className we use bem.</span>
<span class="pl-k">function</span> <span class="pl-v">UiButton</span><span class="pl-kos">(</span><span class="pl-s1">props</span>: <span class="pl-v">BemProps</span> <span class="pl-c1">&</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-v">HTMLProps</span><span class="pl-c1"><</span><span class="pl-v">HTMLButtonElement</span><span class="pl-c1">></span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-kos">(</span>
<span class="pl-c1"><</span><span class="pl-ent">button</span> <span class="pl-c1">disabled</span> <span class="pl-c1">className</span><span class="pl-c1">=</span><span class="pl-kos">{</span><span class="pl-v">GetBEMClassNames</span><span class="pl-kos">(</span><span class="pl-s1">props</span><span class="pl-kos">)</span> <span class="pl-kos">}</span> <span class="pl-kos">{</span>...<span class="pl-s1">props</span><span class="pl-kos">}</span><span class="pl-c1">></span>
<span class="pl-kos">{</span><span class="pl-s1">props</span><span class="pl-kos">.</span><span class="pl-c1">children</span><span class="pl-kos">}</span>
<span class="pl-c1"><</span><span class="pl-c1">/</span><span class="pl-ent">button</span><span class="pl-c1">></span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I suggest new keyword 'except' or '!'</p>
<p dir="auto">Usage</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Props = BemProps & React.HTMLProps<HTMLButtonElement> except { className: string }"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Props</span> <span class="pl-c1">=</span> <span class="pl-smi">BemProps</span> <span class="pl-c1">&</span> <span class="pl-smi">React</span><span class="pl-kos">.</span><span class="pl-smi">HTMLProps</span><span class="pl-kos"><</span><span class="pl-smi">HTMLButtonElement</span><span class="pl-kos">></span> <span class="pl-s1">except</span> <span class="pl-kos">{</span> <span class="pl-s1">className</span>: string <span class="pl-kos">}</span></pre></div>
<p dir="auto">or "!"</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Props = BemProps & React.HTMLProps<HTMLButtonElement> ! { className: string }"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Props</span> <span class="pl-c1">=</span> <span class="pl-smi">BemProps</span> <span class="pl-c1">&</span> <span class="pl-smi">React</span><span class="pl-kos">.</span><span class="pl-smi">HTMLProps</span><span class="pl-kos"><</span><span class="pl-smi">HTMLButtonElement</span><span class="pl-kos">></span> <span class="pl-c1">!</span> <span class="pl-kos">{</span> <span class="pl-s1">className</span>: string <span class="pl-kos">}</span></pre></div> | <p dir="auto">Another type-safety measure. Sometimes it's desired to limit what developers can do with a value. Not allowing them to get to certain properties of it looks sufficient.</p>
<p dir="auto">Example: We render HTML elements to PDF on the client side. In order to do so we need to run <code class="notranslate">element.getBoundingClientRect</code> to get a bounding box in effect. It is an expensive operation that we wish could only be done once and then the result of it would be passed around along with the element to be rendered. Unfortunately nothing stops developers from ignoring that result and running the same method again and again as long as they can get to <code class="notranslate">element.getBoundingClientRect</code>. Now I wish I could strip that method so no-one can see it once the box is calculated. Subtaction types would solve the problem.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type HTMLDivSpecifics = HTMLDivElement - Element;"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">HTMLDivSpecifics</span> <span class="pl-c1">=</span> <span class="pl-smi">HTMLDivElement</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-smi">Element</span><span class="pl-kos">;</span></pre></div>
<h1 dir="auto">Proposal</h1>
<p dir="auto">add a type operator that produces a new type out of 2 given types according to the rules that follow:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = A - B;"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">A</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-smi">B</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This feature would require a new <strong>negated</strong> type like <code class="notranslate">number ~ string</code> which is a <code class="notranslate">number</code> that cannot take <code class="notranslate">number & string</code>.</p>
<p dir="auto">As far as the precedence of new type operator, it should go:</p>
<ol dir="auto">
<li>intersection <code class="notranslate">&</code></li>
<li>union <code class="notranslate">|</code></li>
<li>subtraction <code class="notranslate">-</code></li>
</ol>
<p dir="auto">so that <code class="notranslate">number & boolean | string - string</code>, means <code class="notranslate">((number & boolean) | string) - string</code></p>
<h3 dir="auto">Generics</h3>
<ul dir="auto">
<li>should produce a yet to be resolved type, should be stored as an expression which will produce either a type or an error when all type parameters are known</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Minus<A, B> = A - B; // yet to be calculated"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">Minus</span><span class="pl-c1"><</span><span class="pl-smi">A</span><span class="pl-kos">,</span> <span class="pl-smi">B</span><span class="pl-c1">></span> <span class="pl-c1">=</span> <span class="pl-smi">A</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-smi">B</span><span class="pl-kos">;</span> <span class="pl-c">// yet to be calculated</span></pre></div>
<h3 dir="auto">Primitives</h3>
<ul dir="auto">
<li>if the left type (minued) isn't a sub-type of the right type (subtrahend) the <code class="notranslate">-</code> operation should result to an type error</li>
<li><code class="notranslate">never</code> and <code class="notranslate">any</code> should be specially handled</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = number - number; // {}
type C = number - {}; // number
type C = {} - number; // error
type C = number - string; // error
type C = number - 0; // number ~ 0
type C = number | string - boolean; // error
type C = number - void | null | undefined; // error
type C = number - any; // {}
type C = any - any; // any
type C = any - number; // any ~ number
type C = any - never; // error;
type C = never - any; // error;
type C = number - never; // error
type C = never - number; // error
type C = never - never; // error
type C = number | string - string; // number
type C = number - number | string; // {}
type C = number | string - {}; // number | string
type C = number & string - boolean; // error
type C = number & string - string; // number ~ string
"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">string</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">-</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">// number ~ 0</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">-</span> <span class="pl-smi"><span class="pl-k">void</span></span> <span class="pl-c1">|</span> <span class="pl-c1">null</span> <span class="pl-c1">|</span> <span class="pl-c1">undefined</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">any</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">any</span><span class="pl-kos">;</span> <span class="pl-c">// any</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// any ~ number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">any</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">never</span><span class="pl-kos">;</span> <span class="pl-c">// error;</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">never</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">any</span><span class="pl-kos">;</span> <span class="pl-c">// error;</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">never</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">never</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">never</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">never</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> string<span class="pl-kos">;</span> <span class="pl-c">// number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-s1">number</span> <span class="pl-c1">|</span> <span class="pl-s1">string</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// number | string</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">&</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-smi">number</span> <span class="pl-c1">&</span> <span class="pl-smi">string</span> <span class="pl-c1">-</span> string<span class="pl-kos">;</span> <span class="pl-c">// number ~ string</span></pre></div>
<h3 dir="auto">Products</h3>
<ul dir="auto">
<li>only matching properties should be considered, non-matching properties of the left type should stay intact, non-matching properties of the right type should be disregarded</li>
<li>if the names of 2 properties match their types are subject for <code class="notranslate">-</code> operation that produces the type of the resulting property of the same name</li>
<li>if applying <code class="notranslate">-</code> on 2 properties of the same name gives <code class="notranslate">{}</code>, the property gets dropped from the resulting type</li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = {} - { x: number }; // {}
type C = { x: number } - {}; // { x: number }
type C = { x: {} } - { x: number }; // error
type C = { x: number } - { x: {} }; // { x: number }
type C = { x: number } - { y: number }; // { x: number }
type C = { x: number } - { x: number }; // {}
type C = { x: number | string } - { x: string }; // { x: number }
type C = { x: number & string } - { x: string }; // { x: number ~ string }
type C = { x: number } - { x: string }; // error"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-kos">{</span><span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">y</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">number</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">string</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">&</span> <span class="pl-smi">string</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">string</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// { x: number ~ string }</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-smi">number</span> <span class="pl-kos">}</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">{</span> <span class="pl-c1">x</span>: <span class="pl-s1">string</span> <span class="pl-kos">}</span><span class="pl-kos">;</span> <span class="pl-c">// error</span></pre></div>
<h3 dir="auto">Functions (2 certain signatures)</h3>
<ul dir="auto">
<li>both functions must have the same number of parameters, otherwise it's an error</li>
<li>types of corresponding parameters are subject to the <code class="notranslate">-</code> operator</li>
<li>types of results must 100% match and should be kept intact, otherwise it's an error</li>
<li>if <code class="notranslate">-</code> on 2 parameters gives <code class="notranslate">{}</code> the resulting parameter is <code class="notranslate">{}</code></li>
<li>if all resulting parameters are <code class="notranslate">{}</code> the resulting type is <code class="notranslate">{}</code></li>
</ul>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type C = ((x: number) => string) - ((x: number) => string); // {}
type C = ((x: number) => number) - ((x: number) => number); // (x: {}) => number
type C = ((x: number | string) => string) - ((x: string) => string); // (x: number) => string
type C = ((x: number) => string) - ((x: string) => string); // error
type C = ((x: number | string) => string) - (() => string); // error
type C = (() => string) - ((x: number) => string); // error"><pre class="notranslate"><span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// {}</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">number</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">number</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// (x: {}) => number</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// (x: number) => string</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span> <span class="pl-c1">|</span> <span class="pl-smi">string</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// error</span>
<span class="pl-k">type</span> <span class="pl-smi">C</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-smi">string</span><span class="pl-kos">)</span><span class="pl-kos"></span> <span class="pl-c1">-</span> <span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-s1">string</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// error</span></pre></div>
<h3 dir="auto">Overloads</h3>
<ul dir="auto">
<li>to be continued...</li>
</ul> | 1 |
<p dir="auto">I noticed this problem on my machine. I think it may be a bug as another person was able to reproduce it on their machine.</p>
<p dir="auto">The problem is that julia crashes when I use the <code class="notranslate">dot</code> function from <code class="notranslate">LinearAlgebra.jl</code> on arrays of complex numbers that are longer than 10^4. If the arrays of complex numbers have of length 10001 or more, it crashes. If the arrays are real <code class="notranslate">dot</code> works just fine. If the arrays are complex and are less than 10001 entries <code class="notranslate">dot</code> works fine.</p>
<p dir="auto">Another interesting point is that when I run the code for the dot function (found in the repository for LinearAlgebra) and use that function it works as it should in this case. So, when I run</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function dot end
function dot(x, y) # arbitrary iterables
ix = iterate(x)
iy = iterate(y)
if ix === nothing
if iy !== nothing
throw(DimensionMismatch("x and y are of different lengths!"))
end
return dot(zero(eltype(x)), zero(eltype(y)))
end
if iy === nothing
throw(DimensionMismatch("x and y are of different lengths!"))
end
(vx, xs) = ix
(vy, ys) = iy
s = dot(vx, vy)
while true
ix = iterate(x, xs)
iy = iterate(y, ys)
ix === nothing && break
iy === nothing && break
(vx, xs), (vy, ys) = ix, iy
s += dot(vx, vy)
end
if !(iy === nothing && ix === nothing)
throw(DimensionMismatch("x and y are of different lengths!"))
end
return s
end
dot(x::Number, y::Number) = conj(x) * y
function dot(x::AbstractArray, y::AbstractArray)
lx = length(x)
if lx != length(y)
throw(DimensionMismatch("first array has length $(lx) which does not match the length of the second, $(length(y))."))
end
if lx == 0
return dot(zero(eltype(x)), zero(eltype(y)))
end
s = zero(dot(first(x), first(y)))
for (Ix, Iy) in zip(eachindex(x), eachindex(y))
@inbounds s += dot(x[Ix], y[Iy])
end
s
end
foo(n) = randn(n) + im*randn(n)
dot(foo(10^7),foo(10^7))"><pre class="notranslate"><span class="pl-k">function</span> dot <span class="pl-k">end</span>
<span class="pl-k">function</span> <span class="pl-en">dot</span>(x, y) <span class="pl-c"><span class="pl-c">#</span> arbitrary iterables</span>
ix <span class="pl-k">=</span> <span class="pl-c1">iterate</span>(x)
iy <span class="pl-k">=</span> <span class="pl-c1">iterate</span>(y)
<span class="pl-k">if</span> ix <span class="pl-k">===</span> <span class="pl-c1">nothing</span>
<span class="pl-k">if</span> iy <span class="pl-k">!==</span> <span class="pl-c1">nothing</span>
<span class="pl-c1">throw</span>(<span class="pl-c1">DimensionMismatch</span>(<span class="pl-s"><span class="pl-pds">"</span>x and y are of different lengths!<span class="pl-pds">"</span></span>))
<span class="pl-k">end</span>
<span class="pl-k">return</span> <span class="pl-c1">dot</span>(<span class="pl-c1">zero</span>(<span class="pl-c1">eltype</span>(x)), <span class="pl-c1">zero</span>(<span class="pl-c1">eltype</span>(y)))
<span class="pl-k">end</span>
<span class="pl-k">if</span> iy <span class="pl-k">===</span> <span class="pl-c1">nothing</span>
<span class="pl-c1">throw</span>(<span class="pl-c1">DimensionMismatch</span>(<span class="pl-s"><span class="pl-pds">"</span>x and y are of different lengths!<span class="pl-pds">"</span></span>))
<span class="pl-k">end</span>
(vx, xs) <span class="pl-k">=</span> ix
(vy, ys) <span class="pl-k">=</span> iy
s <span class="pl-k">=</span> <span class="pl-c1">dot</span>(vx, vy)
<span class="pl-k">while</span> <span class="pl-c1">true</span>
ix <span class="pl-k">=</span> <span class="pl-c1">iterate</span>(x, xs)
iy <span class="pl-k">=</span> <span class="pl-c1">iterate</span>(y, ys)
ix <span class="pl-k">===</span> <span class="pl-c1">nothing</span> <span class="pl-k">&&</span> <span class="pl-k">break</span>
iy <span class="pl-k">===</span> <span class="pl-c1">nothing</span> <span class="pl-k">&&</span> <span class="pl-k">break</span>
(vx, xs), (vy, ys) <span class="pl-k">=</span> ix, iy
s <span class="pl-k">+=</span> <span class="pl-c1">dot</span>(vx, vy)
<span class="pl-k">end</span>
<span class="pl-k">if</span> <span class="pl-k">!</span>(iy <span class="pl-k">===</span> <span class="pl-c1">nothing</span> <span class="pl-k">&&</span> ix <span class="pl-k">===</span> <span class="pl-c1">nothing</span>)
<span class="pl-c1">throw</span>(<span class="pl-c1">DimensionMismatch</span>(<span class="pl-s"><span class="pl-pds">"</span>x and y are of different lengths!<span class="pl-pds">"</span></span>))
<span class="pl-k">end</span>
<span class="pl-k">return</span> s
<span class="pl-k">end</span>
<span class="pl-en">dot</span>(x<span class="pl-k">::</span><span class="pl-c1">Number</span>, y<span class="pl-k">::</span><span class="pl-c1">Number</span>) <span class="pl-k">=</span> <span class="pl-c1">conj</span>(x) <span class="pl-k">*</span> y
<span class="pl-k">function</span> <span class="pl-en">dot</span>(x<span class="pl-k">::</span><span class="pl-c1">AbstractArray</span>, y<span class="pl-k">::</span><span class="pl-c1">AbstractArray</span>)
lx <span class="pl-k">=</span> <span class="pl-c1">length</span>(x)
<span class="pl-k">if</span> lx <span class="pl-k">!=</span> <span class="pl-c1">length</span>(y)
<span class="pl-c1">throw</span>(<span class="pl-c1">DimensionMismatch</span>(<span class="pl-s"><span class="pl-pds">"</span>first array has length <span class="pl-v">$(lx)</span> which does not match the length of the second, <span class="pl-v">$(<span class="pl-c1">length</span>(y))</span>.<span class="pl-pds">"</span></span>))
<span class="pl-k">end</span>
<span class="pl-k">if</span> lx <span class="pl-k">==</span> <span class="pl-c1">0</span>
<span class="pl-k">return</span> <span class="pl-c1">dot</span>(<span class="pl-c1">zero</span>(<span class="pl-c1">eltype</span>(x)), <span class="pl-c1">zero</span>(<span class="pl-c1">eltype</span>(y)))
<span class="pl-k">end</span>
s <span class="pl-k">=</span> <span class="pl-c1">zero</span>(<span class="pl-c1">dot</span>(<span class="pl-c1">first</span>(x), <span class="pl-c1">first</span>(y)))
<span class="pl-k">for</span> (Ix, Iy) <span class="pl-k">in</span> <span class="pl-c1">zip</span>(<span class="pl-c1">eachindex</span>(x), <span class="pl-c1">eachindex</span>(y))
<span class="pl-c1">@inbounds</span> s <span class="pl-k">+=</span> <span class="pl-c1">dot</span>(x[Ix], y[Iy])
<span class="pl-k">end</span>
s
<span class="pl-k">end</span>
<span class="pl-en">foo</span>(n) <span class="pl-k">=</span> <span class="pl-c1">randn</span>(n) <span class="pl-k">+</span> im<span class="pl-k">*</span><span class="pl-c1">randn</span>(n)
<span class="pl-c1">dot</span>(<span class="pl-c1">foo</span>(<span class="pl-c1">10</span><span class="pl-k">^</span><span class="pl-c1">7</span>),<span class="pl-c1">foo</span>(<span class="pl-c1">10</span><span class="pl-k">^</span><span class="pl-c1">7</span>))</pre></div>
<p dir="auto">It works fine but if I run:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="using LinearAlgebra: dot
foo(n) = randn(n) + im*randn(n)
dot(foo(10001),foo(10001))"><pre class="notranslate"><span class="pl-k">using</span> LinearAlgebra<span class="pl-k">:</span> dot
<span class="pl-en">foo</span>(n) <span class="pl-k">=</span> <span class="pl-c1">randn</span>(n) <span class="pl-k">+</span> im<span class="pl-k">*</span><span class="pl-c1">randn</span>(n)
<span class="pl-c1">dot</span>(<span class="pl-c1">foo</span>(<span class="pl-c1">10001</span>),<span class="pl-c1">foo</span>(<span class="pl-c1">10001</span>))</pre></div>
<p dir="auto">julia crashes.</p>
<p dir="auto">The error message I get before julia dies is here:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception:
Please submit a bug repor
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 --"><pre class="notranslate"><code class="notranslate">Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception:
Please submit a bug repor
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 -- at 0x1d407280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1d407280 --
</code></pre></div>
<p dir="auto">Here are my configurations</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)"><pre class="notranslate"><code class="notranslate">julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
</code></pre></div>
<p dir="auto">I am happy to supply any other help information.<br>
Thank you.</p> | <p dir="auto">To reproduce</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="x = zeros(ComplexF64, 10001)
x' * x"><pre class="notranslate">x <span class="pl-k">=</span> <span class="pl-c1">zeros</span>(ComplexF64, <span class="pl-c1">10001</span>)
x<span class="pl-k">'</span> <span class="pl-k">*</span> x</pre></div>
<p dir="auto">The error message is</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- at 0x1a3e7280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- unknown function (ip: 000000001A3E7280)
in expression starting at REPL[10]:1
in expression starting at REPL[10]:1
)
reproduce this fault, and any error messages that follow (in their entirety). Thanks."><pre class="notranslate"><code class="notranslate">Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- at 0x1a3e7280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- OLATION with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x1a3e7280 -- unknown function (ip: 000000001A3E7280)
in expression starting at REPL[10]:1
in expression starting at REPL[10]:1
)
reproduce this fault, and any error messages that follow (in their entirety). Thanks.
</code></pre></div>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)"><pre class="notranslate">julia<span class="pl-k">></span> <span class="pl-c1">versioninfo</span>()
Julia Version <span class="pl-c1">1.5</span>.<span class="pl-c1">0</span>
Commit <span class="pl-c1">96786e22</span>cc (<span class="pl-c1">2020</span><span class="pl-k">-</span><span class="pl-c1">08</span><span class="pl-k">-</span><span class="pl-c1">01</span> <span class="pl-c1">23</span><span class="pl-k">:</span><span class="pl-c1">44</span> UTC)
Platform Info<span class="pl-k">:</span>
OS<span class="pl-k">:</span> Windows (x86_64<span class="pl-k">-</span>w64<span class="pl-k">-</span>mingw32)
CPU<span class="pl-k">:</span> <span class="pl-c1">Intel</span>(R) <span class="pl-c1">Core</span>(TM) i5<span class="pl-k">-</span><span class="pl-c1">8265</span>U CPU @ <span class="pl-c1">1.60</span>GHz
WORD_SIZE<span class="pl-k">:</span> <span class="pl-c1">64</span>
LIBM<span class="pl-k">:</span> libopenlibm
LLVM<span class="pl-k">:</span> libLLVM<span class="pl-k">-</span><span class="pl-c1">9.0</span>.<span class="pl-c1">1</span> (ORCJIT, skylake)</pre></div>
<p dir="auto">Does not happen on julia 1.4.2.</p> | 1 |
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">core</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">This bug is related to <a href="https://github.com/openstack/tripleo-quickstart">tripleo-quickstart</a>, an Ansible based project for setting up TripleO virtual environments, which customizes the conf as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[defaults]
command_warnings = False
retry_files_enabled = False
callback_whitelist = profile_tasks
host_key_checking = False
force_color = 1
# Attempt to load custom modules whether it's installed system-wide or from a virtual environment
callback_plugins = /usr/lib/python2.7/site-packages/ara/plugins/callbacks:$VIRTUAL_ENV/lib/python2.7/site-packages/ara/plugins/callbacks:/usr/local/lib/python2.7/dist-packages/ara/plugins/callbacks
test_plugins = /usr/lib/python2.7/site-packages/tripleo-quickstart/test_plugins:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/test_plugins:test_plugins
library = /usr/lib/python2.7/site-packages/tripleo-quickstart/library:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/library:library
roles_path = roles:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/roles:$VIRTUAL_ENV/usr/local/share/ansible/roles
[ssh_connection]
control_path = %(directory)s/%%h-%%r"><pre class="notranslate"><code class="notranslate">[defaults]
command_warnings = False
retry_files_enabled = False
callback_whitelist = profile_tasks
host_key_checking = False
force_color = 1
# Attempt to load custom modules whether it's installed system-wide or from a virtual environment
callback_plugins = /usr/lib/python2.7/site-packages/ara/plugins/callbacks:$VIRTUAL_ENV/lib/python2.7/site-packages/ara/plugins/callbacks:/usr/local/lib/python2.7/dist-packages/ara/plugins/callbacks
test_plugins = /usr/lib/python2.7/site-packages/tripleo-quickstart/test_plugins:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/test_plugins:test_plugins
library = /usr/lib/python2.7/site-packages/tripleo-quickstart/library:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/library:library
roles_path = roles:$VIRTUAL_ENV/usr/local/share/tripleo-quickstart/roles:$VIRTUAL_ENV/usr/local/share/ansible/roles
[ssh_connection]
control_path = %(directory)s/%%h-%%r
</code></pre></div>
<p dir="auto">So nothing that seems related to the problem I'm getting.</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">CentOS Linux release 7.3.1611 (Core)</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">Until ansible 2.1.0 this section of my main task always worked:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Get overcloud-ha-test-suite on undercloud and controllers
vars:
nodes:
- "undercloud"
- "{{ groups['controller'] }}"
shell: >
rm -rf tripleo-director-ha-test-suite;
git clone https://github.com/rscarazz/tripleo-director-ha-test-suite/ tripleo-director-ha-test-suite;
delegate_to: "{{ item }}"
with_items: "{{ nodes }}""><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Get overcloud-ha-test-suite on undercloud and controllers</span>
<span class="pl-ent">vars</span>:
<span class="pl-ent">nodes</span>:
- <span class="pl-s"><span class="pl-pds">"</span>undercloud<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>{{ groups['controller'] }}<span class="pl-pds">"</span></span>
<span class="pl-ent">shell</span>: <span class="pl-s">></span>
<span class="pl-s"> rm -rf tripleo-director-ha-test-suite;</span>
<span class="pl-s"> git clone https://github.com/rscarazz/tripleo-director-ha-test-suite/ tripleo-director-ha-test-suite;</span>
<span class="pl-s"></span> <span class="pl-ent">delegate_to</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item }}<span class="pl-pds">"</span></span>
<span class="pl-ent">with_items</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ nodes }}<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">Each element of nodes exists and is taken from the correctly populated inventory.<br>
After upgrading to ansible 2.2.0 a strange behavior happens, the section fails because {{ item }} takes values like "skipped" and "changed" making ssh connections failing.<br>
Issue was solved by <a href="https://github.com/openstack/tripleo-quickstart-extras/commit/b97b13b83ce191ee235e1fa6499c63a177f099d8">this commit</a>, with this modification:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: Get overcloud-ha-test-suite on undercloud and controllers
shell: >
rm -rf tripleo-director-ha-test-suite;
git clone https://github.com/rscarazz/tripleo-director-ha-test-suite/ tripleo-director-ha-test-suite;
delegate_to: "{{ item }}"
with_items:
- "undercloud"
- "{{ groups['controller'] }}""><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">Get overcloud-ha-test-suite on undercloud and controllers</span>
<span class="pl-ent">shell</span>: <span class="pl-s">></span>
<span class="pl-s"> rm -rf tripleo-director-ha-test-suite;</span>
<span class="pl-s"> git clone https://github.com/rscarazz/tripleo-director-ha-test-suite/ tripleo-director-ha-test-suite;</span>
<span class="pl-s"></span> <span class="pl-ent">delegate_to</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ item }}<span class="pl-pds">"</span></span>
<span class="pl-ent">with_items</span>:
- <span class="pl-s"><span class="pl-pds">"</span>undercloud<span class="pl-pds">"</span></span>
- <span class="pl-s"><span class="pl-pds">"</span>{{ groups['controller'] }}<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">but I think it should work in both cases.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">To reproduce the problem simply use the code above, trying to run the action after creating an inventory with expected elements, "undercloud" and "{{ groups['controller'] }}" (usually a 3 elements array).</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Execution of the action, without any error in both cases.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">As one can see from the output the host on which the action is taken is "skipped" and not the hostname as expected:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="14:59:42 <skipped> ESTABLISH SSH CONNECTION FOR USER: None
14:59:42 <skipped> SSH: EXEC ssh -vvv -F workspace/ssh.config.ansible -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 skipped '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.15-73426610894136 `" && echo ansible-tmp-1485269982.15-73426610894136="` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.15-73426610894136 `" ) && sleep 0'"'"''
14:59:42 failed: [undercloud] (item=skipped) => {
14:59:42 "item": "skipped",
14:59:42 "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data workspace/ssh.config.ansible\r\ndebug1: workspace/ssh.config.ansible line 2: Applying options for *\r\nssh: Could not resolve hostname skipped: Name or service not known\r\n",
14:59:42 "unreachable": true
14:59:42 }"><pre class="notranslate"><code class="notranslate">14:59:42 <skipped> ESTABLISH SSH CONNECTION FOR USER: None
14:59:42 <skipped> SSH: EXEC ssh -vvv -F workspace/ssh.config.ansible -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 skipped '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.15-73426610894136 `" && echo ansible-tmp-1485269982.15-73426610894136="` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.15-73426610894136 `" ) && sleep 0'"'"''
14:59:42 failed: [undercloud] (item=skipped) => {
14:59:42 "item": "skipped",
14:59:42 "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data workspace/ssh.config.ansible\r\ndebug1: workspace/ssh.config.ansible line 2: Applying options for *\r\nssh: Could not resolve hostname skipped: Name or service not known\r\n",
14:59:42 "unreachable": true
14:59:42 }
</code></pre></div>
<p dir="auto">Same is on the next error, but this time with "changed":</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="14:59:42 <changed> ESTABLISH SSH CONNECTION FOR USER: None
14:59:42 <changed> SSH: EXEC ssh -vvv -F workspace/ssh.config.ansible -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 changed '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.24-237524239100501 `" && echo ansible-tmp-1485269982.24-237524239100501="` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.24-237524239100501 `" ) && sleep 0'"'"''
14:59:42 failed: [undercloud] (item=changed) => {
14:59:42 "item": "changed",
14:59:42 "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data workspace/ssh.config.ansible\r\ndebug1: workspace/ssh.config.ansible line 2: Applying options for *\r\nssh: Could not resolve hostname changed: Name or service not known\r\n",
14:59:42 "unreachable": true
14:59:42 }"><pre class="notranslate"><code class="notranslate">14:59:42 <changed> ESTABLISH SSH CONNECTION FOR USER: None
14:59:42 <changed> SSH: EXEC ssh -vvv -F workspace/ssh.config.ansible -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 changed '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.24-237524239100501 `" && echo ansible-tmp-1485269982.24-237524239100501="` echo $HOME/.ansible/tmp/ansible-tmp-1485269982.24-237524239100501 `" ) && sleep 0'"'"''
14:59:42 failed: [undercloud] (item=changed) => {
14:59:42 "item": "changed",
14:59:42 "msg": "Failed to connect to the host via ssh: OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013\r\ndebug1: Reading configuration data workspace/ssh.config.ansible\r\ndebug1: workspace/ssh.config.ansible line 2: Applying options for *\r\nssh: Could not resolve hostname changed: Name or service not known\r\n",
14:59:42 "unreachable": true
14:59:42 }
</code></pre></div>
<p dir="auto">I don't know if this can be considered a duplicate of <a href="https://github.com/ansible/ansible/issues/11705" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/11705/hovercard">this other issue</a>, since the behavior is slightly different, but maybe it is related.</p> | <p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/naslanidis/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/naslanidis">@naslanidis</a> on 2016-03-07T01:20:17Z</p>
<h5 dir="auto">Issue Type:</h5>
<ul dir="auto">
<li>Feature Idea</li>
</ul>
<h5 dir="auto">Component Name:</h5>
<ul dir="auto">
<li>ec2_vpc.py</li>
</ul>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">ansible 2.0.0.2<br>
config file = /home/naslanidis/code/ag-vpc-management/ansible.cfg<br>
configured module search path = /usr/share/ansible/modules</p>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Fedora 22 x64</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">When creating VPC's using this module, if any tag is changed or added a completely new VPC is created rather than the tags being added or updated. Looking at the documentation, all tags are used along with the cidr range to uniquely identify an existing VPC. In my opinion this should just be a NAME tag and other tags should be able to be added, changed and removed for an existing VPC</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<ol dir="auto">
<li>Create a VPC using this module with a number of tags in place</li>
<li>Add a new tag (e.g. cost code), and rerun the script</li>
<li>A new duplicate VPC is created rather than adding the cost code tag to the existing VPC</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" - name: test out vpc module 1st run though
ec2_vpc:
state: present
region: ap-southeast-2
profile: non_prod
cidr_block: 10.33.0.0/16
resource_tags:
Name: AAG-VPC-33
Owner: ABC
register: created_vpc"><pre class="notranslate"><code class="notranslate"> - name: test out vpc module 1st run though
ec2_vpc:
state: present
region: ap-southeast-2
profile: non_prod
cidr_block: 10.33.0.0/16
resource_tags:
Name: AAG-VPC-33
Owner: ABC
register: created_vpc
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" - name: test out vpc module 2nd run though
ec2_vpc:
state: present
region: ap-southeast-2
profile: non_prod
cidr_block: 10.33.0.0/16
resource_tags:
Name: AAG-VPC-33
Owner: ABC
Cost_code: 3
register: created_vpc"><pre class="notranslate"><code class="notranslate"> - name: test out vpc module 2nd run though
ec2_vpc:
state: present
region: ap-southeast-2
profile: non_prod
cidr_block: 10.33.0.0/16
resource_tags:
Name: AAG-VPC-33
Owner: ABC
Cost_code: 3
register: created_vpc
</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<p dir="auto">The existing VPC should be updated with the new Cost_code tag.</p>
<h5 dir="auto">Actual Results:</h5>
<p dir="auto">A new VPC is created that duplicates the first VPC.</p>
<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="138859125" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/3194" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/3194/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/3194">ansible/ansible-modules-core#3194</a></p> | 0 |
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
<li>Documentation Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">eos_config<br>
(any of the eos_ modules)</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook 2.3.1.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Dec 18 2016, 07:03:34) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]"><pre class="notranslate"><code class="notranslate">ansible-playbook 2.3.1.0
config file =
configured module search path = Default w/o overrides
python version = 2.7.13 (default, Dec 18 2016, 07:03:34) [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">(default)</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Mac OS</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">using any of the <code class="notranslate">eos_</code> modules gives various deprecation warnings, but there's no solution or mention in the docs</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">See <a href="https://gist.github.com/halberom/d15181e6403ea3d9a4296a3fa6c0df7b">https://gist.github.com/halberom/d15181e6403ea3d9a4296a3fa6c0df7b</a></p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">A comment in the docs at a minimum.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [run show inventory] ******************************************************************************************************************************************************************************************************************************************************
[WARNING]: argument transport has been deprecated and will be removed in a future version"><pre class="notranslate"><code class="notranslate">TASK [run show inventory] ******************************************************************************************************************************************************************************************************************************************************
[WARNING]: argument transport has been deprecated and will be removed in a future version
</code></pre></div>
<p dir="auto">But there's nothing in the docs mentioning what it will be replaced with.</p> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">networking<br>
eos-config</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.1.0
config file = /Users/sean/src/ansibledemos/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.1.0
config file = /Users/sean/src/ansibledemos/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<h5 dir="auto">SUMMARY</h5>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Ran a playbook and wasn't expecting to receive the deprecated messages as per the post below from Peter that states the provider argument is not deprecated:</p>
<p dir="auto"><a href="https://www.ansible.com/blog/network-device-authentication-with-ansible-2-3" rel="nofollow">https://www.ansible.com/blog/network-device-authentication-with-ansible-2-3</a></p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
- hosts: switches
gather_facts: 'no'
# Run Anisble on the local server using CLI or eAPI to the node
connection: local
vars:
model_name: '{{ version_data.stdout[0].modelName }}'
eos_version: '{{ version_data.stdout[0].internalVersion }}'
tasks:
- name: Get Version
eos_command:
commands: 'show version'
provider: '{{ eos_connection }}'
register: version_data
# - debug: msg="{{version_data}}"
- name: Print report
template:
src: version_report.j2
dest: ./version_report-{{ inventory_hostname }}.txt
- name: Configure vlans
eos_config:
backup: yes
src: vlans.j2
provider: '{{ eos_connection }}'
- name: Configure interfaces
eos_config:
src: intf.j2
provider: '{{ eos_connection }}'
---
# make ansible play nice in a virtualenv
ansible_python_interpreter: python
eos_connection:
host: "{{ inventory_hostname }}"
transport: eapi
use_ssl: yes
validate_certs: no"><pre class="notranslate">---
- <span class="pl-ent">hosts</span>: <span class="pl-s">switches</span>
<span class="pl-ent">gather_facts</span>: <span class="pl-s"><span class="pl-pds">'</span>no<span class="pl-pds">'</span></span>
<span class="pl-c"><span class="pl-c">#</span> Run Anisble on the local server using CLI or eAPI to the node</span>
<span class="pl-ent">connection</span>: <span class="pl-s">local</span>
<span class="pl-ent">vars</span>:
<span class="pl-ent">model_name</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ version_data.stdout[0].modelName }}<span class="pl-pds">'</span></span>
<span class="pl-ent">eos_version</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ version_data.stdout[0].internalVersion }}<span class="pl-pds">'</span></span>
<span class="pl-ent">tasks</span>:
- <span class="pl-ent">name</span>: <span class="pl-s">Get Version</span>
<span class="pl-ent">eos_command</span>:
<span class="pl-ent">commands</span>: <span class="pl-s"><span class="pl-pds">'</span>show version<span class="pl-pds">'</span></span>
<span class="pl-ent">provider</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ eos_connection }}<span class="pl-pds">'</span></span>
<span class="pl-ent">register</span>: <span class="pl-s">version_data</span>
<span class="pl-c"><span class="pl-c">#</span> - debug: msg="{{version_data}}"</span>
- <span class="pl-ent">name</span>: <span class="pl-s">Print report</span>
<span class="pl-ent">template</span>:
<span class="pl-ent">src</span>: <span class="pl-s">version_report.j2</span>
<span class="pl-ent">dest</span>: <span class="pl-s">./version_report-{{ inventory_hostname }}.txt</span>
- <span class="pl-ent">name</span>: <span class="pl-s">Configure vlans</span>
<span class="pl-ent">eos_config</span>:
<span class="pl-ent">backup</span>: <span class="pl-s">yes</span>
<span class="pl-ent">src</span>: <span class="pl-s">vlans.j2</span>
<span class="pl-ent">provider</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ eos_connection }}<span class="pl-pds">'</span></span>
- <span class="pl-ent">name</span>: <span class="pl-s">Configure interfaces</span>
<span class="pl-ent">eos_config</span>:
<span class="pl-ent">src</span>: <span class="pl-s">intf.j2</span>
<span class="pl-ent">provider</span>: <span class="pl-s"><span class="pl-pds">'</span>{{ eos_connection }}<span class="pl-pds">'</span></span>
---
<span class="pl-c"><span class="pl-c">#</span> make ansible play nice in a virtualenv</span>
<span class="pl-ent">ansible_python_interpreter</span>: <span class="pl-s">python</span>
<span class="pl-ent">eos_connection</span>:
<span class="pl-ent">host</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ inventory_hostname }}<span class="pl-pds">"</span></span>
<span class="pl-ent">transport</span>: <span class="pl-s">eapi</span>
<span class="pl-ent">use_ssl</span>: <span class="pl-s">yes</span>
<span class="pl-ent">validate_certs</span>: <span class="pl-s">no</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">No deprecated messages as using the provider argument</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [switches] ******************************************************************************************************************************************************************************************************************************
TASK [Get Version] ***************************************************************************************************************************************************************************************************************************
[WARNING]: argument username has been deprecated and will be removed in a future version
[WARNING]: argument password has been deprecated and will be removed in a future version
[WARNING]: argument transport has been deprecated and will be removed in a future version
ok: [spine1]
TASK [Print report] **************************************************************************************************************************************************************************************************************************
ok: [spine1]
TASK [Configure vlans] ***********************************************************************************************************************************************************************************************************************
ok: [spine1]
TASK [Configure interfaces] ******************************************************************************************************************************************************************************************************************
ok: [spine1]
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
spine1 : ok=4 changed=0 unreachable=0 failed=0"><pre class="notranslate"><code class="notranslate">PLAY [switches] ******************************************************************************************************************************************************************************************************************************
TASK [Get Version] ***************************************************************************************************************************************************************************************************************************
[WARNING]: argument username has been deprecated and will be removed in a future version
[WARNING]: argument password has been deprecated and will be removed in a future version
[WARNING]: argument transport has been deprecated and will be removed in a future version
ok: [spine1]
TASK [Print report] **************************************************************************************************************************************************************************************************************************
ok: [spine1]
TASK [Configure vlans] ***********************************************************************************************************************************************************************************************************************
ok: [spine1]
TASK [Configure interfaces] ******************************************************************************************************************************************************************************************************************
ok: [spine1]
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
spine1 : ok=4 changed=0 unreachable=0 failed=0
</code></pre></div> | 1 |
<p dir="auto">In reviewing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40556112" data-permission-text="Title is private" data-url="https://github.com/kubernetes/kubernetes/issues/951" data-hovercard-type="pull_request" data-hovercard-url="/kubernetes/kubernetes/pull/951/hovercard" href="https://github.com/kubernetes/kubernetes/pull/951">#951</a>, it came to my attention that we have no validation or formal spec on what character restrictions we impose on label keys and values. This is bad if we plan to support a more formal complex selector grammar which may require escaping rules. We need to define a valid schema and enforce it via validation on object persistence.</p>
<p dir="auto">Clients today are restricted by the set of valid keys allowed in JSON or YAML for use as their label keys depending on the input format they use.</p>
<p dir="auto">According to JSON spec:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string."><pre class="notranslate"><code class="notranslate">A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.
</code></pre></div>
<p dir="auto">This means, it's ok today to have labels keys in our input JSON like the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"fu=":"=bar"
"fu==bar":"something"
"fu == :: ?? != bar": "seriously??"
}"><pre class="notranslate"><code class="notranslate">{
"fu=":"=bar"
"fu==bar":"something"
"fu == :: ?? != bar": "seriously??"
}
</code></pre></div>
<p dir="auto">This makes supporting a label selector grammar ridiculously hard. For example, a label selector of "foo==bar" is undefined because we have no rational way to parse that. Even "foo=bar" today is broken by what we accept as input.</p>
<p dir="auto">I think k8s should require all label keys to match our dns952 regex. This means all label keys are lower-case and single word terms.</p>
<p dir="auto">With this model, we can reliably look to support more complex label selector functions because we know where to stop parsing on left-hand operand, pluse we can support nicer unary operators or functions:</p>
<ul dir="auto">
<li>exists(foo)</li>
<li>foo=bar</li>
</ul> | <p dir="auto">The order that conversion functions are added to the scheme depends on the package initialization order in Go. The name of a conversion function is used in other generated functions (for performance), but because the order of packages is not guaranteed stable any change in build order can result in conversions being generated in different orders.</p>
<p dir="auto">The reason we have duplicate conversions is extensions/v1beta1 and v1 for Pods (of which most of the sub objects are identical). We need to ensure that there is a predictable order for the public conversion name - because conversions overwrite each other in the scheme, the generator doesn't have access to all conversions, only the most recent.</p>
<p dir="auto">Debugging info: Go 1.4</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ hack/update-generated-conversions.sh 2>&1 | grep -E 'conversion_generated.go|Generating'
Generating for version v1beta3
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6825 (0x3f499c)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4982 (0x5176d2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:91 (0x966cb3)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:103 (0x964541)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0x954796)
Generating for version v1
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6825 (0x3f499c)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4982 (0x5176d2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:91 (0x966cb3)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:103 (0x964541)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0x954796)"><pre class="notranslate"><code class="notranslate">$ hack/update-generated-conversions.sh 2>&1 | grep -E 'conversion_generated.go|Generating'
Generating for version v1beta3
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6825 (0x3f499c)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4982 (0x5176d2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:91 (0x966cb3)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:103 (0x964541)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0x954796)
Generating for version v1
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6825 (0x3f499c)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4982 (0x5176d2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:91 (0x966cb3)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:103 (0x964541)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0x954796)
</code></pre></div>
<p dir="auto">Go 1.5</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ hack/update-generated-conversions.sh 2>&1 | grep -E 'conversion_generated.go|Generating'
Generating for version v1beta3
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6564 (0x46e6df)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0xa07cd4)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:100 (0xa15fa2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4786 (0x5ba394)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:86 (0xa18b8b)
Generating for version v1
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6564 (0x46e6df)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0xa07cd4)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:100 (0xa15fa2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4786 (0x5ba394)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:86 (0xa18b8b)"><pre class="notranslate"><code class="notranslate">$ hack/update-generated-conversions.sh 2>&1 | grep -E 'conversion_generated.go|Generating'
Generating for version v1beta3
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6564 (0x46e6df)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0xa07cd4)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:100 (0xa15fa2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4786 (0x5ba394)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:86 (0xa18b8b)
Generating for version v1
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/api/v1/conversion_generated.go:6564 (0x46e6df)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/authorization/v1beta1/conversion_generated.go:24 (0xa07cd4)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/conversion_generated.go:100 (0xa15fa2)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/extensions/v1beta1/conversion_generated.go:4786 (0x5ba394)
/Users/clayton/projects/go/src/github.com/openshift/origin/Godeps/_workspace/src/k8s.io/kubernetes/pkg/apis/metrics/v1alpha1/conversion_generated.go:86 (0xa18b8b)
</code></pre></div>
<p dir="auto">Need to figure out how to enforce an order.</p> | 0 |
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
// Supported beast features
interface Beast { wings?: boolean; legs?: number }
interface Legged { legs: number; }
interface Winged { wings: boolean; }
// Beast feature detection via user-defined type guards
function hasLegs(x: Beast): x is Legged { return x && typeof x.legs === 'number'; }
function hasWings(x: Beast): x is Winged { return x && !!x.wings; }
// Function to identify a given beast by detecting its features
function identifyBeast(beast: Beast) {
// All beasts with legs
if (hasLegs(beast)) {
// All winged beasts with legs
if (hasWings(beast)) {
if (beast.legs === 4) { // ERROR TS2339: Property 'legs' does not exist on type 'Winged'.
console.log(`pegasus - 4 legs, wings`);
}
else if (beast.legs === 2) { // ERROR TS2339...
console.log(`bird - 2 legs, wings`);
}
else {
console.log(`unknown - ${beast.legs} legs, wings`); // ERROR TS2339...
}
}
// All non-winged beasts with legs
else {
console.log(`manbearpig - ${beast.legs} legs, no wings`);
}
}
// All beasts without legs
else {
if (hasWings(beast)) {
console.log(`quetzalcoatl - no legs, wings`)
}
else {
console.log(`snake - no legs, no wings`)
}
}
}
// Runtime results
identifyBeast({ wings: true }); // quetzalcoatl - no legs, wings
identifyBeast({ wings: false }); // snake - no legs, no wings
identifyBeast({ legs: 2 }); // manbearpig - 2 legs, no wings
identifyBeast({ legs: 4 }); // manbearpig - 4 legs, no wings
identifyBeast({ wings: true, legs: 2 }); // bird - 2 legs, wings
identifyBeast({ wings: true, legs: 4 }); // pegasus - 4 legs, wings
identifyBeast({ wings: true, legs: 6 }); // unknown - 6 legs, wings
identifyBeast({ wings: false, legs: 6 }); // manbearpig - 6 legs, no wings"><pre class="notranslate"><span class="pl-c">// Supported beast features</span>
<span class="pl-k">interface</span> <span class="pl-smi">Beast</span> <span class="pl-kos">{</span> <span class="pl-c1">wings</span>?: <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-c1">legs</span>?: <span class="pl-smi">number</span> <span class="pl-kos">}</span>
<span class="pl-k">interface</span> <span class="pl-smi">Legged</span> <span class="pl-kos">{</span> <span class="pl-c1">legs</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">interface</span> <span class="pl-smi">Winged</span> <span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-smi">boolean</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-c">// Beast feature detection via user-defined type guards</span>
<span class="pl-k">function</span> <span class="pl-en">hasLegs</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">Beast</span><span class="pl-kos">)</span>: <span class="pl-s1">x</span> is <span class="pl-smi">Legged</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">x</span> <span class="pl-c1">&&</span> <span class="pl-k">typeof</span> <span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-c1">legs</span> <span class="pl-c1">===</span> <span class="pl-s">'number'</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">function</span> <span class="pl-en">hasWings</span><span class="pl-kos">(</span><span class="pl-s1">x</span>: <span class="pl-smi">Beast</span><span class="pl-kos">)</span>: <span class="pl-s1">x</span> is <span class="pl-smi">Winged</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">x</span> <span class="pl-c1">&&</span> <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-c1">wings</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-c">// Function to identify a given beast by detecting its features</span>
<span class="pl-k">function</span> <span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-s1">beast</span>: <span class="pl-smi">Beast</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// All beasts with legs</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-en">hasLegs</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// All winged beasts with legs</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-en">hasWings</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">.</span><span class="pl-c1">legs</span> <span class="pl-c1">===</span> <span class="pl-c1">4</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// ERROR TS2339: Property 'legs' does not exist on type 'Winged'.</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`pegasus - 4 legs, wings`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">.</span><span class="pl-c1">legs</span> <span class="pl-c1">===</span> <span class="pl-c1">2</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-c">// ERROR TS2339...</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`bird - 2 legs, wings`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`unknown - <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">beast</span><span class="pl-kos">.</span><span class="pl-c1">legs</span><span class="pl-kos">}</span></span> legs, wings`</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// ERROR TS2339...</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c">// All non-winged beasts with legs</span>
<span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`manbearpig - <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">beast</span><span class="pl-kos">.</span><span class="pl-c1">legs</span><span class="pl-kos">}</span></span> legs, no wings`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c">// All beasts without legs </span>
<span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-en">hasWings</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`quetzalcoatl - no legs, wings`</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`snake - no legs, no wings`</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-c">// Runtime results</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// quetzalcoatl - no legs, wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// snake - no legs, no wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">legs</span>: <span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// manbearpig - 2 legs, no wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">legs</span>: <span class="pl-c1">4</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// manbearpig - 4 legs, no wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">legs</span>: <span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// bird - 2 legs, wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">legs</span>: <span class="pl-c1">4</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// pegasus - 4 legs, wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">legs</span>: <span class="pl-c1">6</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// unknown - 6 legs, wings</span>
<span class="pl-en">identifyBeast</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">wings</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">legs</span>: <span class="pl-c1">6</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// manbearpig - 6 legs, no wings</span></pre></div>
<p dir="auto">The code above produces compiler errors with tsc@next, but it does represent valid JavaScript that runs correctly and outputs the expected results as shown at the bottom of the code.</p>
<p dir="auto">I believe tsc is working as intended in this example. So this issue is a suggestion for <em>improving</em> type guards to support this coding pattern (sometimes called duck typing <g-emoji class="g-emoji" alias="hatched_chick" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f425.png">🐥</g-emoji>). The rationale is that it is a useful and common practice in JavaScript to identify and refine objects through successive feature detection.</p>
<p dir="auto">The limitation with type guards in their current form is that if we have already narrowed to <code class="notranslate">Legged</code>, and then we further narrow to <code class="notranslate">Winged</code> using a nested type guard, then tsc 'forgets' that we still have a <code class="notranslate">Legged</code>. Imagine a blindfolded person feeling the legs of a beast. If further investigation reveals that the beast has wings, the person would probably assume the legs are still there. After all, legs and wings are not mutually exclusive features, and a beast can have both.</p>
<p dir="auto">So the ideal behaviour in this case, would be that if we narrow to <code class="notranslate">Legged</code> and then further narrow to <code class="notranslate">Winged</code>, then its safe to say we must now have a <code class="notranslate">Legged & Winged</code>, ie both features simultaneously. (Strong duck typing? <g-emoji class="g-emoji" alias="muscle" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4aa.png">💪</g-emoji> <g-emoji class="g-emoji" alias="hatched_chick" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f425.png">🐥</g-emoji>)</p>
<p dir="auto">A similar issue can be seen in the following snippet:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function beastFoo(beast: Beast) {
if (hasWings(beast) && hasLegs(beast)) {
beast // beast is Legged
// ideally, beast would be Winged && Legged here...
}
if (hasLegs(beast) && hasWings(beast)) {
beast // beast is Winged
// ideally, beast would be Legged && Winged here...
}
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">beastFoo</span><span class="pl-kos">(</span><span class="pl-s1">beast</span>: <span class="pl-smi">Beast</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-en">hasWings</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span> <span class="pl-c1">&&</span> <span class="pl-en">hasLegs</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">beast</span> <span class="pl-c">// beast is Legged</span>
<span class="pl-c">// ideally, beast would be Winged && Legged here...</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-en">hasLegs</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span> <span class="pl-c1">&&</span> <span class="pl-en">hasWings</span><span class="pl-kos">(</span><span class="pl-s1">beast</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">beast</span> <span class="pl-c">// beast is Winged</span>
<span class="pl-c">// ideally, beast would be Legged && Winged here...</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<hr>
<p dir="auto">In summary, in a block of code that is only reachable by passing multiple type guards (eg <code class="notranslate">isFoo(x) && isBar(x) && isBaz(x)</code>), the narrowed type inside that block would be the intersection of the narrowed types from the type guards (eg <code class="notranslate">x is Foo&Bar&Baz</code>).</p> | <p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.10</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// two interfaces
interface A {
a: string;
}
interface B {
b: string;
}
// a type guard for B
function isB(toTest: any): toTest is B {
return toTest && toTest.b;
}
// a function that turns an A into an A & B
function union(a: A): A & B {
if (isB(a)) {
return a;
} else {
return null;
}
}"><pre class="notranslate"><span class="pl-c">// two interfaces</span>
<span class="pl-k">interface</span> <span class="pl-smi">A</span> <span class="pl-kos">{</span>
<span class="pl-c1">a</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">interface</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span>
<span class="pl-c1">b</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// a type guard for B</span>
<span class="pl-k">function</span> <span class="pl-en">isB</span><span class="pl-kos">(</span><span class="pl-s1">toTest</span>: <span class="pl-smi">any</span><span class="pl-kos">)</span>: <span class="pl-s1">toTest</span> is <span class="pl-smi">B</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">toTest</span> <span class="pl-c1">&&</span> <span class="pl-s1">toTest</span><span class="pl-kos">.</span><span class="pl-c1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c">// a function that turns an A into an A & B</span>
<span class="pl-k">function</span> <span class="pl-en">union</span><span class="pl-kos">(</span><span class="pl-s1">a</span>: <span class="pl-smi">A</span><span class="pl-kos">)</span>: <span class="pl-smi">A</span> <span class="pl-c1">&</span> <span class="pl-smi">B</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-en">isB</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-c1">null</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto">I would expect this to compile successfully.</p>
<p dir="auto"><strong>Actual behavior:</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="test.ts(15,12): error TS2322: Type 'A' is not assignable to type 'A & B'.
Type 'A' is not assignable to type 'B'.
Property 'b' is missing in type 'A'."><pre class="notranslate"><code class="notranslate">test.ts(15,12): error TS2322: Type 'A' is not assignable to type 'A & B'.
Type 'A' is not assignable to type 'B'.
Property 'b' is missing in type 'A'.
</code></pre></div>
<p dir="auto">Inside the if-block, tsc has "forgotten" about the A-ness of <code class="notranslate">a</code>. This is a useful pattern if <code class="notranslate">b</code> is an expensive property to compute and you want to do different things if <code class="notranslate">b</code> is or is not present.</p> | 1 |
<h1 dir="auto">Environment</h1>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Windows build number: [Version 10.0.18362.175]
Windows Terminal version (if applicable): 0.2.1715.0"><pre lang="none" class="notranslate"><code class="notranslate">Windows build number: [Version 10.0.18362.175]
Windows Terminal version (if applicable): 0.2.1715.0
</code></pre></div>
<h1 dir="auto">Steps to reproduce</h1>
<ul dir="auto">
<li>Open the Windows Terminal</li>
<li>Open the Setting menu, either by pressing Ctrl + , or clicking on the Settings button in the dropdown menu next to the new tab button</li>
</ul>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">The Windows Terminal settings window showing up.</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">Windows asking me how do I want to open this file, specifying that it's a .json file in the "Always use this app to open .json files" ; see picture attached below.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/40464519/60073139-ed264780-971f-11e9-9dc1-89078e013b2b.png"><img src="https://user-images.githubusercontent.com/40464519/60073139-ed264780-971f-11e9-9dc1-89078e013b2b.png" alt="windows terminal settings bug" style="max-width: 100%;"></a></p> | <p dir="auto">When I press the settings on the Windows Terminal, it asks me how I want to open the .json file. So the settings won't open. Please help me</p> | 1 |
<p dir="auto">Hi,<br>
When try to make a multiline database query, the syntax colouration is bad...</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" $newUser = $db->prepare("INSERT INTO users".
"(id, realname, pseudo, email, pwd, isfirstvisit)".
"VALUES (:id,:realname,:pseudo,:email,:pwd,1)");
"><pre class="notranslate"> <span class="pl-s1"><span class="pl-c1">$</span>newUser</span> = <span class="pl-s1"><span class="pl-c1">$</span>db</span>-><span class="pl-en">prepare</span>("<span class="pl-s">INSERT INTO users</span>".
"<span class="pl-s">(id, realname, pseudo, email, pwd, isfirstvisit)</span>".
"<span class="pl-s">VALUES (:id,:realname,:pseudo,:email,:pwd,1)</span>");</pre></div>
<p dir="auto">(just like markdown :) )</p> | <p dir="auto">Tab spacing should be absolute, independent of any text on a given line.<br>
Currently, tab spacing is relative to the last 'word'. This makes it a little ridiculous to line up lines of text. As you can see, the tabs just don't like up at all.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/3362733/2905313/02474890-d604-11e3-93a9-9e73360b29f7.png"><img src="https://cloud.githubusercontent.com/assets/3362733/2905313/02474890-d604-11e3-93a9-9e73360b29f7.png" alt="buggy_tabs" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">Kind of an edge case I would say, but still it would be nice to get an error or have an automatic renaming of the columns. If a simple error is acceptable as a first step I could definitely put together a PR.</p>
<p dir="auto">The following snippet shows that when you concatenate a column of zeros and a column of ones the resulting dataframe has two columns of ones:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
import numpy as np
ts0 = pd.Series(np.zeros(5))
ts1 = pd.Series(np.ones(5))
ts0.name = ts1.name = 'same name'
df = pd.concat([ts0, ts1], axis=1)
print df"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">ts0</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">np</span>.<span class="pl-en">zeros</span>(<span class="pl-c1">5</span>))
<span class="pl-s1">ts1</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">Series</span>(<span class="pl-s1">np</span>.<span class="pl-en">ones</span>(<span class="pl-c1">5</span>))
<span class="pl-s1">ts0</span>.<span class="pl-s1">name</span> <span class="pl-c1">=</span> <span class="pl-s1">ts1</span>.<span class="pl-s1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'same name'</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-en">concat</span>([<span class="pl-s1">ts0</span>, <span class="pl-s1">ts1</span>], <span class="pl-s1">axis</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-k">print</span> <span class="pl-s1">df</span></pre></div>
<p dir="auto">and the output (pandas 0.10.1):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" same name same name
0 1 1
1 1 1
2 1 1
3 1 1
4 1 1"><pre class="notranslate"><code class="notranslate"> same name same name
0 1 1
1 1 1
2 1 1
3 1 1
4 1 1
</code></pre></div>
<p dir="auto">whereas I would expect:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" same name same name
0 0 1
1 0 1
2 0 1
3 0 1
4 0 1"><pre class="notranslate"><code class="notranslate"> same name same name
0 0 1
1 0 1
2 0 1
3 0 1
4 0 1
</code></pre></div>
<p dir="auto">Looks like this is due to <code class="notranslate">pandas.tools.merge._Concatenator._get_concat_axis</code> which doesn't check for name uniqueness, here is the relevant snippet:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="names = []
for x in self.objs:
if x.name is not None:
names.append(x.name)
else:
return Index(np.arange(len(self.objs))
return Index(names)"><pre class="notranslate"><span class="pl-s1">names</span> <span class="pl-c1">=</span> []
<span class="pl-k">for</span> <span class="pl-s1">x</span> <span class="pl-c1">in</span> <span class="pl-s1">self</span>.<span class="pl-s1">objs</span>:
<span class="pl-k">if</span> <span class="pl-s1">x</span>.<span class="pl-s1">name</span> <span class="pl-c1">is</span> <span class="pl-c1">not</span> <span class="pl-c1">None</span>:
<span class="pl-s1">names</span>.<span class="pl-en">append</span>(<span class="pl-s1">x</span>.<span class="pl-s1">name</span>)
<span class="pl-k">else</span>:
<span class="pl-k">return</span> <span class="pl-v">Index</span>(<span class="pl-s1">np</span>.<span class="pl-en">arange</span>(<span class="pl-en">len</span>(<span class="pl-s1">self</span>.<span class="pl-s1">objs</span>))
<span class="pl-s1">return</span> <span class="pl-v">Index</span>(<span class="pl-s1">names</span>)</pre></div> | <h3 dir="auto">Code Sample, a copy-pastable example if possible</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Note: This is not real Python code. I can't reproduce these problems with toy data, but they
# show up consistently with certain sets of real data.
from pandas import Series
vocabulary = Series(data = <a few thousand integers>, index = <a few thousand words/tokens, including u"null">)
new_vocab = Series(data = <a smaller list of integers>, index = <a smaller list of words, mostly overlapping with the first one, also including u"null">)
new_words = new_vocab.index.difference(vocabulary.index)
print u"null" is in vocabulary.index
print u"null" is in new_vocab.index
print u"null" is in new_words
> True
> True
> True
from pandas import DataFrame
matrix1 = DataFrame(data = <a bunch of numbers>, index = <list of topic names>, columns <list of words/tokens, _not_ including NaN or u"nan">)
matrix2 = DataFrame(data = <a bunch of numbers>, index = <list of topic names>, columns <list of words/tokens, _not_ including NaN or u"nan">)
matrix3 = matrix1.multiply(matrix2)
from numpy import NaN
print NaN in matrix1.columns
print u"nan" in matrix1.columns
print NaN in matrix2.columns
print u"nan" in matrix2.columns
print NaN in matrix3.columns
print u"nan" in matrix3.columns
> False
> False
> False
> False
> True
> True"><pre class="notranslate"><span class="pl-c"># Note: This is not real Python code. I can't reproduce these problems with toy data, but they</span>
<span class="pl-c"># show up consistently with certain sets of real data.</span>
<span class="pl-k">from</span> <span class="pl-s1">pandas</span> <span class="pl-k">import</span> <span class="pl-v">Series</span>
<span class="pl-s1">vocabulary</span> <span class="pl-c1">=</span> <span class="pl-v">Series</span>(<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">a</span> <span class="pl-s1">few</span> <span class="pl-s1">thousand</span> <span class="pl-s1">integers</span><span class="pl-c1">></span>, <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">a</span> <span class="pl-s1">few</span> <span class="pl-s1">thousand</span> <span class="pl-s1">words</span><span class="pl-c1">/</span><span class="pl-s1">tokens</span>, <span class="pl-s1">including</span> <span class="pl-s">u"null"</span><span class="pl-c1">></span>)
<span class="pl-s1">new_vocab</span> <span class="pl-c1">=</span> <span class="pl-v">Series</span>(<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">a</span> <span class="pl-s1">smaller</span> <span class="pl-s1">list</span> <span class="pl-s1">of</span> <span class="pl-s1">integers</span><span class="pl-c1">></span>, <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">a</span> <span class="pl-s1">smaller</span> <span class="pl-s1">list</span> <span class="pl-s1">of</span> <span class="pl-s1">words</span>, <span class="pl-s1">mostly</span> <span class="pl-s1">overlapping</span> <span class="pl-k">with</span> <span class="pl-s1">the</span> <span class="pl-s1">first</span> <span class="pl-s1">one</span>, <span class="pl-s1">also</span> <span class="pl-s1">including</span> <span class="pl-s">u"null"</span><span class="pl-c1">></span>)
<span class="pl-s1">new_words</span> <span class="pl-c1">=</span> <span class="pl-s1">new_vocab</span>.<span class="pl-s1">index</span>.<span class="pl-en">difference</span>(<span class="pl-s1">vocabulary</span>.<span class="pl-s1">index</span>)
<span class="pl-k">print</span> <span class="pl-s">u"null"</span> <span class="pl-c1">is</span> <span class="pl-s1">in</span> <span class="pl-s1">vocabulary</span>.<span class="pl-s1">index</span>
<span class="pl-k">print</span> <span class="pl-s">u"null"</span> <span class="pl-c1">is</span> <span class="pl-s1">in</span> <span class="pl-s1">new_vocab</span>.<span class="pl-s1">index</span>
<span class="pl-k">print</span> <span class="pl-s">u"null"</span> <span class="pl-c1">is</span> <span class="pl-s1">in</span> <span class="pl-s1">new_words</span>
<span class="pl-c1">></span> <span class="pl-c1">True</span><span class="pl-s1"></span>
<span class="pl-c1">></span> <span class="pl-c1">True</span>
<span class="pl-c1">></span> <span class="pl-c1">True</span>
<span class="pl-k">from</span> <span class="pl-s1">pandas</span> <span class="pl-k">import</span> <span class="pl-v">DataFrame</span>
<span class="pl-s1">matrix1</span> <span class="pl-c1">=</span> <span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">a</span> <span class="pl-s1">bunch</span> <span class="pl-s1">of</span> <span class="pl-s1">numbers</span><span class="pl-c1">></span>, <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">list</span> <span class="pl-s1">of</span> <span class="pl-s1">topic</span> <span class="pl-s1">names</span><span class="pl-c1">></span>, <span class="pl-s1">columns</span> <span class="pl-c1"><</span><span class="pl-s1">list</span> <span class="pl-s1">of</span> <span class="pl-s1">words</span><span class="pl-c1">/</span><span class="pl-s1">tokens</span>, <span class="pl-s1">_not_</span> <span class="pl-s1">including</span> <span class="pl-v">NaN</span> <span class="pl-c1">or</span> <span class="pl-s">u"nan"</span><span class="pl-c1">></span>)
<span class="pl-s1">matrix2</span> <span class="pl-c1">=</span> <span class="pl-v">DataFrame</span>(<span class="pl-s1">data</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">a</span> <span class="pl-s1">bunch</span> <span class="pl-s1">of</span> <span class="pl-s1">numbers</span><span class="pl-c1">></span>, <span class="pl-s1">index</span> <span class="pl-c1">=</span> <span class="pl-c1"><</span><span class="pl-s1">list</span> <span class="pl-s1">of</span> <span class="pl-s1">topic</span> <span class="pl-s1">names</span><span class="pl-c1">></span>, <span class="pl-s1">columns</span> <span class="pl-c1"><</span><span class="pl-s1">list</span> <span class="pl-s1">of</span> <span class="pl-s1">words</span><span class="pl-c1">/</span><span class="pl-s1">tokens</span>, <span class="pl-s1">_not_</span> <span class="pl-s1">including</span> <span class="pl-v">NaN</span> <span class="pl-c1">or</span> <span class="pl-s">u"nan"</span><span class="pl-c1">></span><span class="pl-s1"></span>)
<span class="pl-s1">matrix3</span> <span class="pl-c1">=</span> <span class="pl-s1">matrix1</span>.<span class="pl-en">multiply</span>(<span class="pl-s1">matrix2</span>)
<span class="pl-k">from</span> <span class="pl-s1">numpy</span> <span class="pl-k">import</span> <span class="pl-v">NaN</span>
<span class="pl-k">print</span> <span class="pl-v">NaN</span> <span class="pl-c1">in</span> <span class="pl-s1">matrix1</span>.<span class="pl-s1">columns</span>
<span class="pl-k">print</span> <span class="pl-s">u"nan"</span> <span class="pl-c1">in</span> <span class="pl-s1">matrix1</span>.<span class="pl-s1">columns</span>
<span class="pl-k">print</span> <span class="pl-v">NaN</span> <span class="pl-c1">in</span> <span class="pl-s1">matrix2</span>.<span class="pl-s1">columns</span>
<span class="pl-k">print</span> <span class="pl-s">u"nan"</span> <span class="pl-c1">in</span> <span class="pl-s1">matrix2</span>.<span class="pl-s1">columns</span>
<span class="pl-k">print</span> <span class="pl-v">NaN</span> <span class="pl-c1">in</span> <span class="pl-s1">matrix3</span>.<span class="pl-s1">columns</span>
<span class="pl-k">print</span> <span class="pl-s">u"nan"</span> <span class="pl-c1">in</span> <span class="pl-s1">matrix3</span>.<span class="pl-s1">columns</span><span class="pl-s1"></span>
<span class="pl-c1">></span> <span class="pl-c1">False</span><span class="pl-s1"></span>
<span class="pl-c1">></span> <span class="pl-c1">False</span><span class="pl-s1"></span>
<span class="pl-c1">></span> <span class="pl-c1">False</span><span class="pl-s1"></span>
<span class="pl-c1">></span> <span class="pl-c1">False</span><span class="pl-s1"></span>
<span class="pl-c1">></span> <span class="pl-c1">True</span>
<span class="pl-c1">></span> <span class="pl-c1">True</span></pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">This may be related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="285106859" data-permission-text="Title is private" data-url="https://github.com/pandas-dev/pandas/issues/18988" data-hovercard-type="issue" data-hovercard-url="/pandas-dev/pandas/issues/18988/hovercard" href="https://github.com/pandas-dev/pandas/issues/18988">#18988</a>.</p>
<p dir="auto">I feel bad about reporting these bugs, because I can't duplicate them outside actual scripts with actual (rather voluminous) data. The first common denominator to all the issues is that when I perform operations involving two objects, I end up with extra columns (in DataFrames) or elements (in Series or Indexes): sometimes duplicates of existing columns (but the second, duplicate column will contain all null values), sometimes entirely new columns/elements.</p>
<p dir="auto">The second common denominator is that every case seems to involve "null-like" index values: NaN, u"nan", u"null", u"n/a", and u"null.1.1" are the ones I've actually observed. In one case, u"null" creates a problem; in another u"null" works just fine, while u"n/a" and u"null.1.1" create problems (but u"null.1" doesn't). In a third case, the null-like values don't exist in the original objects, but show up after an operation, as new columns (interestingly, in this case, under pandas 20.3 I got two columns, NaN, and u"nan", while in pandas 22.0, I get those two plus u"n/a"--or actually, the "len" function is telling me there are four extra columns, but I using a "difference" method only gives me a list of three)--and they show up with some sets of data but not others.</p>
<p dir="auto">In each case where errors have shown up, I've added code to check for them and remove the spurious columns/elements, but it's been very frustrating to run down different problem that can occur.</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">[paste the output of <code class="notranslate">pd.show_versions()</code> here below this line]<br>
INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 2.7.14.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 94 Stepping 3, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.20.3<br>
pytest: 3.2.1<br>
pip: 9.0.1<br>
setuptools: 38.4.0<br>
Cython: 0.26.1<br>
numpy: 1.13.3<br>
scipy: 1.0.0<br>
xarray: None<br>
IPython: 5.4.1<br>
sphinx: 1.6.3<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.4.2<br>
numexpr: 2.6.4<br>
feather: None<br>
matplotlib: 2.1.0<br>
openpyxl: 2.4.8<br>
xlrd: 1.1.0<br>
xlwt: 1.3.0<br>
xlsxwriter: 1.0.2<br>
lxml: 4.1.0<br>
bs4: 4.6.0<br>
html5lib: 1.0.1<br>
sqlalchemy: 1.1.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details> | 0 |
<p dir="auto">For example, now I have a parameter 'D' in the model.</p>
<p dir="auto">Now I want to replace the 'D' with 'C', where 'C = a+b'</p> | <p dir="auto">For example, now I have a parameter 'D' in the model.</p>
<p dir="auto">Now I want to replace the 'D' with 'C', where 'C = a+b'. Is there anyway in pytorch that can achieve that replacement while keeping the backpropagation between 'C' and 'a+b'. (e.g., training the model will update the value of 'a' and 'b'.</p>
<p dir="auto">I've tried D.data = C, but obviously that just changed the value and violate the backpropagation. Besides, '.copy' and '.clone' didn't work either.</p> | 1 |
<p dir="auto">I want SerialPort communication on my application, but WebSerial is not implemented, so I thought I'd use the device file provided by the platform instead.<br>
That's where the problem came...</p>
<p dir="auto">I'm having trouble finding a way to abort reading a device file that never closes infinitely like this.<br>
Even if you forcibly specify the "ResourceID" and close the resource with <code class="notranslate">Promise.race()</code>, <code class="notranslate">setTimeout</code> or <code class="notranslate">std::async::delay()</code>, the "promise runaway" still could not be stopped.<br>
(Looking at <code class="notranslate">Deno.resource()</code> after closing, the resource was successfully closed.)</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {abortable, delay} from "[email protected]/async/mod.ts";
import {readAll, writeAll} from "[email protected]/streams/mod.ts";
const file = await Deno.open("COM1");
const ac = new AbortController();
// Successfully written
await writeAll(file, new TextEncoder().encode("AT\n"));
delay(1000).then(()=>{
ac.abort();
file.close();
// Successfully closed
console.trace(Deno.resources());
});
// Can't next on from here
const result = await abortable(readAll(file), ac);"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">abortable</span><span class="pl-kos">,</span> <span class="pl-s1">delay</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"[email protected]/async/mod.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">readAll</span><span class="pl-kos">,</span> <span class="pl-s1">writeAll</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"[email protected]/streams/mod.ts"</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">file</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">open</span><span class="pl-kos">(</span><span class="pl-s">"COM1"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">ac</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">AbortController</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Successfully written</span>
<span class="pl-k">await</span> <span class="pl-en">writeAll</span><span class="pl-kos">(</span><span class="pl-s1">file</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-smi">TextEncoder</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">encode</span><span class="pl-kos">(</span><span class="pl-s">"AT\n"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">delay</span><span class="pl-kos">(</span><span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-c1">=></span><span class="pl-kos">{</span>
<span class="pl-s1">ac</span><span class="pl-kos">.</span><span class="pl-en">abort</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">file</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Successfully closed</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">trace</span><span class="pl-kos">(</span><span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">resources</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// Can't next on from here</span>
<span class="pl-k">const</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-en">abortable</span><span class="pl-kos">(</span><span class="pl-en">readAll</span><span class="pl-kos">(</span><span class="pl-s1">file</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">ac</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This is something that can't be helped due to the internal specifications, so is there any other way to solve it than to ask them to add <code class="notranslate">AbortSignal</code> to <code class="notranslate">read()</code> or <code class="notranslate">write()</code> like <code class="notranslate">fetch()</code>?<br>
Or are there other workarounds?</p> | <p dir="auto">This will improve performance</p> | 0 |
<h5 dir="auto">Description of the problem</h5>
<ol dir="auto">
<li>The camera has a parent.</li>
<li>The parent sets the position.</li>
</ol>
<ul dir="auto">
<li><a href="https://stackblitz.com/edit/three-example" rel="nofollow">OrbitControls-example</a> (latest release branch)</li>
</ul>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Dev</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r114</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> macOS</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> iOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5> | <h5 dir="auto">Description of the problem</h5>
<p dir="auto"><code class="notranslate">OrbitControls</code> (and <code class="notranslate">TrackballControls</code>) break if the camera's parent is moving.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" movingObject.add(camera);
controls = new THREE.OrbitControls(camera);"><pre class="notranslate"><code class="notranslate"> movingObject.add(camera);
controls = new THREE.OrbitControls(camera);
</code></pre></div>
<p dir="auto">The expected behaviour: <a href="http://jsfiddle.net/lguminski/24ahxn5w/show" rel="nofollow">jsfiddle</a><br>
The actual behaviour: <a href="https://jsfiddle.net/lguminski/Lvt5y2m9/show" rel="nofollow">jsfiddle</a></p>
<p dir="auto">The problem is that <code class="notranslate">OrbitControls</code> operates in world's space (due to <code class="notranslate">Object3D.lookAt()</code> bound to world's space), but the camera is bound to its moving parent. As a result their is a conflict between camera world position set by mouse movements, and by camera's parent movement.</p>
<p dir="auto">The problem can be solved by introducing an additional camera (<a href="https://stackoverflow.com/a/53298655/1314907" rel="nofollow">Forcing OrbitControls to navigate around a moving object (stackoverflow)</a> ), but this is merely a workaround.</p>
<p dir="auto">I believe that the real root cause of the problem a little design flaw in the <code class="notranslate">Object3D.lookAt()</code> method used by <code class="notranslate">OrbitControls</code>. The method is a low-level function that takes a point (<code class="notranslate">x</code>, <code class="notranslate">y,</code>, <code class="notranslate">z</code>) argument without any information in the point's reference system. So it makes an assumption that the point is in world's coordinates, and the assumption is sometimes right, sometimes wrong (the <code class="notranslate">OrbitControls</code> case).</p>
<p dir="auto">Saying simply, I believe that the low-level method tries to be too smart.</p>
<p dir="auto">Suggested solution:</p>
<ol dir="auto">
<li>Making <code class="notranslate">Object3D.lookAt( x, y, z )</code> really simple by using parent's coordinates (<code class="notranslate">this.matrix</code>) instead of world coordinates (<code class="notranslate">this.matrixWorld</code>).
<ul dir="auto">
<li>after the modification<code class="notranslate">OrbitControls</code> starts respecting <code class="notranslate">camera.parent</code>.</li>
<li>this change is backwards compatible (except for r98 - more about it later), because for objects in world space <code class="notranslate">this.matrix</code> equals <code class="notranslate">this.matrixWorld</code>. Object's having a parent were not really supported anyway, and that was explicitly stated ("This method does not support objects with rotated and/or translated parent(s).")</li>
</ul>
</li>
<li>Introducing a new high-level method <code class="notranslate">Object3D.lookAtObject3D( object )</code>, which would have all information on target's coordinate system provided, because its argument is <code class="notranslate">THREE.Object3D</code>. Thus this method can deal with all complexities caused by parents' translations and rotations.</li>
</ol>
<p dir="auto">The code would look like this</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" lookAt: function () {
// This method operates relatively to object's parent
var q1 = new Quaternion();
var m1 = new Matrix4();
var target = new Vector3();
var position = new Vector3();
return function lookAt( x, y, z ) {
if ( x.isVector3 ) {
target.copy( x );
} else {
target.set( x, y, z );
}
this.updateMatrix();
position.setFromMatrixPosition( this.matrix );
if ( this.isCamera ) {
m1.lookAt( position, target, this.up );
} else {
m1.lookAt( target, position, this.up );
}
this.quaternion.setFromRotationMatrix( m1 );
};
}(),
lookAtObject3D: function () {
var m1 = new Matrix4();
var position = new Vector3();
var parentMatrix;
return function lookAtObject3D( object ) {
object.updateWorldMatrix( true, false );
if (this.parent) {
this.parent.updateWorldMatrix( true, false );
parentMatrix = this.parent.matrixWorld;
} else {
parentMatrix = m1.identity();
}
m1
.getInverse( parentMatrix )
.multiply( object.matrixWorld );
position.setFromMatrixPosition( m1 );
this.lookAt( position );
};
}(),"><pre class="notranslate"> <span class="pl-s1">lookAt</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// This method operates relatively to object's parent</span>
<span class="pl-k">var</span> <span class="pl-s1">q1</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Quaternion</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">m1</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Matrix4</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">target</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Vector3</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">position</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Vector3</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-en">lookAt</span><span class="pl-kos">(</span> <span class="pl-s1">x</span><span class="pl-kos">,</span> <span class="pl-s1">y</span><span class="pl-kos">,</span> <span class="pl-s1">z</span> <span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span> <span class="pl-s1">x</span><span class="pl-kos">.</span><span class="pl-c1">isVector3</span> <span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">target</span><span class="pl-kos">.</span><span class="pl-en">copy</span><span class="pl-kos">(</span> <span class="pl-s1">x</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-s1">target</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span> <span class="pl-s1">x</span><span class="pl-kos">,</span> <span class="pl-s1">y</span><span class="pl-kos">,</span> <span class="pl-s1">z</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">updateMatrix</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">position</span><span class="pl-kos">.</span><span class="pl-en">setFromMatrixPosition</span><span class="pl-kos">(</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">matrix</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">isCamera</span> <span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">m1</span><span class="pl-kos">.</span><span class="pl-en">lookAt</span><span class="pl-kos">(</span> <span class="pl-s1">position</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">up</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-s1">m1</span><span class="pl-kos">.</span><span class="pl-en">lookAt</span><span class="pl-kos">(</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">position</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">up</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">quaternion</span><span class="pl-kos">.</span><span class="pl-en">setFromRotationMatrix</span><span class="pl-kos">(</span> <span class="pl-s1">m1</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-s1">lookAtObject3D</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">m1</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Matrix4</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">position</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Vector3</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">parentMatrix</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-k">function</span> <span class="pl-en">lookAtObject3D</span><span class="pl-kos">(</span> <span class="pl-s1">object</span> <span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">object</span><span class="pl-kos">.</span><span class="pl-en">updateWorldMatrix</span><span class="pl-kos">(</span> <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">false</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parent</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parent</span><span class="pl-kos">.</span><span class="pl-en">updateWorldMatrix</span><span class="pl-kos">(</span> <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">false</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">parentMatrix</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">parent</span><span class="pl-kos">.</span><span class="pl-c1">matrixWorld</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-s1">parentMatrix</span> <span class="pl-c1">=</span> <span class="pl-s1">m1</span><span class="pl-kos">.</span><span class="pl-en">identity</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-s1">m1</span>
<span class="pl-kos">.</span><span class="pl-en">getInverse</span><span class="pl-kos">(</span> <span class="pl-s1">parentMatrix</span> <span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">multiply</span><span class="pl-kos">(</span> <span class="pl-s1">object</span><span class="pl-kos">.</span><span class="pl-c1">matrixWorld</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">position</span><span class="pl-kos">.</span><span class="pl-en">setFromMatrixPosition</span><span class="pl-kos">(</span> <span class="pl-s1">m1</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">lookAt</span><span class="pl-kos">(</span> <span class="pl-s1">position</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span></pre></div>
<p dir="auto">The only problem I can see is that the latest version (<code class="notranslate">r98</code>) started supporting rotated parents. But I don't think people started using it (perhaps except for <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/greggman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/greggman">@greggman</a> ), and the advantage of <code class="notranslate">Object3D.lookAtObject3D( object )</code> over <code class="notranslate">r98</code>'s <code class="notranslate">lookAt()</code> is that it supports any coordinate system (no matter how object's parents are rotated).</p>
<p dir="auto">Here are 2 examples showing how it would work:</p>
<ul dir="auto">
<li><a href="http://jsfiddle.net/lguminski/6fzkjndo/show" rel="nofollow">solar system (jsfiddle)</a> showing <code class="notranslate">OrbitControls</code> working with a moving object, and also using the new <code class="notranslate">Object3D.lookAtObject3D( object )</code> method</li>
<li><a href="https://jsfiddle.net/lguminski/7Lo43ctz/" rel="nofollow">a targetting tank (jsfiddle)</a> - this is the original example by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/greggman/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/greggman">@greggman</a> from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="342275284" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/14496" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/14496/hovercard" href="https://github.com/mrdoob/three.js/issues/14496">#14496</a> after my modification</li>
</ul>
<p dir="auto">An initial PR follows.</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> r98</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>
<p dir="auto"><strong>EDIT:</strong> code reformatted and added support for parentless objects (detached camera)</p> | 1 |
<p dir="auto">The new version of Sinon is throwing webpack for a loop again. This code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" function makePublicAPI(require, exports, module) {
module.exports = sinon;
sinon.spy = require("./sinon/spy");
sinon.spyCall = require("./sinon/call");
sinon.behavior = require("./sinon/behavior");
sinon.stub = require("./sinon/stub");
sinon.mock = require("./sinon/mock");
sinon.collection = require("./sinon/collection");
sinon.assert = require("./sinon/assert");
sinon.sandbox = require("./sinon/sandbox");
sinon.test = require("./sinon/test");
sinon.testCase = require("./sinon/test_case");
sinon.match = require("./sinon/match");
}
if (isAMD) {
define(makePublicAPI);
} else if (isNode) {
try {
formatio = require("formatio");
} catch (e) {}
makePublicAPI(require, exports, module); <========
}"><pre class="notranslate"> <span class="pl-k">function</span> <span class="pl-en">makePublicAPI</span><span class="pl-kos">(</span><span class="pl-s1">require</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-s1">module</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-s1">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-s1">sinon</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">spy</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/spy"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">spyCall</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/call"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">behavior</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/behavior"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">stub</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/stub"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">mock</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/mock"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">collection</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/collection"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">assert</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/assert"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">sandbox</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/sandbox"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">test</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/test"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">testCase</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/test_case"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">sinon</span><span class="pl-kos">.</span><span class="pl-c1">match</span> <span class="pl-c1">=</span> <span class="pl-s1">require</span><span class="pl-kos">(</span><span class="pl-s">"./sinon/match"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">isAMD</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">define</span><span class="pl-kos">(</span><span class="pl-s1">makePublicAPI</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">isNode</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">try</span> <span class="pl-kos">{</span>
<span class="pl-s1">formatio</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"formatio"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-en">makePublicAPI</span><span class="pl-kos">(</span><span class="pl-en">require</span><span class="pl-kos">,</span> <span class="pl-s1">exports</span><span class="pl-kos">,</span> <span class="pl-smi">module</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c1"><</span><span class="pl-c1">=</span><span class="pl-c1">===</span><span class="pl-c1">===</span><span class="pl-c1">=</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Is causing this warning:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="WARNING in ./~/sinon/lib/sinon.js
Critical dependencies:
365:22-29 require function is used in a way, in which dependencies cannot be statically extracted
@ ./~/sinon/lib/sinon.js 365:22-29"><pre class="notranslate"><code class="notranslate">WARNING in ./~/sinon/lib/sinon.js
Critical dependencies:
365:22-29 require function is used in a way, in which dependencies cannot be statically extracted
@ ./~/sinon/lib/sinon.js 365:22-29
</code></pre></div>
<p dir="auto">It's not obvious to me how to work around this. Any of you have any bright ideas?</p>
<p dir="auto">(the line number indicated in the error, 365, is clearly wrong, and the line with the arrow is actually the offending code)</p> | <p dir="auto"><strong>I'm submitting a bug report</strong></p>
<p dir="auto"><strong>Webpack version:</strong><br>
1.13.1</p>
<p dir="auto"><strong>Please tell us about your environment:</strong><br>
Linux</p>
<p dir="auto"><strong>Current behavior:</strong><br>
Trying to get code split between multiple entry points, with each entry point split into own code and vendor bundle, then commons extracted for both own code and vendor bundles.</p>
<p dir="auto">Entry points look like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" entry: {
login: './src/Login/index.jsx',
app: './src/index.jsx',
vendor: Object.keys(packageDotJson.dependencies).filter(function (element) {
return element !== 'font-awesome' && element !== 'jspdf';
}),
loginvendor: packageDotJson.loginDependencies
},"><pre class="notranslate"><code class="notranslate"> entry: {
login: './src/Login/index.jsx',
app: './src/index.jsx',
vendor: Object.keys(packageDotJson.dependencies).filter(function (element) {
return element !== 'font-awesome' && element !== 'jspdf';
}),
loginvendor: packageDotJson.loginDependencies
},
</code></pre></div>
<p dir="auto">The following works as expected:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
chunks: ["app"],
minChunks: Infinity
}),
new webpack.optimize.CommonsChunkPlugin({
name: "loginvendor",
chunks: ["login"],
minChunks: Infinity
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendor.commons",
chunks: ["vendor", "loginvendor"],
minChunks: 2
}),"><pre class="notranslate"><code class="notranslate"> new webpack.optimize.CommonsChunkPlugin({
name: "vendor",
chunks: ["app"],
minChunks: Infinity
}),
new webpack.optimize.CommonsChunkPlugin({
name: "loginvendor",
chunks: ["login"],
minChunks: Infinity
}),
new webpack.optimize.CommonsChunkPlugin({
name: "vendor.commons",
chunks: ["vendor", "loginvendor"],
minChunks: 2
}),
</code></pre></div>
<p dir="auto">Vendor bundles are extracted from each entry point bundle, then a common vendor bundle is extracted from the two vendor bundles.</p>
<p dir="auto">Grepping the build results for definitions of commonly used packages like babal-polyfill and React, they are correctly found only in vendor.commons file.</p>
<p dir="auto">Adding:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" new webpack.optimize.CommonsChunkPlugin({
name: "commons",
chunks: ["app", "login"],
minChunks: 2
}),"><pre class="notranslate"><code class="notranslate"> new webpack.optimize.CommonsChunkPlugin({
name: "commons",
chunks: ["app", "login"],
minChunks: 2
}),
</code></pre></div>
<p dir="auto">and testing for the same packages, we have:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="> grep -R "var React = {" ./dist -l
./dist/vendor.commons.080acb7415d897182eca.js
./dist/commons.080acb7415d897182eca.js"><pre class="notranslate"><code class="notranslate">> grep -R "var React = {" ./dist -l
./dist/vendor.commons.080acb7415d897182eca.js
./dist/commons.080acb7415d897182eca.js
</code></pre></div>
<p dir="auto">It seems the final invoking of the plugin is selecting the original app and login chunks, as they were before vendor modules were removed into vendor and loginvendor chunks.</p>
<p dir="auto"><strong>Expected/desired behavior:</strong><br>
Expecting</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" new webpack.optimize.CommonsChunkPlugin({
name: "commons",
chunks: ["app", "login"],
minChunks: 2
}),"><pre class="notranslate"><code class="notranslate"> new webpack.optimize.CommonsChunkPlugin({
name: "commons",
chunks: ["app", "login"],
minChunks: 2
}),
</code></pre></div>
<p dir="auto">to select the app and login chunks with vendor modules removed and extract the common modules from them into commons chunk. Vendor modules shouldn't appear both in commons and vendor.commons chunks.</p>
<ul dir="auto">
<li><strong>What is the motivation / use case for changing the behavior?</strong></li>
</ul>
<p dir="auto">It seems logical to expect that instances of the plugin will be ran sequentially and that every run will have access to chunks modified by the previous run.</p>
<p dir="auto">This specific use case if for production build. We need vendor code in separate bundles to avoid generating sourcemaps for it. Multiple entry points are needed to avoid serving a lot of unnecessary code to the user. Common modules are extracted to avoid duplication.</p>
<ul dir="auto">
<li><strong>Browser:</strong> [ Chrome 52.0.2743.116 (64-bit) ]</li>
<li><strong>Language:</strong> [ ES6/7 ]</li>
</ul> | 0 |
<p dir="auto">Not sure how this could be done but for our application we could run the same container 10 times on the same minion quite happily using different ports as it is lightweight. To load balance though we would need to map the ports back to appear as one service port. To allow other machines to talk to it easily.</p>
<p dir="auto">May be it could hang of the container port name and a matching regex on the pod name. So all pods that start Fred- with a port called http would be load balanced by the same service?</p> | <p dir="auto">IIUC, host port numbers in each pods are not important for replicated services in Kubernetes.<br>
From the perspective of orchestration, the important thing is port of service, but not port of pod.</p>
<p dir="auto">Also manual assignment of host port can be troublesome because spawn of container just fails if the container manifest specified a port which is already taken by other containers or Kubernetes daemons.</p>
<p dir="auto">So I propose the following enhancement.</p>
<ul dir="auto">
<li>Keep tracking taken ports in etcd</li>
<li>Allow omitting host port in container manifest
<ul dir="auto">
<li>If omitted, Kubelet automatically choose an available host port for each exposed container port.</li>
</ul>
</li>
</ul> | 1 |
<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Custom simple Keras sequential model with Conv1D dilated layers.</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary): Binary</li>
<li>TensorFlow version (use command below): Works in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410 but fails in tf-nightly-gpu-2.0-preview==2.0.0.dev20190504.</li>
<li>Python version: 3.7</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version: 10.0 (installed via conda)</li>
<li>GPU model and memory: Turing (2080 Ti)</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
The output shape is not inferred correctly anymore for a Keras Conv1D with dilation_rate != 1 (it is ok when dilation_rate = 1). Shape inference used to work as expected in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410.</p>
<p dir="auto"><strong>Describe the expected behavior</strong><br>
Please revert to the behaviour available in tf-nightly-gpu-2.0-preview==2.0.0.dev20190410</p>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
CORRECT behaviour with a dilation_rate=1:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="model = tf.keras.models.Sequential([
tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 1, padding='causal',
kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
tf.keras.layers.ReLU(),
tf.keras.layers.Dense(10),
tf.keras.layers.Softmax(),
])
model.summary()
Model: "sequential_2"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv1d_26 (Conv1D) (None, 2560, 24) 408
_________________________________________________________________
re_lu_23 (ReLU) (None, 2560, 24) 0
_________________________________________________________________
dense_3 (Dense) (None, 2560, 10) 250
_________________________________________________________________
softmax_2 (Softmax) (None, 2560, 10) 0
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0
_________________________________________________________________"><pre class="notranslate"><code class="notranslate">model = tf.keras.models.Sequential([
tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 1, padding='causal',
kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
tf.keras.layers.ReLU(),
tf.keras.layers.Dense(10),
tf.keras.layers.Softmax(),
])
model.summary()
Model: "sequential_2"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv1d_26 (Conv1D) (None, 2560, 24) 408
_________________________________________________________________
re_lu_23 (ReLU) (None, 2560, 24) 0
_________________________________________________________________
dense_3 (Dense) (None, 2560, 10) 250
_________________________________________________________________
softmax_2 (Softmax) (None, 2560, 10) 0
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0
_________________________________________________________________
</code></pre></div>
<p dir="auto">Shape inference FAILS with a dilation_rate=2 (or >1): The second dimension of the output shape's is lost,</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="model = tf.keras.models.Sequential([
tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 2, padding='causal',
kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
tf.keras.layers.ReLU(),
tf.keras.layers.Dense(10),
tf.keras.layers.Softmax(),
])
model.summary()
Model: "sequential_3"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv1d_27 (Conv1D) (None, None, 24) 408
_________________________________________________________________
re_lu_24 (ReLU) (None, None, 24) 0
_________________________________________________________________
dense_4 (Dense) (None, None, 10) 250
_________________________________________________________________
softmax_3 (Softmax) (None, None, 10) 0
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0"><pre class="notranslate"><code class="notranslate">model = tf.keras.models.Sequential([
tf.keras.layers.Conv1D(24, kernel_size = 2, dilation_rate = 2, padding='causal',
kernel_regularizer=tfk.regularizers.l2(0.01), input_shape=(2560, 8)),
tf.keras.layers.ReLU(),
tf.keras.layers.Dense(10),
tf.keras.layers.Softmax(),
])
model.summary()
Model: "sequential_3"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv1d_27 (Conv1D) (None, None, 24) 408
_________________________________________________________________
re_lu_24 (ReLU) (None, None, 24) 0
_________________________________________________________________
dense_4 (Dense) (None, None, 10) 250
_________________________________________________________________
softmax_3 (Softmax) (None, None, 10) 0
=================================================================
Total params: 658
Trainable params: 658
Non-trainable params: 0
</code></pre></div>
<p dir="auto">Please note that the behaviour in 20190410 was correct independently of the dilation_rate.</p>
<p dir="auto"><strong>Other info / logs</strong><br>
This causes more issues downstream as one can't concatenate or sum outputs w.r.t the axis with the unknown shape.</p> | <p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): colab</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</li>
<li>TensorFlow installed from (source or binary): tensorflow-gpu==2.0.0-beta1 colab</li>
<li>TensorFlow version (use command below):tensorflow-gpu==2.0.0-beta1</li>
<li>Python version: pip3</li>
<li>Bazel version (if compiling from source):</li>
<li>GCC/Compiler version (if compiling from source):</li>
<li>CUDA/cuDNN version: colab</li>
<li>GPU model and memory:</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
if tf.keras.layers.Conv2D is used with dilation_rate param > 1 it returns tensors with shape None!</p> | 1 |
<p dir="auto">The latest stable release of Next is 4.2.3, but 3.2.3 is listed as the latest release in <a href="https://github.com/zeit/next.js/releases">https://github.com/zeit/next.js/releases</a></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">The latest release on the releases page should be 4.2.3</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto"><a href="https://github.com/zeit/next.js/releases">The latest release on the releases page is 3.2.3</a></p>
<p dir="auto">It looks like maybe the security release was backported which was why the new version was released.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto">N/A</p>
<h2 dir="auto">Context</h2>
<p dir="auto">I was upgrading next.js in my package.json and needed to know what number to upgrade it to.</p>
<h2 dir="auto">Your Environment</h2>
<p dir="auto">N/A</p> | <p dir="auto">Following the instructions in README to listen to route events doesn't work</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">It should be called and I should see the console logs</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Nothing</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Add the code (either in pages/*.js or pages/_document.js)</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// onRouteChangeStart(url) - Fires when a route starts to change
Router.onRouteChangeStart = (url) => {
console.log('App is changing to: ', url)
}
// onRouteChangeComplete(url) - Fires when a route changed completely
Router.onRouteChangeComplete = (url) => {
console.log('App has changed to: ', url)
}
// onRouteChangeError(err, url) - Fires when there's an error when changing routes
Router.onRouteChangeError = (err, url) => {
console.log('App has error when changing: ', err, url)
}
// onBeforeHistoryChange(url) - Fires just before changing the browser's history
Router.onBeforeHistoryChange = (url) => {
console.log('App is changing to before history change: ', err, url)
}
// onAppUpdated(nextRoute) - Fires when switching pages and there's a new version of the app
Router.onAppUpdated = (nextRoute) => {
console.log('App is updating to: ', nextRoute)
}"><pre class="notranslate"><code class="notranslate">// onRouteChangeStart(url) - Fires when a route starts to change
Router.onRouteChangeStart = (url) => {
console.log('App is changing to: ', url)
}
// onRouteChangeComplete(url) - Fires when a route changed completely
Router.onRouteChangeComplete = (url) => {
console.log('App has changed to: ', url)
}
// onRouteChangeError(err, url) - Fires when there's an error when changing routes
Router.onRouteChangeError = (err, url) => {
console.log('App has error when changing: ', err, url)
}
// onBeforeHistoryChange(url) - Fires just before changing the browser's history
Router.onBeforeHistoryChange = (url) => {
console.log('App is changing to before history change: ', err, url)
}
// onAppUpdated(nextRoute) - Fires when switching pages and there's a new version of the app
Router.onAppUpdated = (nextRoute) => {
console.log('App is updating to: ', nextRoute)
}
</code></pre></div>
<ol start="2" dir="auto">
<li>Refresh the page, and click around and add some Router.push events</li>
<li>Nothing in inspector</li>
<li>??</li>
</ol>
<h2 dir="auto">Context</h2>
<p dir="auto">I can't use this to track pageviews for my in-house analytics system.</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>2.4.6</td>
</tr>
<tr>
<td>node</td>
<td>8.1.3</td>
</tr>
<tr>
<td>OS</td>
<td>10.12.5</td>
</tr>
<tr>
<td>browser</td>
<td>chrome 60.0.3112.72 (Official Build) beta (64-bit)</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto">1: go version go1.5.1 darwin/amd64<br>
2: OSX 10.11 MacPro6,1Quad-Core Intel Xeon E5<br>
3: Minimal program to create an invalid go binary on OSX using codesign tool.</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package main
import "C" // Delete this line and codesign'd binary works.
func main() {
println("Hello OSX.")
}"><pre class="notranslate"><span class="pl-k">package</span> main
<span class="pl-k">import</span> <span class="pl-s">"C"</span> <span class="pl-c">// Delete this line and codesign'd binary works.</span>
<span class="pl-k">func</span> <span class="pl-en">main</span>() {
<span class="pl-en">println</span>(<span class="pl-s">"Hello OSX."</span>)
}</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~/code/src/ttt: go build
~/code/src/ttt: ./ttt
Hello OSX.
~/code/src/ttt: codesign -s "Developer ID Application: Name" ttt
~/code/src/ttt: ./ttt
Killed: 9"><pre class="notranslate"><code class="notranslate">~/code/src/ttt: go build
~/code/src/ttt: ./ttt
Hello OSX.
~/code/src/ttt: codesign -s "Developer ID Application: Name" ttt
~/code/src/ttt: ./ttt
Killed: 9
</code></pre></div>
<p dir="auto">4: The program should run successfully after code signing. This used to work prior to OSX 10.11.<br>
5: All of my OSX Go products depend on Cgo. Still looking for a workaround.<br>
Possibly related to issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="107376837" data-permission-text="Title is private" data-url="https://github.com/golang/go/issues/12700" data-hovercard-type="issue" data-hovercard-url="/golang/go/issues/12700/hovercard" href="https://github.com/golang/go/issues/12700">#12700</a></p> | <p dir="auto">Using the Go 1.5 compiler toolchain and compiling a binary that uses CGO and then <code class="notranslate">codesign</code>ing that binary, upon attempting to execute the program it will be killed immediately by the system. Codesigning a non-cgo binary works just fine, as expected.</p>
<p dir="auto">Given the following small program:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="package main
/*
int
cfunc() {
return 2;
}
*/
import "C"
import "fmt"
func main() {
fmt.Println("cfunc says:", C.cfunc())
}"><pre class="notranslate"><span class="pl-k">package</span> main
<span class="pl-c">/*</span>
<span class="pl-c">int</span>
<span class="pl-c">cfunc() {</span>
<span class="pl-c"> return 2;</span>
<span class="pl-c">}</span>
<span class="pl-c">*/</span>
<span class="pl-k">import</span> <span class="pl-s">"C"</span>
<span class="pl-k">import</span> <span class="pl-s">"fmt"</span>
<span class="pl-k">func</span> <span class="pl-en">main</span>() {
<span class="pl-s1">fmt</span>.<span class="pl-en">Println</span>(<span class="pl-s">"cfunc says:"</span>, <span class="pl-s1">C</span>.<span class="pl-en">cfunc</span>())
}</pre></div>
<p dir="auto">and building simply with <code class="notranslate">go build</code> and running <code class="notranslate">codesign -f -s my_cert ./myprog</code>, when attempting to execute the program in a shell the response is "killed: ./myprog".</p>
<p dir="auto">The system log reports:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ taskgated[92]: no signature for pid=1991 (cannot make code: UNIX[No such process])"><pre class="notranslate"><code class="notranslate">$ taskgated[92]: no signature for pid=1991 (cannot make code: UNIX[No such process])
</code></pre></div>
<p dir="auto">Tested against Go1.5beta2 and:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ go version devel +765cea2 Mon Jul 27 18:03:45 2015 +0000 darwin/amd64"><pre class="notranslate"><code class="notranslate">$ go version devel +765cea2 Mon Jul 27 18:03:45 2015 +0000 darwin/amd64
</code></pre></div> | 1 |
<p dir="auto">Why Typescript has not the static classes like in Java, while Javascript has supported this.</p>
<p dir="auto">If I wrote in JS:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" var ParentClass = (function () {
function ParentClass() {
}
ParentClass.prototype.someMethod = function () {
};
ParentClass.StaticClass = (function () {
function StaticClass() {
}
StaticClass.prototype.someMethodInStaticClass = function () {
return "Hello, " + this.greeting;
};
return StaticClass;
})();
return ParentClass;
})();
var entity = new ParentClass.StaticClass();
console.log(entity instanceof ParentClass.StaticClass); // true"><pre class="notranslate"> <span class="pl-k">var</span> <span class="pl-v">ParentClass</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">function</span> <span class="pl-v">ParentClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">someMethod</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">function</span> <span class="pl-v">StaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-v">StaticClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">someMethodInStaticClass</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s">"Hello, "</span> <span class="pl-c1">+</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">greeting</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-v">StaticClass</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-v">ParentClass</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">entity</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">entity</span> <span class="pl-k">instanceof</span> <span class="pl-v">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// true</span></pre></div>
<p dir="auto">This is correct, but:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" class parentClass {
someMethod() {}
{static} class StaticClass {
someMethodInStaticClass() {}
}
}
var entity = new ParentClass.StaticClass();
console.log(entity instanceof ParentClass.StaticClass); // true"><pre class="notranslate"> <span class="pl-k">class</span> <span class="pl-smi">parentClass</span> <span class="pl-kos">{</span>
<span class="pl-en">someMethod</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos"></span>
<span class="pl-kos">{</span><span class="pl-s1">static</span><span class="pl-kos">}</span> <span class="pl-k">class</span> <span class="pl-smi">StaticClass</span> <span class="pl-kos">{</span>
<span class="pl-en">someMethodInStaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">entity</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">entity</span> <span class="pl-k">instanceof</span> <span class="pl-smi">ParentClass</span><span class="pl-kos">.</span><span class="pl-c1">StaticClass</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// true</span></pre></div>
<p dir="auto">This is incorrect although it can compile into silimar JS.</p>
<p dir="auto">P.S. I'm sorry for bad markup</p> | <h1 dir="auto">Introduction</h1>
<p dir="auto">Currently, in TypeScript, we support only one of the two styles of creating classes in ES6 - that of class declarations. This proposal adds support for the other style, class expressions. This will fill our support for classes in ES6 and help bring us in alignment with both styles.</p>
<h1 dir="auto">Class Expressions vs Class Declarations</h1>
<p dir="auto">Class expressions work a little differently than class declarations. Here's a list of the highlights:</p>
<ul dir="auto">
<li>Class expressions have an optional 'BindingIdentifier' or class name. This allows them to create anonymous classes, or name them, as the programmer sees fit.</li>
<li>Unlike class declarations, class expressions with a name do not introduce this name to the lexical scope outside of the class. The class name of a class expression is only visible inside the body of the class expression.</li>
<li>Unlike class declarations, class expressions would not create named types in the lexical scope outside of the class. Instead, the named type would only be visible inside the class expression, bound to the class name. Outside of the class expression, they would have anonymous types with the shape of the constructor function.</li>
</ul>
<p dir="auto">Just as with class declarations, class expressions would create a constructor function that can be used to construct instances. Like class declarations, you may also declare property members and index members, as well as use the constructor parameters.</p>
<h1 dir="auto">Examples</h1>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var Rect = class {
area: number;
constructor(public length: number, public width: number) {
this.area = this.length * this.width;
}
}
var rect = new Rect(5, 10);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-smi">Rect</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-kos">{</span>
<span class="pl-c1">area</span>: <span class="pl-smi">number</span><span class="pl-kos">;</span>
<span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-k">public</span> <span class="pl-s1">length</span>: <span class="pl-smi">number</span><span class="pl-kos">,</span> <span class="pl-k">public</span> <span class="pl-s1">width</span>: <span class="pl-smi">number</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">area</span> <span class="pl-c1">=</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">*</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">width</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">rect</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Rect</span><span class="pl-kos">(</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var MyNode = class Node {
next: Node;
set nextNode(node: Node) {
this.next = node;
}
constructor() { }
}
var node = new MyNode();
var nextNode = new MyNode();
node.nextNode = nextNode;"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-smi">MyNode</span> <span class="pl-c1">=</span> <span class="pl-k">class</span> <span class="pl-smi">Node</span> <span class="pl-kos">{</span>
<span class="pl-c1">next</span>: <span class="pl-smi">Node</span><span class="pl-kos">;</span>
<span class="pl-k">set</span> <span class="pl-en">nextNode</span><span class="pl-kos">(</span><span class="pl-s1">node</span>: <span class="pl-smi">Node</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">next</span> <span class="pl-c1">=</span> <span class="pl-s1">node</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">node</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">MyNode</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">nextNode</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">MyNode</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">node</span><span class="pl-kos">.</span><span class="pl-c1">nextNode</span> <span class="pl-c1">=</span> <span class="pl-s1">nextNode</span><span class="pl-kos">;</span></pre></div>
<h1 dir="auto">Emit</h1>
<p dir="auto">Class expressions, just like class declarations, create a constructor function. We would emit them similarly to how we do now, with the exception that they are not immediately bound to a variable. Instead, they create the function expression (IIFE) that builds the constructor function, and allows the developer to assign the result of this expression where appropriate.</p>
<h1 dir="auto">Emit of .d.ts</h1>
<p dir="auto">The type emitted for class expressions is the object literal representation of the constructor functions, just as with other anonymous types.</p>
<p dir="auto">Class expressions can also introduce recursion in the type literal. Anonymous types that have possibly recursive components (like the Node example above) will need special treatment, which should be part of a related spec (<strong>Edit:</strong> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40960217" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/517" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/517/hovercard" href="https://github.com/microsoft/TypeScript/issues/517">#517</a>).</p> | 1 |
<p dir="auto">Please:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Check for duplicate requests.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Describe your goal, and if possible provide a code snippet with a motivating example.</li>
</ul>
<p dir="auto">This grew oddly specific, but really I just want to make a generalized function benchmark, we give it data and functions and a maximum timeout, it gives us the grid of results = function(data) and elapsed times, and stops the functions if they run longer than the maximum timeout. Could be cool if we could jit-compile that sort of "outer loop" since longer function runtimes would seem worse for users and the environment and faster benchmarks could also yield better feedback on performance tuning both Jax and stuff written with Jax.</p>
<p dir="auto">Inspired by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3670702" data-permission-text="Title is private" data-url="https://github.com/google/jax/discussions/8477" data-hovercard-type="discussion" data-hovercard-url="/google/jax/discussions/8477/hovercard" href="https://github.com/google/jax/discussions/8477">#8477</a> with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jakevdp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jakevdp">@jakevdp</a> - Here's how it might look. 1st benchmark is python. 2nd benchmark w/ jit doesn't work now but i wish i could figure out how to make it work)</p>
<p dir="auto">How could we make it easier to compile benchmarks like these and work with elapsed time / function timeouts inside jax.jit?</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""goal: play with compiled benchmarks for compiled functions in jax"
from functools import partial
from itertools import product
from typing import Callable, List, Tuple
from time import perf_counter
from func_timeout import func_timeout
from pydantic import BaseSettings
import pandas as pd
import jax
jnp = jax.numpy
jit = jax.jit
# config
class Environment(BaseSettings):
n_x: List[int] = [4, 8, 16, 32, 64, 128, 256, 512, 1024]
min_weight: float = -1.0
max_weight: float = 1.0
n_trials: int = 10
timeout_seconds: int = 30
seed: int = 42
env = Environment()
# types
PRNGKey = jax._src.random.PRNGKey
Array = jnp.ndarray
# functions - 'benchmark'
def benchmark_no_jit(
x: Array,
functions: List[Callable],
timeout_seconds: int = env.timeout_seconds,
min_weight: float = env.min_weight,
max_weight: float = env.max_weight,
) -> Tuple[Array, Array]:
n_x = x.shape[0]
n_functions = len(functions)
outputs = jnp.empty((n_functions + 1, n_x)).at[-1, :].set(1.0)
timings = jnp.empty(n_functions)
for i, fun in enumerate(functions):
try:
# Without JIT, we can use func_timeout to set timeouts
# and measure runtime with time.perf_counter
start = perf_counter()
y = func_timeout(timeout_seconds, fun, args=(x,))
elapsed = perf_counter() - start
y = y if isinstance(y, Array) and y.shape[0] == n_x else 0
except Exception as e:
print(e)
y, elapsed = 0, timeout
outputs = outputs.at[i, :].set(y)
timings = timings.at[i].set(elapsed)
outputs = jnp.nan_to_num(
jnp.clip(outputs, a_min=min_weight, a_max=max_weight)
).transpose()
return outputs, timings
# something like this...
@partial(jit, static_argnums=(0,1))
def _benchmark_with_jit(
n_x: int,
n_functions: int,
x: Array,
functions: List[Callable],
timeout_seconds: int = env.timeout_seconds,
min_weight: float = env.min_weight,
max_weight: float = env.max_weight,
) -> Tuple[Array, Array]:
outputs = jnp.empty((n_functions + 1, n_x)).at[-1, :].set(1.0)
timings = jnp.empty(n_functions)
for i, fun in enumerate(functions):
try:
with jax.profiler.trace() as trace:
# 1: set function timeouts / time limits (otherwise, search time is infinite)
y = trace.timeout(timeout_seconds, fun, args=(x,))
# 2: measure how long functions take to run (to find faster functions)
elapsed = trace.elapsed()
y = y if isinstance(y, Array) and y.shape[0] == n_x else 0
except Exception as _:
y, elapsed = 0, timeout
outputs = outputs.at[i, :].set(y)
timings = timings.at[i].set(elapsed)
outputs = jnp.nan_to_num(
jnp.clip(outputs, a_min=min_weight, a_max=max_weight)
).transpose()
return outputs, timings
def f1(x: Array) -> Array:
return x ** 2 - 1
def f2(x: Array) -> Array:
return x / 2
def f3(x: Array) -> Array:
return x ** 3 * jnp.sin(x)
functions = [jit(f) for f in (f1, f2, f3)]
# because we can
def benchmark_benchmark(
benchmark: Callable = benchmark_no_jit,
words: str = "Python + func_timeout + time.perf_counter",
functions: List[Callable] = functions,
N_x: List[int] = env.n_x,
seed: int = env.seed,
) -> float:
n_functions = len(functions)
begin = perf_counter()
rng = PRNGKey(seed)
df = [] # i admit to sucking at pandas
for i, n_x in product(range(env.n_trials), N_x):
rng, key = jax.random.split(rng)
x = jax.random.normal(key, (n_x,))
if isinstance(benchmark, dict):
print("n_x", n_x)
benchmark = benchmark[n_x]
print("benchmark", benchmark)
print("x", x)
outputs, timings = benchmark(x, functions)
# print(timings)
# print(outputs.shape)
# print(i, n_x, timings)
assert outputs.shape == (n_x, n_functions + 1)
assert timings.shape == (n_functions,)
assert (timings > 0).all()
assert (timings < env.timeout).all()
assert (env.min_weight <= outputs).all()
assert (env.max_weight >= outputs).all()
# print(f"All assertions passed.")
df.append(
{
"n_x": n_x,
"i": i,
**{f"f{i+1} elapsed": t for i, t in enumerate(timings)},
}
)
df = pd.DataFrame(df).set_index(["n_x", "i"])
elapsed = perf_counter() - begin
print(df)
print(f"{words} took {elapsed:.2f} seconds")
return elapsed
def test_jax_benchmarks():
elapsed_no_jit = benchmark_benchmark()
elapsed_with_jit = benchmark_benchmark(
benchmark={
n: partial(_benchmark_with_jit, n_x=n, n_functions=len(functions))
for n in env.n_x
},
words="XLA (jax.jit) + jax.profiler.trace",
)
print("done!")
if __name__ == "__main__":
test_jax_benchmarks()"><pre class="notranslate"><span class="pl-s">"goal: play with compiled benchmarks for compiled functions in jax"</span>
<span class="pl-k">from</span> <span class="pl-s1">functools</span> <span class="pl-k">import</span> <span class="pl-s1">partial</span>
<span class="pl-k">from</span> <span class="pl-s1">itertools</span> <span class="pl-k">import</span> <span class="pl-s1">product</span>
<span class="pl-k">from</span> <span class="pl-s1">typing</span> <span class="pl-k">import</span> <span class="pl-v">Callable</span>, <span class="pl-v">List</span>, <span class="pl-v">Tuple</span>
<span class="pl-k">from</span> <span class="pl-s1">time</span> <span class="pl-k">import</span> <span class="pl-s1">perf_counter</span>
<span class="pl-k">from</span> <span class="pl-s1">func_timeout</span> <span class="pl-k">import</span> <span class="pl-s1">func_timeout</span>
<span class="pl-k">from</span> <span class="pl-s1">pydantic</span> <span class="pl-k">import</span> <span class="pl-v">BaseSettings</span>
<span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">jax</span>
<span class="pl-s1">jnp</span> <span class="pl-c1">=</span> <span class="pl-s1">jax</span>.<span class="pl-s1">numpy</span>
<span class="pl-s1">jit</span> <span class="pl-c1">=</span> <span class="pl-s1">jax</span>.<span class="pl-s1">jit</span>
<span class="pl-c"># config</span>
<span class="pl-k">class</span> <span class="pl-v">Environment</span>(<span class="pl-v">BaseSettings</span>):
<span class="pl-s1">n_x</span>: <span class="pl-v">List</span>[<span class="pl-s1">int</span>] <span class="pl-c1">=</span> [<span class="pl-c1">4</span>, <span class="pl-c1">8</span>, <span class="pl-c1">16</span>, <span class="pl-c1">32</span>, <span class="pl-c1">64</span>, <span class="pl-c1">128</span>, <span class="pl-c1">256</span>, <span class="pl-c1">512</span>, <span class="pl-c1">1024</span>]
<span class="pl-s1">min_weight</span>: <span class="pl-s1">float</span> <span class="pl-c1">=</span> <span class="pl-c1">-</span><span class="pl-c1">1.0</span>
<span class="pl-s1">max_weight</span>: <span class="pl-s1">float</span> <span class="pl-c1">=</span> <span class="pl-c1">1.0</span>
<span class="pl-s1">n_trials</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span>
<span class="pl-s1">timeout_seconds</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-c1">30</span>
<span class="pl-s1">seed</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-c1">42</span>
<span class="pl-s1">env</span> <span class="pl-c1">=</span> <span class="pl-v">Environment</span>()
<span class="pl-c"># types</span>
<span class="pl-v">PRNGKey</span> <span class="pl-c1">=</span> <span class="pl-s1">jax</span>.<span class="pl-s1">_src</span>.<span class="pl-s1">random</span>.<span class="pl-v">PRNGKey</span>
<span class="pl-v">Array</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-s1">ndarray</span>
<span class="pl-c"># functions - 'benchmark'</span>
<span class="pl-k">def</span> <span class="pl-en">benchmark_no_jit</span>(
<span class="pl-s1">x</span>: <span class="pl-v">Array</span>,
<span class="pl-s1">functions</span>: <span class="pl-v">List</span>[<span class="pl-v">Callable</span>],
<span class="pl-s1">timeout_seconds</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">timeout_seconds</span>,
<span class="pl-s1">min_weight</span>: <span class="pl-s1">float</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">min_weight</span>,
<span class="pl-s1">max_weight</span>: <span class="pl-s1">float</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">max_weight</span>,
) <span class="pl-c1">-></span> <span class="pl-v">Tuple</span>[<span class="pl-v">Array</span>, <span class="pl-v">Array</span>]:
<span class="pl-s1">n_x</span> <span class="pl-c1">=</span> <span class="pl-s1">x</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>]
<span class="pl-s1">n_functions</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">functions</span>)
<span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">empty</span>((<span class="pl-s1">n_functions</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>, <span class="pl-s1">n_x</span>)).<span class="pl-s1">at</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, :].<span class="pl-en">set</span>(<span class="pl-c1">1.0</span>)
<span class="pl-s1">timings</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">empty</span>(<span class="pl-s1">n_functions</span>)
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">fun</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">functions</span>):
<span class="pl-k">try</span>:
<span class="pl-c"># Without JIT, we can use func_timeout to set timeouts</span>
<span class="pl-c"># and measure runtime with time.perf_counter</span>
<span class="pl-s1">start</span> <span class="pl-c1">=</span> <span class="pl-en">perf_counter</span>()
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-en">func_timeout</span>(<span class="pl-s1">timeout_seconds</span>, <span class="pl-s1">fun</span>, <span class="pl-s1">args</span><span class="pl-c1">=</span>(<span class="pl-s1">x</span>,))
<span class="pl-s1">elapsed</span> <span class="pl-c1">=</span> <span class="pl-en">perf_counter</span>() <span class="pl-c1">-</span> <span class="pl-s1">start</span>
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span> <span class="pl-k">if</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">y</span>, <span class="pl-v">Array</span>) <span class="pl-c1">and</span> <span class="pl-s1">y</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>] <span class="pl-c1">==</span> <span class="pl-s1">n_x</span> <span class="pl-k">else</span> <span class="pl-c1">0</span>
<span class="pl-k">except</span> <span class="pl-v">Exception</span> <span class="pl-k">as</span> <span class="pl-s1">e</span>:
<span class="pl-en">print</span>(<span class="pl-s1">e</span>)
<span class="pl-s1">y</span>, <span class="pl-s1">elapsed</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>, <span class="pl-s1">timeout</span>
<span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">outputs</span>.<span class="pl-s1">at</span>[<span class="pl-s1">i</span>, :].<span class="pl-en">set</span>(<span class="pl-s1">y</span>)
<span class="pl-s1">timings</span> <span class="pl-c1">=</span> <span class="pl-s1">timings</span>.<span class="pl-s1">at</span>[<span class="pl-s1">i</span>].<span class="pl-en">set</span>(<span class="pl-s1">elapsed</span>)
<span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">nan_to_num</span>(
<span class="pl-s1">jnp</span>.<span class="pl-en">clip</span>(<span class="pl-s1">outputs</span>, <span class="pl-s1">a_min</span><span class="pl-c1">=</span><span class="pl-s1">min_weight</span>, <span class="pl-s1">a_max</span><span class="pl-c1">=</span><span class="pl-s1">max_weight</span>)
).<span class="pl-en">transpose</span>()
<span class="pl-k">return</span> <span class="pl-s1">outputs</span>, <span class="pl-s1">timings</span>
<span class="pl-c"># something like this...</span>
<span class="pl-en">@<span class="pl-en">partial</span>(<span class="pl-s1">jit</span>, <span class="pl-s1">static_argnums</span><span class="pl-c1">=</span>(<span class="pl-c1">0</span>,<span class="pl-c1">1</span>))</span>
<span class="pl-k">def</span> <span class="pl-en">_benchmark_with_jit</span>(
<span class="pl-s1">n_x</span>: <span class="pl-s1">int</span>,
<span class="pl-s1">n_functions</span>: <span class="pl-s1">int</span>,
<span class="pl-s1">x</span>: <span class="pl-v">Array</span>,
<span class="pl-s1">functions</span>: <span class="pl-v">List</span>[<span class="pl-v">Callable</span>],
<span class="pl-s1">timeout_seconds</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">timeout_seconds</span>,
<span class="pl-s1">min_weight</span>: <span class="pl-s1">float</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">min_weight</span>,
<span class="pl-s1">max_weight</span>: <span class="pl-s1">float</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">max_weight</span>,
) <span class="pl-c1">-></span> <span class="pl-v">Tuple</span>[<span class="pl-v">Array</span>, <span class="pl-v">Array</span>]:
<span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">empty</span>((<span class="pl-s1">n_functions</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>, <span class="pl-s1">n_x</span>)).<span class="pl-s1">at</span>[<span class="pl-c1">-</span><span class="pl-c1">1</span>, :].<span class="pl-en">set</span>(<span class="pl-c1">1.0</span>)
<span class="pl-s1">timings</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">empty</span>(<span class="pl-s1">n_functions</span>)
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">fun</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">functions</span>):
<span class="pl-k">try</span>:
<span class="pl-k">with</span> <span class="pl-s1">jax</span>.<span class="pl-s1">profiler</span>.<span class="pl-en">trace</span>() <span class="pl-k">as</span> <span class="pl-s1">trace</span>:
<span class="pl-c"># 1: set function timeouts / time limits (otherwise, search time is infinite)</span>
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">trace</span>.<span class="pl-en">timeout</span>(<span class="pl-s1">timeout_seconds</span>, <span class="pl-s1">fun</span>, <span class="pl-s1">args</span><span class="pl-c1">=</span>(<span class="pl-s1">x</span>,))
<span class="pl-c"># 2: measure how long functions take to run (to find faster functions)</span>
<span class="pl-s1">elapsed</span> <span class="pl-c1">=</span> <span class="pl-s1">trace</span>.<span class="pl-en">elapsed</span>()
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">y</span> <span class="pl-k">if</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">y</span>, <span class="pl-v">Array</span>) <span class="pl-c1">and</span> <span class="pl-s1">y</span>.<span class="pl-s1">shape</span>[<span class="pl-c1">0</span>] <span class="pl-c1">==</span> <span class="pl-s1">n_x</span> <span class="pl-k">else</span> <span class="pl-c1">0</span>
<span class="pl-k">except</span> <span class="pl-v">Exception</span> <span class="pl-k">as</span> <span class="pl-s1">_</span>:
<span class="pl-s1">y</span>, <span class="pl-s1">elapsed</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span>, <span class="pl-s1">timeout</span>
<span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">outputs</span>.<span class="pl-s1">at</span>[<span class="pl-s1">i</span>, :].<span class="pl-en">set</span>(<span class="pl-s1">y</span>)
<span class="pl-s1">timings</span> <span class="pl-c1">=</span> <span class="pl-s1">timings</span>.<span class="pl-s1">at</span>[<span class="pl-s1">i</span>].<span class="pl-en">set</span>(<span class="pl-s1">elapsed</span>)
<span class="pl-s1">outputs</span> <span class="pl-c1">=</span> <span class="pl-s1">jnp</span>.<span class="pl-en">nan_to_num</span>(
<span class="pl-s1">jnp</span>.<span class="pl-en">clip</span>(<span class="pl-s1">outputs</span>, <span class="pl-s1">a_min</span><span class="pl-c1">=</span><span class="pl-s1">min_weight</span>, <span class="pl-s1">a_max</span><span class="pl-c1">=</span><span class="pl-s1">max_weight</span>)
).<span class="pl-en">transpose</span>()
<span class="pl-k">return</span> <span class="pl-s1">outputs</span>, <span class="pl-s1">timings</span>
<span class="pl-k">def</span> <span class="pl-en">f1</span>(<span class="pl-s1">x</span>: <span class="pl-v">Array</span>) <span class="pl-c1">-></span> <span class="pl-v">Array</span>:
<span class="pl-k">return</span> <span class="pl-s1">x</span> <span class="pl-c1">**</span> <span class="pl-c1">2</span> <span class="pl-c1">-</span> <span class="pl-c1">1</span>
<span class="pl-k">def</span> <span class="pl-en">f2</span>(<span class="pl-s1">x</span>: <span class="pl-v">Array</span>) <span class="pl-c1">-></span> <span class="pl-v">Array</span>:
<span class="pl-k">return</span> <span class="pl-s1">x</span> <span class="pl-c1">/</span> <span class="pl-c1">2</span>
<span class="pl-k">def</span> <span class="pl-en">f3</span>(<span class="pl-s1">x</span>: <span class="pl-v">Array</span>) <span class="pl-c1">-></span> <span class="pl-v">Array</span>:
<span class="pl-k">return</span> <span class="pl-s1">x</span> <span class="pl-c1">**</span> <span class="pl-c1">3</span> <span class="pl-c1">*</span> <span class="pl-s1">jnp</span>.<span class="pl-en">sin</span>(<span class="pl-s1">x</span>)
<span class="pl-s1">functions</span> <span class="pl-c1">=</span> [<span class="pl-en">jit</span>(<span class="pl-s1">f</span>) <span class="pl-k">for</span> <span class="pl-s1">f</span> <span class="pl-c1">in</span> (<span class="pl-s1">f1</span>, <span class="pl-s1">f2</span>, <span class="pl-s1">f3</span>)]
<span class="pl-c"># because we can</span>
<span class="pl-k">def</span> <span class="pl-en">benchmark_benchmark</span>(
<span class="pl-s1">benchmark</span>: <span class="pl-v">Callable</span> <span class="pl-c1">=</span> <span class="pl-s1">benchmark_no_jit</span>,
<span class="pl-s1">words</span>: <span class="pl-s1">str</span> <span class="pl-c1">=</span> <span class="pl-s">"Python + func_timeout + time.perf_counter"</span>,
<span class="pl-s1">functions</span>: <span class="pl-v">List</span>[<span class="pl-v">Callable</span>] <span class="pl-c1">=</span> <span class="pl-s1">functions</span>,
<span class="pl-v">N_x</span>: <span class="pl-v">List</span>[<span class="pl-s1">int</span>] <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">n_x</span>,
<span class="pl-s1">seed</span>: <span class="pl-s1">int</span> <span class="pl-c1">=</span> <span class="pl-s1">env</span>.<span class="pl-s1">seed</span>,
) <span class="pl-c1">-></span> <span class="pl-s1">float</span>:
<span class="pl-s1">n_functions</span> <span class="pl-c1">=</span> <span class="pl-en">len</span>(<span class="pl-s1">functions</span>)
<span class="pl-s1">begin</span> <span class="pl-c1">=</span> <span class="pl-en">perf_counter</span>()
<span class="pl-s1">rng</span> <span class="pl-c1">=</span> <span class="pl-v">PRNGKey</span>(<span class="pl-s1">seed</span>)
<span class="pl-s1">df</span> <span class="pl-c1">=</span> [] <span class="pl-c"># i admit to sucking at pandas</span>
<span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">n_x</span> <span class="pl-c1">in</span> <span class="pl-en">product</span>(<span class="pl-en">range</span>(<span class="pl-s1">env</span>.<span class="pl-s1">n_trials</span>), <span class="pl-v">N_x</span>):
<span class="pl-s1">rng</span>, <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-s1">jax</span>.<span class="pl-s1">random</span>.<span class="pl-en">split</span>(<span class="pl-s1">rng</span>)
<span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">jax</span>.<span class="pl-s1">random</span>.<span class="pl-en">normal</span>(<span class="pl-s1">key</span>, (<span class="pl-s1">n_x</span>,))
<span class="pl-k">if</span> <span class="pl-en">isinstance</span>(<span class="pl-s1">benchmark</span>, <span class="pl-s1">dict</span>):
<span class="pl-en">print</span>(<span class="pl-s">"n_x"</span>, <span class="pl-s1">n_x</span>)
<span class="pl-s1">benchmark</span> <span class="pl-c1">=</span> <span class="pl-s1">benchmark</span>[<span class="pl-s1">n_x</span>]
<span class="pl-en">print</span>(<span class="pl-s">"benchmark"</span>, <span class="pl-s1">benchmark</span>)
<span class="pl-en">print</span>(<span class="pl-s">"x"</span>, <span class="pl-s1">x</span>)
<span class="pl-s1">outputs</span>, <span class="pl-s1">timings</span> <span class="pl-c1">=</span> <span class="pl-en">benchmark</span>(<span class="pl-s1">x</span>, <span class="pl-s1">functions</span>)
<span class="pl-c"># print(timings)</span>
<span class="pl-c"># print(outputs.shape)</span>
<span class="pl-c"># print(i, n_x, timings)</span>
<span class="pl-k">assert</span> <span class="pl-s1">outputs</span>.<span class="pl-s1">shape</span> <span class="pl-c1">==</span> (<span class="pl-s1">n_x</span>, <span class="pl-s1">n_functions</span> <span class="pl-c1">+</span> <span class="pl-c1">1</span>)
<span class="pl-k">assert</span> <span class="pl-s1">timings</span>.<span class="pl-s1">shape</span> <span class="pl-c1">==</span> (<span class="pl-s1">n_functions</span>,)
<span class="pl-k">assert</span> (<span class="pl-s1">timings</span> <span class="pl-c1">></span> <span class="pl-c1">0</span>).<span class="pl-en">all</span>()
<span class="pl-k">assert</span> (<span class="pl-s1">timings</span> <span class="pl-c1"><</span> <span class="pl-s1">env</span>.<span class="pl-s1">timeout</span>).<span class="pl-en">all</span>()
<span class="pl-k">assert</span> (<span class="pl-s1">env</span>.<span class="pl-s1">min_weight</span> <span class="pl-c1"><=</span> <span class="pl-s1">outputs</span>).<span class="pl-en">all</span>()
<span class="pl-k">assert</span> (<span class="pl-s1">env</span>.<span class="pl-s1">max_weight</span> <span class="pl-c1">>=</span> <span class="pl-s1">outputs</span>).<span class="pl-en">all</span>()
<span class="pl-c"># print(f"All assertions passed.")</span>
<span class="pl-s1">df</span>.<span class="pl-en">append</span>(
{
<span class="pl-s">"n_x"</span>: <span class="pl-s1">n_x</span>,
<span class="pl-s">"i"</span>: <span class="pl-s1">i</span>,
<span class="pl-c1">**</span>{<span class="pl-s">f"f<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">i</span><span class="pl-c1">+</span><span class="pl-c1">1</span><span class="pl-kos">}</span></span> elapsed"</span>: <span class="pl-s1">t</span> <span class="pl-k">for</span> <span class="pl-s1">i</span>, <span class="pl-s1">t</span> <span class="pl-c1">in</span> <span class="pl-en">enumerate</span>(<span class="pl-s1">timings</span>)},
}
)
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>(<span class="pl-s1">df</span>).<span class="pl-en">set_index</span>([<span class="pl-s">"n_x"</span>, <span class="pl-s">"i"</span>])
<span class="pl-s1">elapsed</span> <span class="pl-c1">=</span> <span class="pl-en">perf_counter</span>() <span class="pl-c1">-</span> <span class="pl-s1">begin</span>
<span class="pl-en">print</span>(<span class="pl-s1">df</span>)
<span class="pl-en">print</span>(<span class="pl-s">f"<span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">words</span><span class="pl-kos">}</span></span> took <span class="pl-s1"><span class="pl-kos">{</span><span class="pl-s1">elapsed</span>:.2f<span class="pl-kos">}</span></span> seconds"</span>)
<span class="pl-k">return</span> <span class="pl-s1">elapsed</span>
<span class="pl-k">def</span> <span class="pl-en">test_jax_benchmarks</span>():
<span class="pl-s1">elapsed_no_jit</span> <span class="pl-c1">=</span> <span class="pl-en">benchmark_benchmark</span>()
<span class="pl-s1">elapsed_with_jit</span> <span class="pl-c1">=</span> <span class="pl-en">benchmark_benchmark</span>(
<span class="pl-s1">benchmark</span><span class="pl-c1">=</span>{
<span class="pl-s1">n</span>: <span class="pl-en">partial</span>(<span class="pl-s1">_benchmark_with_jit</span>, <span class="pl-s1">n_x</span><span class="pl-c1">=</span><span class="pl-s1">n</span>, <span class="pl-s1">n_functions</span><span class="pl-c1">=</span><span class="pl-en">len</span>(<span class="pl-s1">functions</span>))
<span class="pl-k">for</span> <span class="pl-s1">n</span> <span class="pl-c1">in</span> <span class="pl-s1">env</span>.<span class="pl-s1">n_x</span>
},
<span class="pl-s1">words</span><span class="pl-c1">=</span><span class="pl-s">"XLA (jax.jit) + jax.profiler.trace"</span>,
)
<span class="pl-en">print</span>(<span class="pl-s">"done!"</span>)
<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:
<span class="pl-en">test_jax_benchmarks</span>()</pre></div> | <p dir="auto">Please:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Check for duplicate requests.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Describe your goal, and if possible provide a code snippet with a motivating example.<br>
Support complete <code class="notranslate">numpy</code> functions and some <code class="notranslate">SciPy</code> functions</li>
</ul> | 0 |
<p dir="auto">While porting an Android app to Flutter, here is my drawable-xxhdpi folder on android<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/253700/26758268/4090880a-48a7-11e7-8732-4ec1632e09e0.png"><img width="840" alt="screenshot 2017-06-03 21 53 42" src="https://cloud.githubusercontent.com/assets/253700/26758268/4090880a-48a7-11e7-8732-4ec1632e09e0.png" style="max-width: 100%;"></a></p>
<p dir="auto">Declaring all these assets in the pubspec is going to be a pain, I should be able to just point it to a folder, or perhaps have a standardized folder "assets" where I can throw all my images in.</p> | <p dir="auto">I'd like to be able to add an entire folder of assets without having to enumerate each one in my flutter.yaml.</p> | 1 |
<p dir="auto">i connect apache-shardingsphere-5.0.0-alpha-shardingsphere-proxy by mysql client (8.0.25) ,when i executed some command ,a error was reported: as follows<br>
mysql -uroot -proot -h10.0.0.1 -P 3307<br>
[email protected](sharding_db) 14:45>show tables;</p>
<p dir="auto">ERROR 2027 (HY000): Malformed packet<br>
No connection. Trying to reconnect...<br>
Connection id: 10<br>
Current database: sharding_db</p>
<p dir="auto">The version of mysql client :<br>
mysql Ver 8.0.25 for Linux on x86_64 (MySQL Community Server - GPL)</p>
<p dir="auto">After some troubleshooting, it is suspected that the MySQL client version is not compatible with proxy。so i replaced mysql client to<br>
/usr/local/mysql8020/bin/mysql --version<br>
/usr/local/mysql8020/bin/mysql Ver 8.0.20 for Linux on x86_64 (MySQL Community Server - GPL)<br>
and<br>
/root/mysql Ver 14.14 Distrib 5.7.13, for linux-glibc2.5 (x86_64) using EditLine wrapper<br>
[email protected](sharding_db) 14:52>show tables;<br>
+---------------------+<br>
| Tables_in_demo_ds_1 |<br>
+---------------------+<br>
| t_no_shard |<br>
| t_order |<br>
| t_order_item |<br>
+---------------------+<br>
The error described above did not recur 。</p>
<p dir="auto">Here are some of my main configurations,only the datasource of the default config has been modified<br>
<strong>server.xml</strong><br>
governance:<br>
name: governance_ds<br>
registryCenter:<br>
type: ZooKeeper<br>
serverLists: 10.0.0.1:2181<br>
props:<br>
retryIntervalMilliseconds: 500<br>
timeToLiveSeconds: 60<br>
maxRetries: 3<br>
operationTimeoutMilliseconds: 500<br>
overwrite: false<br>
authentication:<br>
users:<br>
root:<br>
password: root<br>
sharding:<br>
password: sharding<br>
authorizedSchemas: sharding_db</p>
<p dir="auto">props:<br>
max-connections-size-per-query: 1<br>
acceptor-size: 16 # The default value is available processors count * 2.<br>
executor-size: 16 # Infinite by default.<br>
proxy-frontend-flush-threshold: 128 # The default value is 128.</p>
<p dir="auto"><strong>config-sharding.yaml</strong><br>
schemaName: sharding_db</p>
<h1 dir="auto"></h1>
<p dir="auto">dataSourceCommon:<br>
username: shardingsphere<br>
password: 123456<br>
connectionTimeoutMilliseconds: 30000<br>
idleTimeoutMilliseconds: 60000<br>
maxLifetimeMilliseconds: 1800000<br>
maxPoolSize: 50<br>
minPoolSize: 1<br>
maintenanceIntervalMilliseconds: 30000</p>
<p dir="auto">dataSources:<br>
ds_0:<br>
url: jdbc:mysql://10.0.0.2:3306/demo_ds_0?serverTimezone=UTC&useSSL=false<br>
ds_1:<br>
url: jdbc:mysql://10.0.0.2:3306/demo_ds_1?serverTimezone=UTC&useSSL=false</p>
<p dir="auto">rules:</p>
<ul dir="auto">
<li>
<p dir="auto">!SHARDING<br>
tables:<br>
t_order:<br>
actualDataNodes: ds_${0..1}.t_order_${0..1}<br>
tableStrategy:<br>
standard:<br>
shardingColumn: order_id<br>
shardingAlgorithmName: t_order_inline<br>
keyGenerateStrategy:<br>
column: order_id<br>
keyGeneratorName: snowflake<br>
t_order_item:<br>
actualDataNodes: ds_${0..1}.t_order_item_${0..1}<br>
tableStrategy:<br>
standard:<br>
shardingColumn: order_id<br>
shardingAlgorithmName: t_order_item_inline<br>
keyGenerateStrategy:<br>
column: order_item_id<br>
keyGeneratorName: snowflake<br>
bindingTables:</p>
<ul dir="auto">
<li>t_order,t_order_item<br>
defaultDatabaseStrategy:<br>
standard:<br>
shardingColumn: user_id<br>
shardingAlgorithmName: database_inline<br>
defaultTableStrategy:<br>
none:</li>
</ul>
<p dir="auto">shardingAlgorithms:<br>
database_inline:<br>
type: INLINE<br>
props:<br>
algorithm-expression: ds_${user_id % 2}<br>
t_order_inline:<br>
type: INLINE</p>
</li>
</ul>
<p dir="auto">MySQL client connection error</p> | <h2 dir="auto">Bug Report</h2>
<h2 dir="auto">num #instances #bytes class name</h2>
<p dir="auto">1: 723701 1723060848 [C<br>
2: 23438021 562512504 java.util.LinkedList$Node<br>
3: 22989567 551749608 org.apache.shardingsphere.sql.parser.sql.segment.dml.expr.simple.ParameterMarkerExpressionSegment<br>
4: 19796 24885584 [B<br>
5: 720560 17293440 java.lang.String<br>
6: 348547 11153504 org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment<br>
7: 284008 9088256 java.util.LinkedList<br>
8: 374714 8993136 org.apache.shardingsphere.sql.parser.sql.value.identifier.IdentifierValue<br>
9: 95366 8392208 java.lang.reflect.Method<br>
10: 113274 7787336 [Ljava.lang.Object;<br>
11: 246617 <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/shardingsphere/commit/5918808957c44723865570c30652cac234651f4c/hovercard" href="https://github.com/apache/shardingsphere/commit/5918808957c44723865570c30652cac234651f4c"><tt>5918808</tt></a> org.apache.shardingsphere.sql.parser.sql.segment.dml.item.ColumnProjectionSegment<br>
12: 170195 5446240 java.util.concurrent.ConcurrentHashMap$Node<br>
13: 105644 4225760 java.util.LinkedHashMap$Entry<br>
14: 34045 3716200 java.lang.Class<br>
15: 110722 3543104 java.util.HashMap$Node<br>
16: 35275 3271760 [Ljava.util.HashMap$Node;<br>
17: 20645 3092088 [I<br>
18: 89022 2848704 org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.PredicateSegment<br>
19: 51995 2495760 org.aspectj.weaver.reflect.ShadowMatchImpl<br>
20: 64925 2077600 org.antlr.v4.runtime.atn.ATNConfig<br>
21: 84638 2031312 java.util.ArrayList<br>
22: 3380 1859456 [Ljava.util.concurrent.ConcurrentHashMap$Node;<br>
23: 51995 1663840 org.aspectj.weaver.patterns.ExposedState<br>
24: 69247 1661928 org.apache.shardingsphere.sql.parser.sql.segment.dml.assignment.InsertValuesSegment<br>
25: 29387 1645672 java.util.LinkedHashMap<br>
26: 71822 1538608 [Ljava.lang.Class;<br>
27: 31810 1526880 java.util.HashMap<br>
28: 53692 1417528 [Z<br>
29: 16298 1303840 java.lang.reflect.Constructor<br>
30: 26018 1248864 com.google.common.cache.LocalCache$StrongAccessEntry<br>
31: 25998 1247904 com.google.common.cache.LocalCache$SoftValueReference<br>
32: 51996 1247896 [Lorg.aspectj.weaver.ast.Var;<br>
33: 48475 1163400 org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.value.PredicateCompareRightValue<br>
34: 23523 1129104 org.apache.shardingsphere.sql.parser.sql.statement.dml.SelectStatement<br>
35: 27653 1106120 com.sun.org.apache.xerces.internal.dom.DeferredAttrImpl<br>
36: 33396 1068672 com.alibaba.metrics.LongAdder<br>
37: 63699 1019184 java.lang.Object<br>
38: 40309 967416 org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.value.PredicateBracketValue<br>
39: 40309 967416 org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.value.PredicateInRightValue<br>
40: 40309 967416 org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.value.PredicateLeftBracketValue<br>
41: 40309 967416 org.apache.shardingsphere.sql.parser.sql.segment.dml.predicate.value.PredicateRightBracketValue<br>
42: 23212 928480 com.sun.org.apache.xerces.internal.dom.DeferredTextImpl</p>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">org.apache.shardingsphere<br>
sharding-jdbc-spring-boot-starter<br>
4.1.1</p>
<h3 dir="auto">Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?</h3>
<h3 dir="auto">Expected behavior</h3>
<h3 dir="auto">Actual behavior</h3>
<h3 dir="auto">Reason analyze (If you can)</h3>
<p dir="auto">SQLParseResultCache GC不了,即使我手动调用System.gc()。cache中的软引用依然存在<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/11569710/132796828-6aeb1388-1e69-4da8-9583-26455274d39c.png"><img width="1120" alt="wecom-temp-130d4c4bea4878d4babcbd4400a15f4b" src="https://user-images.githubusercontent.com/11569710/132796828-6aeb1388-1e69-4da8-9583-26455274d39c.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3> | 0 |
<p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.29.2</li>
<li>Operating System: macOS Ventura 13.1</li>
<li>Node.js version: v18.13 (but tested 16.19 as well)</li>
<li>Browser: Chromium</li>
<li>Extra:
<ul dir="auto">
<li>Does happen for both M1 and Intel chips</li>
<li>We use the mcr.microsoft.com/playwright:v1.29.2-focal docker image in CI, the difference is the same when comparing local vs in the image.</li>
</ul>
</li>
</ul>
<details>
<summary>envinfo output</summary>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="## System:
- OS: macOS 13.1
- Memory: 1.71 GB / 32.00 GB
## Binaries:
- Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
- npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
## Languages:
- Bash: 3.2.57 - /bin/bash"><pre class="notranslate"><code class="notranslate">## System:
- OS: macOS 13.1
- Memory: 1.71 GB / 32.00 GB
## Binaries:
- Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
- npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
## Languages:
- Bash: 3.2.57 - /bin/bash
</code></pre></div>
</details>
<p dir="auto"><strong>Code Snippet</strong><br>
More importantly than the test: This snippet has to be run locally and then inside the docker image / some sort of CI for the bug to happen.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { expect, test } from "@playwright/test";
test("Onboarding Step 1", async ({ page }) => {
await page.goto("/");
await page.getByText("Login").click();
await expect(page.getByTestId("onboarding-heading")).toContainText(
"Onboarding Step 1"
);
await expect(page).toHaveScreenshot(
"onboarding-step-1.png",
{ fullPage: true }
);
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">expect</span><span class="pl-kos">,</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>
<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"Onboarding Step 1"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">"/"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByText</span><span class="pl-kos">(</span><span class="pl-s">"Login"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByTestId</span><span class="pl-kos">(</span><span class="pl-s">"onboarding-heading"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toContainText</span><span class="pl-kos">(</span>
<span class="pl-s">"Onboarding Step 1"</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveScreenshot</span><span class="pl-kos">(</span>
<span class="pl-s">"onboarding-step-1.png"</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span> <span class="pl-c1">fullPage</span>: <span class="pl-c1">true</span> <span class="pl-kos">}</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">Screenshot have flaky dimensions. Our locally generated, full-page, screenshots sometimes differ from those created inside docker by 1px, sometimes 2px height. If running the same test multiple times in the same environment (either docker or local), the screenshots match all the time. All tests are run with headless chromium. I've also experimented with any antialiasing and font rendering setup. This did not help either.</p>
<p dir="auto">Result, for example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Error: Screenshot comparison failed:
Expected an image 1280px by 1740px, received 1280px by 1739px.
Call log:
- expect.toHaveScreenshot with timeout 5000ms
- verifying given screenshot expectation
- taking page screenshot
- disabled all CSS animations
- Expected an image 1280px by 1740px, received 1280px by 1739px.
- waiting 100ms before taking screenshot
- taking page screenshot
- disabled all CSS animations
- captured a stable screenshot
- Expected an image 1280px by 1740px, received 1280px by 1739px. "><pre class="notranslate"><code class="notranslate"> Error: Screenshot comparison failed:
Expected an image 1280px by 1740px, received 1280px by 1739px.
Call log:
- expect.toHaveScreenshot with timeout 5000ms
- verifying given screenshot expectation
- taking page screenshot
- disabled all CSS animations
- Expected an image 1280px by 1740px, received 1280px by 1739px.
- waiting 100ms before taking screenshot
- taking page screenshot
- disabled all CSS animations
- captured a stable screenshot
- Expected an image 1280px by 1740px, received 1280px by 1739px.
</code></pre></div> | <p dir="auto"><strong>Context:</strong></p>
<ul dir="auto">
<li>Playwright Version: 1.27.1</li>
<li>Operating System: MacOS 13.0</li>
<li>Node.js version: 16.15.0</li>
<li>Browser: All</li>
<li>Extra: Also CI using MacOS 12 (Github Actions)</li>
</ul>
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">Subsequent screenshots (on different test runs) of the same page are coming out with different heights. This is mainly due to a weird "compression" (like smashing) effect on one of the screenshots.</p>
<p dir="auto">These two example come from the same code, same server (NextJS locally) running, just <code class="notranslate">yarn test</code> two times in a row:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26208850/202003575-47a4f38d-31f9-4804-9f4e-69520d1e4fc8.png"><img src="https://user-images.githubusercontent.com/26208850/202003575-47a4f38d-31f9-4804-9f4e-69520d1e4fc8.png" alt="full-page-actual" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/26208850/202003582-edfa4175-5ba1-449e-84f4-86b26907ae60.png"><img src="https://user-images.githubusercontent.com/26208850/202003582-edfa4175-5ba1-449e-84f4-86b26907ae60.png" alt="full-page-expected" style="max-width: 100%;"></a></p>
<p dir="auto">I'm sorry for the long image, but that may be part of the problem (although short pages sometimes have this problem too).</p>
<p dir="auto">If you compare the images using something like <a href="https://www.diffchecker.com/image-diff/" rel="nofollow">https://www.diffchecker.com/image-diff/</a> you can see the weird effect.</p>
<p dir="auto">Is this a known bug? The differences are even greater once we run the tests on CI (more screenshots are different), but it's flaky, so sometimes it happens and sometimes everything is good.</p>
<p dir="auto">EDIT: Just to clarify, by compression I mean that the pixels themselves are smashed, so everything is shorter, which in turn causes the heights of the screenshots to differ, like on of them was "smashed", which is wrong, e.g. causes the square logo to turn into a rectangle, etc</p>
<p dir="auto">Thanks in advance!</p> | 1 |
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<table role="table">
<thead>
<tr>
<th>technologies</th>
</tr>
</thead>
<tbody>
<tr>
<td>react router dom</td>
</tr>
<tr>
<td>material-ui</td>
</tr>
<tr>
<td>hooks and functional components</td>
</tr>
<tr>
<td>context API and providers</td>
</tr>
</tbody>
</table>
<p dir="auto">when i want to navigate between routes , i get this error :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="at invariant (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:57:19)
at findCurrentFiberUsingSlowPath (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4395:31)
at findCurrentHostFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4407:27)
at findHostInstanceWithWarning (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21472:25)
at Object.findDOMNode (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22024:18)
at ref (webpack-internal:///./node_modules/@material-ui/core/Slide/Slide.js:255:52)
at commitAttachRef (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18104:11)
at commitAllLifeCycles (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19480:11)
at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:147:18)
at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:196:20)
at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:250:35)
at commitRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19699:11)
at eval (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21247:9)
at Object.unstable_runWithPriority (webpack-internal:///./node_modules/scheduler/cjs/scheduler.development.js:255:16)
at completeRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21246:17)
at performWorkOnRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21169:13)
at performWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21074:11)
at performSyncWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21048:7)
at interactiveUpdates$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21333:11)
at interactiveUpdates (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:2268:14)
at dispatchInteractiveEvent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:5086:7)"><pre class="notranslate"><code class="notranslate">at invariant (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:57:19)
at findCurrentFiberUsingSlowPath (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4395:31)
at findCurrentHostFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4407:27)
at findHostInstanceWithWarning (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21472:25)
at Object.findDOMNode (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22024:18)
at ref (webpack-internal:///./node_modules/@material-ui/core/Slide/Slide.js:255:52)
at commitAttachRef (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18104:11)
at commitAllLifeCycles (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19480:11)
at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:147:18)
at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:196:20)
at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:250:35)
at commitRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19699:11)
at eval (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21247:9)
at Object.unstable_runWithPriority (webpack-internal:///./node_modules/scheduler/cjs/scheduler.development.js:255:16)
at completeRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21246:17)
at performWorkOnRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21169:13)
at performWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21074:11)
at performSyncWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21048:7)
at interactiveUpdates$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21333:11)
at interactiveUpdates (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:2268:14)
at dispatchInteractiveEvent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:5086:7)
</code></pre></div>
<p dir="auto">after this error , i get this error block ( but it is different , because some times i click on Menu component and some times i am in a Drawer ) .</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="The above error occurred in the <Transition> component:
in Transition (created by Slide)
in EventListener (created by Slide)
in Slide (created by WithTheme(Slide))
in WithTheme(Slide) (created by Drawer)
in div (created by Drawer)
in Drawer (created by WithStyles(Drawer))
in WithStyles(Drawer) (at AppBar/index.js:524)
in div (at AppBar/index.js:457)
in Index (created by WithStyles(Index))
in WithStyles(Index) (at App.js:98)
in BalanceStateProvider (at App.js:96)
in LoginStateProvider (at App.js:95)
in DrawerStateProvider (at App.js:94)
in Suspense (at App.js:93)
in MuiThemeProviderOld (at App.js:92)
in Router (at App.js:91)
in App (at src/index.js:31)
in StateProvider (at src/index.js:30)
in Router (created by BrowserRouter)
in BrowserRouter (at src/index.js:29)"><pre class="notranslate"><code class="notranslate">The above error occurred in the <Transition> component:
in Transition (created by Slide)
in EventListener (created by Slide)
in Slide (created by WithTheme(Slide))
in WithTheme(Slide) (created by Drawer)
in div (created by Drawer)
in Drawer (created by WithStyles(Drawer))
in WithStyles(Drawer) (at AppBar/index.js:524)
in div (at AppBar/index.js:457)
in Index (created by WithStyles(Index))
in WithStyles(Index) (at App.js:98)
in BalanceStateProvider (at App.js:96)
in LoginStateProvider (at App.js:95)
in DrawerStateProvider (at App.js:94)
in Suspense (at App.js:93)
in MuiThemeProviderOld (at App.js:92)
in Router (at App.js:91)
in App (at src/index.js:31)
in StateProvider (at src/index.js:30)
in Router (created by BrowserRouter)
in BrowserRouter (at src/index.js:29)
</code></pre></div>
<p dir="auto">when i write the code in sandbox , everything works fine , but in my project , is not .<br>
even i dont know where i have to check for this error , because i have no <code class="notranslate">findDomNode</code> function .</p>
<h5 dir="auto">what i did for this</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> remove all contexts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> remove material-ui provider</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> remove Suspense and lazy</li>
</ul>
<p dir="auto">but nothing change</p> | <p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">I have a component which listens for resize events (via a BlueprintJS ResizeSensor). When loading a component dynamically with <code class="notranslate">lazy</code> / <code class="notranslate">Suspense</code>, an exception occurs as the resize sensor appears to be unmounted:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught Error: Unable to find node on an unmounted component.
at invariant (29.chunk.js:86295)
at findCurrentFiberUsingSlowPath (29.chunk.js:90628)
at findCurrentHostFiber (29.chunk.js:90640)
at findHostInstanceWithWarning (29.chunk.js:106349)
at findDOMNode (29.chunk.js:106869)
at ResizeSensor.componentDidUpdate (29.chunk.js:10535)"><pre class="notranslate"><code class="notranslate">Uncaught Error: Unable to find node on an unmounted component.
at invariant (29.chunk.js:86295)
at findCurrentFiberUsingSlowPath (29.chunk.js:90628)
at findCurrentHostFiber (29.chunk.js:90640)
at findHostInstanceWithWarning (29.chunk.js:106349)
at findDOMNode (29.chunk.js:106869)
at ResizeSensor.componentDidUpdate (29.chunk.js:10535)
</code></pre></div>
<p dir="auto">The resize sensor <a href="https://github.com/palantir/blueprint/blob/develop/packages/core/src/components/resize-sensor/resizeSensor.tsx#L73">should be removing listeners on unmount</a>.</p>
<p dir="auto">Demo: <a href="https://codesandbox.io/s/n4241q075l" rel="nofollow">https://codesandbox.io/s/n4241q075l</a><br>
Related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="379428100" data-permission-text="Title is private" data-url="https://github.com/palantir/blueprint/issues/3141" data-hovercard-type="issue" data-hovercard-url="/palantir/blueprint/issues/3141/hovercard" href="https://github.com/palantir/blueprint/issues/3141">palantir/blueprint#3141</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">No exception is thrown.</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong></p>
<p dir="auto">Tested with:</p>
<ul dir="auto">
<li>React 16.6.1, fails</li>
<li>React 16.6.0, works</li>
</ul> | 1 |
<p dir="auto">Similar to <a href="http://www.haskell.org/hoogle/" rel="nofollow">http://www.haskell.org/hoogle/</a>, it'd be great to search based on types, not just names.</p> | <p dir="auto">One of hoogle's most useful features is the ability to search by type signatures. It makes finding functions whose behavior you know but whose names you don't know much easier.</p>
<p dir="auto">We should add this ability to the search feature in the rust docs.</p> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Autocomplete works for all locations, also the top-level locations, like countries, continents</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Autocomplete breaks, when the rows include top-level locations, like a single country, e.g. <code class="notranslate">Norway</code>. Locations with approximations, e.g. <code class="notranslate">Oslo, Norway</code> work fine!</p>
<p dir="auto">When the autocomplete breaks, it is not possible to delete or add new characters to the autocomplete.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Uncaught TypeError: Cannot read property 'type' of undefined
at AutoComplete.js:389
at Array.every (<anonymous>)
at AutoComplete.render (AutoComplete.js:366)
at ReactCompositeComponent.js:795
at measureLifeCyclePerf (ReactCompositeComponent.js:75)
at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:794)
at ReactCompositeComponentWrapper._renderValidatedComponent (ReactCompositeComponent.js:821)
at ReactCompositeComponentWrapper._updateRenderedComponent (ReactCompositeComponent.js:745)
at ReactCompositeComponentWrapper._performComponentUpdate (ReactCompositeComponent.js:723)
at ReactCompositeComponentWrapper.updateComponent (ReactCompositeComponent.js:644)"><pre class="notranslate"><code class="notranslate">Uncaught TypeError: Cannot read property 'type' of undefined
at AutoComplete.js:389
at Array.every (<anonymous>)
at AutoComplete.render (AutoComplete.js:366)
at ReactCompositeComponent.js:795
at measureLifeCyclePerf (ReactCompositeComponent.js:75)
at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (ReactCompositeComponent.js:794)
at ReactCompositeComponentWrapper._renderValidatedComponent (ReactCompositeComponent.js:821)
at ReactCompositeComponentWrapper._updateRenderedComponent (ReactCompositeComponent.js:745)
at ReactCompositeComponentWrapper._performComponentUpdate (ReactCompositeComponent.js:723)
at ReactCompositeComponentWrapper.updateComponent (ReactCompositeComponent.js:644)
</code></pre></div>
<p dir="auto">extended:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" | (anonymous) | @ | AutoComplete.js:389
-- | -- | -- | --
| render | @ | AutoComplete.js:366
| (anonymous) | @ | ReactCompositeComponent.js:795
| measureLifeCyclePerf | @ | ReactCompositeComponent.js:75
| _renderValidatedComponentWithoutOwnerOrContext | @ | ReactCompositeComponent.js:794
| _renderValidatedComponent | @ | ReactCompositeComponent.js:821
| _updateRenderedComponent | @ | ReactCompositeComponent.js:745
| _performComponentUpdate | @ | ReactCompositeComponent.js:723
| updateComponent | @ | ReactCompositeComponent.js:644
| performUpdateIfNecessary | @ | ReactCompositeComponent.js:560
| performUpdateIfNecessary | @ | ReactReconciler.js:156
| runBatchedUpdates | @ | ReactUpdates.js:150
| perform | @ | Transaction.js:143
| perform | @ | Transaction.js:143
| perform | @ | ReactUpdates.js:89
| flushBatchedUpdates | @ | ReactUpdates.js:172
| closeAll | @ | Transaction.js:209
| perform | @ | Transaction.js:156
| batchedUpdates | @ | ReactDefaultBatchingStrategy.js:62
| enqueueUpdate | @ | ReactUpdates.js:200
| enqueueUpdate | @ | ReactUpdateQueue.js:24
| enqueueSetState | @ | ReactUpdateQueue.js:218
| ReactComponent.setState | @ | ReactBaseClasses.js:64
| close | @ | AutoComplete.js:296
| (anonymous) | @ | AutoComplete.js:237
| setTimeout (async) | |
| AutoComplete._this.handleBlur | @ | AutoComplete.js:236
| TextField._this.handleInputBlur | @ | TextField.js:202
| ReactErrorUtils.invokeGuardedCallback | @ | ReactErrorUtils.js:69
| executeDispatch | @ | EventPluginUtils.js:85
| executeDispatchesInOrder | @ | EventPluginUtils.js:108
| executeDispatchesAndRelease | @ | EventPluginHub.js:43
| executeDispatchesAndReleaseTopLevel | @ | EventPluginHub.js:54
| forEachAccumulated | @ | forEachAccumulated.js:24
| processEventQueue | @ | EventPluginHub.js:254
| runEventQueueInBatch | @ | ReactEventEmitterMixin.js:17
| handleTopLevel | @ | ReactEventEmitterMixin.js:27
| handleTopLevelImpl | @ | ReactEventListener.js:72
| perform | @ | Transaction.js:143
| batchedUpdates | @ | ReactDefaultBatchingStrategy.js:62
| batchedUpdates | @ | ReactUpdates.js:97
| dispatchEvent | @ | ReactEventListener.js:147
"><pre class="notranslate"><code class="notranslate"> | (anonymous) | @ | AutoComplete.js:389
-- | -- | -- | --
| render | @ | AutoComplete.js:366
| (anonymous) | @ | ReactCompositeComponent.js:795
| measureLifeCyclePerf | @ | ReactCompositeComponent.js:75
| _renderValidatedComponentWithoutOwnerOrContext | @ | ReactCompositeComponent.js:794
| _renderValidatedComponent | @ | ReactCompositeComponent.js:821
| _updateRenderedComponent | @ | ReactCompositeComponent.js:745
| _performComponentUpdate | @ | ReactCompositeComponent.js:723
| updateComponent | @ | ReactCompositeComponent.js:644
| performUpdateIfNecessary | @ | ReactCompositeComponent.js:560
| performUpdateIfNecessary | @ | ReactReconciler.js:156
| runBatchedUpdates | @ | ReactUpdates.js:150
| perform | @ | Transaction.js:143
| perform | @ | Transaction.js:143
| perform | @ | ReactUpdates.js:89
| flushBatchedUpdates | @ | ReactUpdates.js:172
| closeAll | @ | Transaction.js:209
| perform | @ | Transaction.js:156
| batchedUpdates | @ | ReactDefaultBatchingStrategy.js:62
| enqueueUpdate | @ | ReactUpdates.js:200
| enqueueUpdate | @ | ReactUpdateQueue.js:24
| enqueueSetState | @ | ReactUpdateQueue.js:218
| ReactComponent.setState | @ | ReactBaseClasses.js:64
| close | @ | AutoComplete.js:296
| (anonymous) | @ | AutoComplete.js:237
| setTimeout (async) | |
| AutoComplete._this.handleBlur | @ | AutoComplete.js:236
| TextField._this.handleInputBlur | @ | TextField.js:202
| ReactErrorUtils.invokeGuardedCallback | @ | ReactErrorUtils.js:69
| executeDispatch | @ | EventPluginUtils.js:85
| executeDispatchesInOrder | @ | EventPluginUtils.js:108
| executeDispatchesAndRelease | @ | EventPluginHub.js:43
| executeDispatchesAndReleaseTopLevel | @ | EventPluginHub.js:54
| forEachAccumulated | @ | forEachAccumulated.js:24
| processEventQueue | @ | EventPluginHub.js:254
| runEventQueueInBatch | @ | ReactEventEmitterMixin.js:17
| handleTopLevel | @ | ReactEventEmitterMixin.js:27
| handleTopLevelImpl | @ | ReactEventListener.js:72
| perform | @ | Transaction.js:143
| batchedUpdates | @ | ReactDefaultBatchingStrategy.js:62
| batchedUpdates | @ | ReactUpdates.js:97
| dispatchEvent | @ | ReactEventListener.js:147
</code></pre></div>
<h2 dir="auto">Context</h2>
<p dir="auto">Providing an autocomplete input for location select. The autocomplete breaks, when the rows show a country, i.e. a top-level location item<br>
this works:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Warsaw, Poland"><pre class="notranslate"><code class="notranslate">Warsaw, Poland
</code></pre></div>
<p dir="auto">this breaks:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Indonesia"><pre class="notranslate"><code class="notranslate">Indonesia
</code></pre></div>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>0.19.4</td>
</tr>
<tr>
<td>React</td>
<td>15.6.1</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</td>
</tr>
</tbody>
</table> | <p dir="auto">When I try to print my page with Grid responsive layout, it seems to use xs breakpoint on Chrome v. 62.0.3202.75 even if higher breakpoint is also set</p>
<ul dir="auto">
<li>[ x] I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">I have grid layout with multiple elements and responsive breakpoints <code class="notranslate">sm</code> and <code class="notranslate">xs</code> to display them in row on larger screens, and in column on small ones.<br>
When I want to print my page to pdf using window.print() and A4 format, I should be able to replicate my layout</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">On Chrome only xs breakpoint applies so elements appear in column, on Firefox, Safari they are displayed in row.<br>
I'm assuming that this is more about how different browsers treat A4 format screen size, but maybe somebody has already experienced this issue, or could provide better explanation of screen sizes.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto"><a href="https://codesandbox.io/s/jpkw9y4959?module=%2FLayout.js" rel="nofollow">https://codesandbox.io/s/jpkw9y4959?module=%2FLayout.js</a></p>
<h2 dir="auto">Context</h2>
<p dir="auto">Trying to print pdfs and layout is broken in chrome (pretty much everything is displayed in one column so paper space is wasted)</p>
<h2 dir="auto">Your Environment</h2>
<p dir="auto">Only tested in desktop versions.</p>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
<th>Bug</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>1.0.0-beta.20</td>
<td></td>
</tr>
<tr>
<td>React</td>
<td>16.0</td>
<td></td>
</tr>
<tr>
<td>Chrome</td>
<td>62.0.3202.75</td>
<td>yes</td>
</tr>
<tr>
<td>Firefox</td>
<td>56.0.2</td>
<td>no</td>
</tr>
<tr>
<td>Safari</td>
<td>11.0.1</td>
<td>no</td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Set "SELENIUM_REMOTE_CAPABILITIES" as documented <a href="https://playwright.dev/docs/selenium-grid#passing-additional-capabilities" rel="nofollow">here</a></li>
<li>Selenium Grid connection is starting up</li>
<li>Selenium Grid reports request to use custom capabilities</li>
<li>Capabilities passed in are not what the Selenium connection reports to be using</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Expected the Documentation on this to be much more detailed</p>
<ul dir="auto">
<li>The /wd/hub should be removed or at least mentioned that this URL will ONLY be used when the docker image is passed this URL (/wd/hub could be omitted)</li>
<li>What is "MyGrid:options"</li>
<li>What are the Capabilities to be used (WebDriver or selenium names, is it "browser_version" or "browserVersion")</li>
</ul>
<p dir="auto">Can you please in the very near future update the documentation on this, I need to pass in some capabilities and am trying to figure out how to pass in for e.g. browswerVersion</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Trial and error on how to pass capabilities through playwright to selenium grid and in what sepcific format they need to be in without prevail.</p> | <h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.XX]</li>
<li>Operating System: [Windows 11]</li>
<li>Browser: [All, Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I provided exact source code that allows reproducing the issue locally.</li>
</ul>
<p dir="auto"><strong>Link to the GitHub repository with the repro</strong></p>
<p dir="auto">[https://github.com/your_profile/playwright_issue_title]</p>
<p dir="auto">or</p>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], },
},
});"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
<span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'chromium'</span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">'Desktop Chrome'</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span><span class="pl-kos"></span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { test, BrowserContext, Page, expect } from '@playwright/test';
test.describe.configure({ mode: 'serial', timeout: 180000 });
let context: BrowserContext;
let page: Page;
test.beforeEach(async ({ playwright, browserName }, testInfo) => {
try {
context = await playwright[browserName].launchPersistentContext('', {
headless: false,
channel: "msedge"
});
page = context.pages()[0];
test.skip();
} catch(e) {
console.log(e)
}
});
test('Dummy test', async ({ }) => {
try {
await page.waitForLoadState('networkidle');
await page.goto('https://www.example.com');
expect(page).toHaveTitle('Example Domain');
} catch (e) {
throw e;
}
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">test</span><span class="pl-kos">,</span> <span class="pl-v">BrowserContext</span><span class="pl-kos">,</span> <span class="pl-v">Page</span><span class="pl-kos">,</span> <span class="pl-s1">expect</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'@playwright/test'</span><span class="pl-kos">;</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-c1">describe</span><span class="pl-kos">.</span><span class="pl-en">configure</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">mode</span>: <span class="pl-s">'serial'</span><span class="pl-kos">,</span> <span class="pl-c1">timeout</span>: <span class="pl-c1">180000</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">context</span>: <span class="pl-v">BrowserContext</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-s1">page</span>: <span class="pl-v">Page</span><span class="pl-kos">;</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">beforeEach</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> playwright<span class="pl-kos">,</span> browserName <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">testInfo</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">try</span> <span class="pl-kos">{</span>
<span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</span><span class="pl-kos">[</span><span class="pl-s1">browserName</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">launchPersistentContext</span><span class="pl-kos">(</span><span class="pl-s">''</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
<span class="pl-c1">headless</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span>
<span class="pl-c1">channel</span>: <span class="pl-s">"msedge"</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">pages</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">skip</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'Dummy test'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">try</span> <span class="pl-kos">{</span>
<span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">waitForLoadState</span><span class="pl-kos">(</span><span class="pl-s">'networkidle'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://www.example.com'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveTitle</span><span class="pl-kos">(</span><span class="pl-s">'Example Domain'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">throw</span> <span class="pl-s1">e</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>[Run the test]</li>
<li>[...]<br>
Run test in VSCode</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Test should be skipped without any error messages.</p>
<p dir="auto"><strong>Actual</strong><br>
Test is skipped but throws an error: Error: No tests found</p>
<p dir="auto">[Describe actual behavior]</p> | 0 |
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Your code here
In [8]: pd.to_timedelta('1', unit='h')
Out[8]: Timedelta('0 days 00:00:00.000000')
"><pre class="notranslate"><span class="pl-c"># Your code here</span>
<span class="pl-v">In</span> [<span class="pl-c1">8</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-s">'1'</span>, <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">'h'</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">8</span>]: <span class="pl-v">Timedelta</span>(<span class="pl-s">'0 days 00:00:00.000000'</span>)</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">I would expect all the following to return Timedelta('0 days 01:00:00'). pd.to_timedelta(1, unit='h') does not. I must first cast the string '1' to a int or float then to a timedelta.</p>
<p dir="auto">In [6]: pd.to_timedelta(1.0, unit='h')<br>
Out[6]: Timedelta('0 days 01:00:00')</p>
<p dir="auto">In [7]: pd.to_timedelta(1, unit='h')<br>
Out[7]: Timedelta('0 days 01:00:00')</p>
<p dir="auto">In [8]: pd.to_timedelta('1', unit='h')<br>
Out[8]: Timedelta('0 days 00:00:00.000000')</p>
<p dir="auto">In [9]: pd.to_timedelta('1 H')<br>
Out[9]: Timedelta('0 days 01:00:00')</p>
<h4 dir="auto">Expected Output</h4>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
# Paste the output here pd.show_versions() here
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.1.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 10<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.20.2<br>
pytest: 3.1.2<br>
pip: 9.0.1<br>
setuptools: 27.2.0<br>
Cython: 0.25.2<br>
numpy: 1.12.1<br>
scipy: 0.19.0<br>
xarray: None<br>
IPython: 6.0.0<br>
sphinx: None<br>
patsy: 0.4.1<br>
dateutil: 2.6.0<br>
pytz: 2016.10<br>
blosc: None<br>
bottleneck: None<br>
tables: 3.2.2<br>
numexpr: 2.6.2<br>
feather: None<br>
matplotlib: 2.0.0<br>
openpyxl: None<br>
xlrd: 1.0.0<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: 4.5.3<br>
html5lib: 0.999999999<br>
sqlalchemy: 1.1.5<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.4<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details> | <p dir="auto">So, I don't know if this is by design, but it sure confused me. <code class="notranslate">to_timedelta()</code> operates differently on the number <code class="notranslate">1000</code> compared to the string <code class="notranslate">'1000'</code>:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In[3]: pd.to_timedelta(1000, unit='ms')
Out[3]: Timedelta('0 days 00:00:01')
In[4]: pd.to_timedelta(1000.0, unit='ms')
Out[4]: Timedelta('0 days 00:00:01')"><pre class="notranslate"><span class="pl-v">In</span>[<span class="pl-c1">3</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-c1">1000</span>, <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">'ms'</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">3</span>]: <span class="pl-v">Timedelta</span>(<span class="pl-s">'0 days 00:00:01'</span>)
<span class="pl-v">In</span>[<span class="pl-c1">4</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-c1">1000.0</span>, <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">'ms'</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">4</span>]: <span class="pl-v">Timedelta</span>(<span class="pl-s">'0 days 00:00:01'</span>)</pre></div>
<p dir="auto">and</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In[6]: pd.to_timedelta('1000ms')
Out[6]: Timedelta('0 days 00:00:01')"><pre class="notranslate"><span class="pl-v">In</span>[<span class="pl-c1">6</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-s">'1000ms'</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">6</span>]: <span class="pl-v">Timedelta</span>(<span class="pl-s">'0 days 00:00:01'</span>)</pre></div>
<p dir="auto">while</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="In[5]: pd.to_timedelta('1000', unit='ms')
Out[5]: Timedelta('0 days 00:00:00.000001')"><pre class="notranslate"><span class="pl-v">In</span>[<span class="pl-c1">5</span>]: <span class="pl-s1">pd</span>.<span class="pl-en">to_timedelta</span>(<span class="pl-s">'1000'</span>, <span class="pl-s1">unit</span><span class="pl-c1">=</span><span class="pl-s">'ms'</span>)
<span class="pl-v">Out</span>[<span class="pl-c1">5</span>]: <span class="pl-v">Timedelta</span>(<span class="pl-s">'0 days 00:00:00.000001'</span>)</pre></div>
<p dir="auto">I've tried my best to come up with a reason for why this behaviour would be desirable, but I can't think of any.</p> | 1 |
<p dir="auto">This is a weird bug that I have not been able to test, due to the unusual circumstances it appears. I also haven't been able to find mention of it elsewhere, so I'm stuck reporting it.</p>
<p dir="auto">I was teaching a class where the projector screen was being used as a second monitor, and not duplicating the laptop screen. When I plot anything with matplotlib, it works just fine when it appears on the laptop screen. When I move the plot to the projector screen, the plot disappears... at about 75% on the projector screen, you can see the plot... but any more than that, the plot disappears. What's left is a blank window (i.e. what it looks like when you clear a plot). It has happened on every plot I've tried the past two weeks, at two different institutions.</p>
<p dir="auto">To reproduce this bug, you'll need a second monitor. I've had overhead projectors only, but will try a second monitor shortly. I have seen the bug using matplotlib 2.0.0, python 2.7.13, and macOS Sierra 10.12.3. Any plot works, so <code class="notranslate">plot(x)</code> should do it, when you drag the plot onto the second monitor. Displaying a plot worked as expected previously, however, this is my first attempt displaying a plot using a second monitor with sierra. I installed matplotlib with macports, if that matters, and I'm using the <code class="notranslate">MacOSX</code> backend.</p>
<p dir="auto">If I see the same effect on a second monitor (an actual monitor, not a projector), then I can test some variants. I have the opportunity today to try some other combinations of python and backend, and will update this issue accordingly.</p> | <h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">A figure created on Mac with the MacOSX backend on one screen gets blank when the figure window is dragged to another screen attached to the same computer.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib as mpl
mpl.rcParams["backend"] = "MacOSX"
from matplotlib import pyplot as plt
plt.figure()
plt.plot([0,1],[0,1]) # to have some content
plt.show()
# now drag figure from one screen attached to the computer to another screen attached to the computer"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">as</span> <span class="pl-s1">mpl</span>
<span class="pl-s1">mpl</span>.<span class="pl-s1">rcParams</span>[<span class="pl-s">"backend"</span>] <span class="pl-c1">=</span> <span class="pl-s">"MacOSX"</span>
<span class="pl-k">from</span> <span class="pl-s1">matplotlib</span> <span class="pl-k">import</span> <span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-s1">plt</span>.<span class="pl-en">figure</span>()
<span class="pl-s1">plt</span>.<span class="pl-en">plot</span>([<span class="pl-c1">0</span>,<span class="pl-c1">1</span>],[<span class="pl-c1">0</span>,<span class="pl-c1">1</span>]) <span class="pl-c"># to have some content</span>
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()
<span class="pl-c"># now drag figure from one screen attached to the computer to another screen attached to the computer</span></pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2631586/24354979/6b5b1d72-12f4-11e7-9b43-76c7cf2505f6.png"><img width="755" alt="screen shot 2017-03-27 at 13 50 45" src="https://cloud.githubusercontent.com/assets/2631586/24354979/6b5b1d72-12f4-11e7-9b43-76c7cf2505f6.png" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<p dir="auto">System: MacOS El Capitan<br>
Matplotlib version: 2.0.0<br>
Python version: 2.7.10 (System Python)</p>
<p dir="auto">Matplotlib was installed with pip.</p> | 1 |
<p dir="auto">Lenovo G550. 4gb ram. Intel graphics.<br>
Atom 0.999.<br>
Opening small html 41kb. On opening html editor freeze for for few minutes and showing one popup()<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6039696/7669052/b1b4188c-fc7b-11e4-88e6-cf2e8f156344.png"><img src="https://cloud.githubusercontent.com/assets/6039696/7669052/b1b4188c-fc7b-11e4-88e6-cf2e8f156344.png" alt="error" style="max-width: 100%;"></a></p> | <p dir="auto">May be a known issue, but files with large embedded images such as github's public/enterprise/maintenance.html will often cause Atom to freeze (MacVim actually struggles as well).</p>
<p dir="auto">Seems some of them (github's public/maintenance.html for instance) work fine when in soft wrap mode, or until you move your cursor to the long line when out of soft wrap.</p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=stuartgunter" rel="nofollow">Stuart Gunter</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9226?redirect=false" rel="nofollow">SPR-9226</a></strong> and commented</p>
<p dir="auto">In certain circumstances, the response is committed before the Interceptor postHandle method is invoked. This appears to be caused when the HandlerMethod is annotated with <code class="notranslate">@ResponseBody</code>.</p>
<p dir="auto">Steps to reproduce:</p>
<ol dir="auto">
<li>Create a Controller method annotated with <code class="notranslate">@ResponseBody</code>.</li>
<li>Configure an Interceptor for this path (or all path mappings)</li>
<li>Submit a request to the path above, with a breakpoint set in the Interceptor's postHandle method.</li>
<li>Check the value of response.isCommitted()</li>
</ol>
<p dir="auto">Expected:<br>
Response should not be committed</p>
<p dir="auto">Actual:<br>
Response is committed.</p>
<p dir="auto">Implications:<br>
Interceptors are unable to modify the response for <code class="notranslate">@ResponseBody</code> HandlerMethods. This prevents Interceptors from being able to add headers to the response.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.1</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398216472" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/20595" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/20595/hovercard" href="https://github.com/spring-projects/spring-framework/issues/20595">#20595</a> StringHttpMessageConverter flush out response immediately before execute posthandler (<em><strong>"is duplicated by"</strong></em>)</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398154729" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/14614" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/14614/hovercard" href="https://github.com/spring-projects/spring-framework/issues/14614">#14614</a> Make <code class="notranslate">@RequestMapping</code> inject the negotiated MediaType</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398161090" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/15486" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/15486/hovercard" href="https://github.com/spring-projects/spring-framework/issues/15486">#15486</a> Provide better intercepting model for controllers returning <code class="notranslate">@ResponseBody</code> (<em><strong>"is superseded by"</strong></em>)</li>
</ul>
<p dir="auto">2 votes, 7 watchers</p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=gbilodeau" rel="nofollow">Guillaume Bilodeau</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-3817?redirect=false" rel="nofollow">SPR-3817</a></strong> and commented</p>
<p dir="auto">As discussed here: <a href="http://forum.springframework.org/showthread.php?p=139502" rel="nofollow">http://forum.springframework.org/showthread.php?p=139502</a></p>
<p dir="auto">Given the following context:</p>
<p dir="auto">. an application built with compile-time weaving using AspectJ 1.5.x,<br>
. use of Spring 2.0.x<br>
. a class annotated with <code class="notranslate">@Transactional</code> - not its methods,<br>
. the same class containing one or more setters for dependency injections,<br>
. a Spring application context declaring the above class with a singleton scope and its dependencies through property references<br>
. the same application context using the <tx:annotation-driven /> tag</p>
<p dir="auto">Upon loading the application context and instantiating the annotated class, the container tries to begin a transaction but fails with the following message:</p>
<p dir="auto">java.lang.IllegalStateException: Property 'transactionManager' must be set on transaction aspect</p>
<p dir="auto">The current behavior is understandable: the class was annotated in such a way that all its public methods should be transactional, which includes the DI setters. However this doesn't seem to be desirable, given the thrown exception.</p>
<p dir="auto">One possible workaround is to annotate only the transactional methods (and so not the DI setter methods) instead of the class itself. The main drawback is that this leads to the duplication of the annotation and its list of rollback exceptions. It also requires that all unit tests which operate on the annotated class should provide the AnnotationTransactionAspect a mock PlatformTransactionManager on setUp().</p>
<p dir="auto">One possible solution would be to activate the transactional aspect only after the application context is loaded. Another one would be to introduce a <code class="notranslate">@NotTransactional</code> annotation that would override the class annotation and that could be used on DI setter methods.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0.6</p>
<p dir="auto">2 votes, 7 watchers</p> | 0 |
<p dir="auto">It looks like Angular 2 tries to load files in a path called <code class="notranslate">'rxjs/operators/*'</code> (like <a href="https://github.com/angular/angular/blob/25a2d7b5db7806e1b6b3ce0b5380cf94253bbe4c/modules/angular2/src/facade/async.ts#L13">here</a>). But it seems the path should be called <code class="notranslate">'rxjs/operator/*'</code> (without <code class="notranslate">s</code>).</p>
<p dir="auto">Webpack error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR in ./~/angular2/src/facade/async.js
Module not found: Error: Cannot resolve module 'rxjs/operators/toPromise' in"><pre class="notranslate"><code class="notranslate">ERROR in ./~/angular2/src/facade/async.js
Module not found: Error: Cannot resolve module 'rxjs/operators/toPromise' in
</code></pre></div> | <p dir="auto">In <code class="notranslate">[email protected]</code>:</p>
<p dir="auto"><code class="notranslate">facade/async.js</code> line 19 calls <code class="notranslate">require('rxjs/operators/toPromise');</code></p>
<p dir="auto">As of <code class="notranslate">[email protected]</code> this folder was renamed to <code class="notranslate">operator/toPromise.js</code>.</p>
<p dir="auto">The result is that a jspm install of angular 2 without bundling gets the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="GET http://localhost:8080/jspm_packages/npm/[email protected]/operators/toPromise.js 404 (Not Found)"><pre class="notranslate"><code class="notranslate">GET http://localhost:8080/jspm_packages/npm/[email protected]/operators/toPromise.js 404 (Not Found)
</code></pre></div>
<p dir="auto">The rxjs version should either fixed at version <code class="notranslate">alpha.10</code> or this reference udpated to <code class="notranslate">operator/toPromise.js</code></p> | 1 |
<p dir="auto">It showed, that more reasonable for oVirt VMs <code class="notranslate">state</code> present is to don't start them. Better solution is just to create them if it don't exist and don't touch the state of the VM.</p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">ovirt_vms</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.4.0"><pre class="notranslate"><code class="notranslate">2.4.0
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<h5 dir="auto">SUMMARY</h5>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">/usr/lib/python2.7/site-packages/ansible/modules/system/pamd.py</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
config file = /var/lib/ansible/local/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Aug 29 2016, 10:12:21) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
config file = /var/lib/ansible/local/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Aug 29 2016, 10:12:21) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">[defaults]<br>
inventory = ./inventory_dlabtuxm<br>
forks = 30<br>
remote_port = 22<br>
gather_subset = all<br>
gather_timeout = 10<br>
roles_path = ./roles<br>
host_key_checking = False<br>
timeout = 5<br>
remote_user = root<br>
log_path = /var/log/ansible/ansible.log<br>
ansible_managed = Ansible managed<br>
squash_actions = apk,apt,dnf,homebrew,package,pacman,pkgng,yum,zypper<br>
no_log = False<br>
var_compression_level = 9<br>
module_compression = 'ZIP_DEFLATED'<br>
max_diff_size = 1048576<br>
[privilege_escalation]<br>
become=True<br>
become_method=sudo<br>
become_user=root<br>
become_ask_pass=False<br>
[ssh_connection]<br>
[colors]</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">When you have more than 2 parameters on a rule.control, the module duplicate parameters starting at second parameter, as many times as rule_types exits before. No matter whether apply some changes or not (in the playbook), this happens all the time and inserts these duplicates parameters each time you run the playbook.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Example: /etc/pam.d/system-auth</p>
<p dir="auto">auth required pam_env.so<br>
auth required pam_tally2.so deny=5 onerr=fail<br>
auth sufficient pam_fprintd.so<br>
auth [default=1 success=ok] pam_localuser.so<br>
auth [success=done ignore=ignore default=die] ignore=ignore default=die] ignore=ignore default=die] ignore=ignore default=die] ignore=ignore default=die] pam_unix.so nullok</p>
<p dir="auto">As you can see, there are 4 rule_types (AUTH), before the rule_control ([success=done ignore=ignore default=die]), and it duplicates, starting the second parameter, a total of 4 times.</p>
<p dir="auto">I starting to analyze the code, and I think the string split to assign values to each rule could be enhanced with a loop. That way no matter how many parameters rule.control have.</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/classmethod/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/classmethod">@classmethod</a><br>
def rulefromstring(cls, stringline):<br>
split_line = stringline.split()</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" rule_type = split_line[0]
rule_control = split_line[1]
if rule_control.startswith('['):
rule_control = stringline[stringline.index('['):
stringline.index(']')+1]"><pre class="notranslate"><code class="notranslate"> rule_type = split_line[0]
rule_control = split_line[1]
if rule_control.startswith('['):
rule_control = stringline[stringline.index('['):
stringline.index(']')+1]
</code></pre></div>
<p dir="auto">###################################################################<br>
if "]" in split_line[2]:<br>
rule_module_path = split_line[3]<br>
rule_module_args = split_line[4:]<br>
else:<br>
rule_module_path = split_line[2]<br>
rule_module_args = split_line[3:]<br>
###################################################################</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" return cls(rule_type, rule_control, rule_module_path, rule_module_args)"><pre class="notranslate"><code class="notranslate"> return cls(rule_type, rule_control, rule_module_path, rule_module_args)
</code></pre></div>
<p dir="auto">I tried that piece of code, for example with this line:</p>
<p dir="auto">s="session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid"</p>
<p dir="auto">The result is OK:</p>
<p dir="auto">python test_rulefromstring.py<br>
('session', '[success=1 default=ignore]', 'pam_succeed_if.so', ['service', 'in', 'crond', 'quiet', 'use_uid'])</p>
<p dir="auto">But if you try with more than two parameter in the rule_control:</p>
<p dir="auto">s="account [success=ok new_authtok_reqd=ok ignore=ignore default=bad] pam_sss.so service in crond quiet use_uid"</p>
<p dir="auto">The result is:</p>
<p dir="auto">python test_rulefromstring.py<br>
('account', '[success=ok new_authtok_reqd=ok ignore=ignore default=bad]', 'new_authtok_reqd=ok', ['ignore=ignore', 'default=bad]', 'pam_sss.so', 'service', 'in', 'crond', 'quiet', 'use_uid'])</p>
<p dir="auto">This means that rule_module_path and rule_module_args get an incorrect value.</p>
<p dir="auto">The loop:</p>
<p dir="auto">for line, val in enumerate(stringline.split()):<br>
print line, val<br>
if "]" in val:<br>
rule_module_path = split_line[line+1]<br>
rule_module_args = split_line[line+2:]<br>
else:<br>
rule_module_path = split_line[2]<br>
rule_module_args = split_line[3:]</p>
<h1 dir="auto">python test_rulefromstring.py</h1>
<p dir="auto">0 account<br>
1 [success=ok<br>
2 new_authtok_reqd=ok<br>
3 ignore=ignore<br>
4 default=bad]<br>
5 pam_sss.so<br>
6 service<br>
7 in<br>
8 crond<br>
9 quiet<br>
10 use_uid<br>
('account', '[success=ok new_authtok_reqd=ok ignore=ignore default=bad]', 'pam_sss.so', ['service', 'in', 'crond', 'quiet', 'use_uid'])</p>
<p dir="auto">I haven't been able to found which piece of code change the rule, would you be so kind to help me or guide me on this.</p>
<p dir="auto">Thanks in advance,</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Example: /etc/pam.d/system-auth</p>
<p dir="auto">auth required pam_env.so<br>
auth required pam_tally2.so deny=5 onerr=fail<br>
auth sufficient pam_fprintd.so<br>
auth [default=1 success=ok] pam_localuser.so<br>
auth [success=done ignore=ignore default=die] pam_unix.so nullok</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">Example: /etc/pam.d/system-auth</p>
<p dir="auto">auth required pam_env.so<br>
auth required pam_tally2.so deny=5 onerr=fail<br>
auth sufficient pam_fprintd.so<br>
auth [default=1 success=ok] pam_localuser.so<br>
auth [success=done ignore=ignore default=die] ignore=ignore default=die] ignore=ignore default=die] ignore=ignore default=die] ignore=ignore default=die] pam_unix.so nullok</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</code></pre></div> | 0 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: v2.7.1</li>
<li>Operating System version: OSX 10.14.4</li>
<li>Java version: 1.8.0_202</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" @Test
public void testSerializeTimestamp() throws IOException, ClassNotFoundException {
Timestamp originTime = new Timestamp(System.currentTimeMillis());
this.protostuffObjectOutput.writeObject(originTime);
this.flushToInput();
Timestamp serializedTime = protostuffObjectInput.readObject(Timestamp.class);
assertThat(serializedTime, is(originTime));
}
// output
java.lang.AssertionError:
Expected: is <2019-04-23 19:01:37.31>
but: was <1970-01-01 08:00:00.31>
Expected :is <2019-04-23 19:01:37.31>
Actual :<1970-01-01 08:00:00.31>"><pre class="notranslate"> <span class="pl-c1">@</span><span class="pl-c1">Test</span>
<span class="pl-k">public</span> <span class="pl-smi">void</span> <span class="pl-s1">testSerializeTimestamp</span>() <span class="pl-k">throws</span> <span class="pl-smi">IOException</span>, <span class="pl-s1">ClassNotFoundException</span> {
<span class="pl-smi">Timestamp</span> <span class="pl-s1">originTime</span> = <span class="pl-k">new</span> <span class="pl-smi">Timestamp</span>(<span class="pl-smi">System</span>.<span class="pl-en">currentTimeMillis</span>());
<span class="pl-smi">this</span>.<span class="pl-s1">protostuffObjectOutput</span>.<span class="pl-en">writeObject</span>(<span class="pl-s1">originTime</span>);
<span class="pl-smi">this</span>.<span class="pl-en">flushToInput</span>();
<span class="pl-smi">Timestamp</span> <span class="pl-s1">serializedTime</span> = <span class="pl-s1">protostuffObjectInput</span>.<span class="pl-en">readObject</span>(<span class="pl-smi">Timestamp</span>.<span class="pl-k">class</span>);
<span class="pl-en">assertThat</span>(<span class="pl-s1">serializedTime</span>, <span class="pl-en">is</span>(<span class="pl-s1">originTime</span>));
}
<span class="pl-c">// output</span>
<span class="pl-smi">java</span>.<span class="pl-smi">lang</span>.<span class="pl-smi">AssertionError</span>:
<span class="pl-s1">Expected</span>: <span class="pl-s1">is</span> <<span class="pl-c1">2019</span>-<span class="pl-c1">04</span>-<span class="pl-c1">23</span> <span class="pl-c1">19</span>:<span class="pl-c1">01</span>:<span class="pl-c1">37.31</span>>
<span class="pl-s1">but</span>: <span class="pl-s1">was</span> <<span class="pl-c1">1970</span>-<span class="pl-c1">01</span>-<span class="pl-c1">01</span> <span class="pl-c1">08</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00.31</span>>
<span class="pl-s1">Expected</span> :<span class="pl-s1">is</span> <<span class="pl-c1">2019</span>-<span class="pl-c1">04</span>-<span class="pl-c1">23</span> <span class="pl-c1">19</span>:<span class="pl-c1">01</span>:<span class="pl-c1">37.31</span>>
<span class="pl-s1">Actual</span> :<<span class="pl-c1">1970</span>-<span class="pl-c1">01</span>-<span class="pl-c1">01</span> <span class="pl-c1">08</span>:<span class="pl-c1">00</span>:<span class="pl-c1">00.31</span>></pre></div> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.7</li>
<li>Operating System version:windows 7</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li></li>
</ol>
<p dir="auto"><dubbo:reference id="demoService" interface="com.demo.service.DemoService"<br>
protocol="hessian"><br>
<dubbo:method name="orderData" async="true"/><br>
</dubbo:reference><br>
2.<br>
demoService.orderData(paramsMap);<br>
Future<List> future = RpcContext.getContext().getFuture();<br>
List list = future.get();<br>
3. future is null</p>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">Can get the result.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">future.get() throw null pointer exception,Because the future object is null.</p> | 0 |
<p dir="auto">Neo4j version: 4.4.2<br>
OS: Ubuntu 20.04</p>
<p dir="auto">When running <code class="notranslate">neo4j-admin import</code> the <code class="notranslate">:ID</code> fields are not being imported correctly. A handful of them seem to become duplicated for some reason.</p>
<p dir="auto">Here's the CSV file:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="hash:ID,height:INT,version:INT,prevblock:STRING
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f,0,1,0000000000000000000000000000000000000000000000000000000000000000
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048,1,1,000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd,2,1,00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449,3,1,000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd
000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485,4,1,0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449
000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc,5,1,000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485
000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d,6,1,000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc
0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444,7,1,000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d
00000000408c48f847aa786c2268fc3e6ec2af68e8468a34a28c61b7f1de0dc6,8,1,0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444"><pre class="notranslate"><code class="notranslate">hash:ID,height:INT,version:INT,prevblock:STRING
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f,0,1,0000000000000000000000000000000000000000000000000000000000000000
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048,1,1,000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd,2,1,00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048
0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449,3,1,000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd
000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485,4,1,0000000082b5015589a3fdf2d4baff403e6f0be035a5d9742c1cae6295464449
000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc,5,1,000000004ebadb55ee9096c9a2f8880e09da59c0d68b1c228da88e48844a1485
000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d,6,1,000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc
0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444,7,1,000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d
00000000408c48f847aa786c2268fc3e6ec2af68e8468a34a28c61b7f1de0dc6,8,1,0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444
</code></pre></div>
<p dir="auto">And this is the command I'm using:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="neo4j-admin import --database neo4j --nodes=block=file.csv"><pre class="notranslate"><code class="notranslate">neo4j-admin import --database neo4j --nodes=block=file.csv
</code></pre></div>
<p dir="auto">The import works correctly if I remove <code class="notranslate">:ID</code> from the CSV header. But if you assign <code class="notranslate">:ID</code> to the first field they do not get imported as expected (some get duplicated for some reason).</p>
<p dir="auto">This CSV file worked on Neo4j 4.3, so I think it may be an issue with Neo4j 4.4.2.</p> | <p dir="auto">It will be great if there will be ability to fast edit nodes and relationships properties on the fly from browser interface.</p> | 0 |
<p dir="auto">Dear dev,</p>
<p dir="auto">I like combining box and strip plots, I also like making optimal use of seaborn categorical plotting features, i.e. like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sns.catplot(kind='point', data=alldata_long, x='gene_id', y='TPM', hue='Exp condition', row='Lib prep', height=3, aspect=4)"><pre class="notranslate"><code class="notranslate">sns.catplot(kind='point', data=alldata_long, x='gene_id', y='TPM', hue='Exp condition', row='Lib prep', height=3, aspect=4)
</code></pre></div>
<p dir="auto">I would like to be able to combine both approaches, would the command from the title of this post be an option? At the moment I am having difficulties combining the two plots in a row and col split catplot...</p>
<p dir="auto">Highest regards,</p>
<p dir="auto">Freek.</p> | <p dir="auto">With recent shift in the docs to emphasize the figure-level plots, it raises the challenge that layering multiple plots (i.e. a swarmplot on top of a violinplot) this way is not obvious. For a single axes grid, you can plot directly onto it using the axes-level function you want. For multi-plot grids, you can use <code class="notranslate">.map_dataframe</code>, but synching the order of the semantics between the two plots is a challenge.</p>
<p dir="auto">An option for a better API might be to accept a sequence in <code class="notranslate">kind</code>, i.e.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="sns.catplot(x="total_bill", y="tip", kind=("violin", "swarm"), data=tips)"><pre class="notranslate"><span class="pl-s1">sns</span>.<span class="pl-en">catplot</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s">"total_bill"</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s">"tip"</span>, <span class="pl-s1">kind</span><span class="pl-c1">=</span>(<span class="pl-s">"violin"</span>, <span class="pl-s">"swarm"</span>), <span class="pl-s1">data</span><span class="pl-c1">=</span><span class="pl-s1">tips</span>)</pre></div>
<p dir="auto">This would be straightforward, except what about additional keyword arguments?</p> | 1 |
<p dir="auto">I downloaded Julia 0.3.9 Windows self-extracting archive latest release (2015-05-30 11:24UTC) onto my Windows 8.1 64-bit Lenovo Thinkpad, and it didn't run. It gave me the splash screen and then hung for 5 minutes (no prompt) until I killed it. Can anyone replicate this?</p> | <p dir="auto">I have noticed that Julia 0.3.3 REPL sometimes hangs at startup on windows se:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/7973946/5286150/3294c7ca-7b22-11e4-8fa0-f6d7ae6886a2.png"><img src="https://cloud.githubusercontent.com/assets/7973946/5286150/3294c7ca-7b22-11e4-8fa0-f6d7ae6886a2.png" alt="image" style="max-width: 100%;"></a><br>
I have seen this on my own computer and some of my colleagues.</p> | 1 |
<p dir="auto">I get the following error</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia> x=[1,2]
2-element Array{Int64,1}:
Evaluation succeeded, but an error occurred while showing value of type Array{Int64,1}:
ERROR: premature end of integer: "24"
in error at error.jl:21
in parseint_nocheck at string.jl:1486
in parseint_nocheck at string.jl:1523
in parseint at string.jl:1526
in writemime at repl.jl:21
in display at multimedia.jl:117
in display at multimedia.jl:119
in display at multimedia.jl:151"><pre class="notranslate">julia<span class="pl-k">></span> x<span class="pl-k">=</span>[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>]
<span class="pl-c1">2</span><span class="pl-k">-</span>element Array{Int64,<span class="pl-c1">1</span>}<span class="pl-k">:</span>
Evaluation succeeded, but an error occurred <span class="pl-k">while</span> showing value of type Array{Int64,<span class="pl-c1">1</span>}<span class="pl-k">:</span>
ERROR<span class="pl-k">:</span> premature <span class="pl-k">end</span> of integer<span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">"</span>24<span class="pl-pds">"</span></span>
<span class="pl-k">in</span> error at error<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">21</span>
<span class="pl-k">in</span> parseint_nocheck at string<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">1486</span>
<span class="pl-k">in</span> parseint_nocheck at string<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">1523</span>
<span class="pl-k">in</span> parseint at string<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">1526</span>
<span class="pl-k">in</span> writemime at repl<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">21</span>
<span class="pl-k">in</span> display at multimedia<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">117</span>
<span class="pl-k">in</span> display at multimedia<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">119</span>
<span class="pl-k">in</span> display at multimedia<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">151</span></pre></div>
<p dir="auto">The premature end of integer: "24" appears to be somewhat arbitrary. The error message above was obtained in the shell that opens upon double-clicking the julia application. However, when I call julia from emacs (using ESS) the ERROR-line reads</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="ERROR: premature end of integer: "25""><pre class="notranslate">ERROR<span class="pl-k">:</span> premature <span class="pl-k">end</span> of integer<span class="pl-k">:</span> <span class="pl-s"><span class="pl-pds">"</span>25<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">Otherwise the error message is the same.</p> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> versioninfo()
Julia Version 0.3.0-prerelease+1358
Commit cb26338* (2014-02-01 14:56 UTC)
Platform Info:
System: Windows (i686-w64-mingw32)
CPU: Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz
WORD_SIZE: 32
BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm"><pre class="notranslate"><code class="notranslate">julia> versioninfo()
Julia Version 0.3.0-prerelease+1358
Commit cb26338* (2014-02-01 14:56 UTC)
Platform Info:
System: Windows (i686-w64-mingw32)
CPU: Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz
WORD_SIZE: 32
BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia> a=[1:5]
5-element Array{Int32,1}:
1
2
3
4
5"><pre class="notranslate"><code class="notranslate">julia> a=[1:5]
5-element Array{Int32,1}:
1
2
3
4
5
</code></pre></div>
<p dir="auto">Then calling <code class="notranslate">a[a.>3]</code> crashes the REPL on 32-bit Vista.<br>
I have also tried this win32-prerelease on 64-bit Win7 and it works fine.</p> | 1 |
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
df = pd.DataFrame({'y': [3.5, 4.5, 6.5]}, index=[2.5, 1.5, 3.5])
df.plot(style='o')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'y'</span>: [<span class="pl-c1">3.5</span>, <span class="pl-c1">4.5</span>, <span class="pl-c1">6.5</span>]}, <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-c1">2.5</span>, <span class="pl-c1">1.5</span>, <span class="pl-c1">3.5</span>])
<span class="pl-s1">df</span>.<span class="pl-en">plot</span>(<span class="pl-s1">style</span><span class="pl-c1">=</span><span class="pl-s">'o'</span>)</pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6169306/31855630-2861406e-b6af-11e7-9205-995e580e7e4e.png"><img src="https://user-images.githubusercontent.com/6169306/31855630-2861406e-b6af-11e7-9205-995e580e7e4e.png" alt="actual" style="max-width: 100%;"></a></p>
<h4 dir="auto">Problem description</h4>
<p dir="auto">This above may or may not be expected behaviour, but it did catch me by surprise: The range of the horizontal axis will be [2.5, 3.5], even though one of the data points has an index value outside that range.</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">Instead, I would have expected the output currently obtainable through <code class="notranslate">df.sort_index().plot(style='o')</code>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6169306/31855638-3d677ee2-b6af-11e7-9681-1f0c4f8b5bd5.png"><img src="https://user-images.githubusercontent.com/6169306/31855638-3d677ee2-b6af-11e7-9681-1f0c4f8b5bd5.png" alt="expected" style="max-width: 100%;"></a></p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.6.2.final.0<br>
python-bits: 64<br>
OS: Windows<br>
OS-release: 8.1<br>
machine: AMD64<br>
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: None<br>
LOCALE: None.None</p>
<p dir="auto">pandas: 0.20.3<br>
pytest: 3.2.1<br>
pip: 9.0.1<br>
setuptools: 34.1.0<br>
Cython: 0.26<br>
numpy: 1.13.1<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 6.1.0<br>
sphinx: 1.6.2<br>
patsy: 0.4.1<br>
dateutil: 2.6.1<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: 1.2.1<br>
tables: 3.2.2<br>
numexpr: 2.6.2<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: 2.4.8<br>
xlrd: 1.0.0<br>
xlwt: 1.2.0<br>
xlsxwriter: 0.9.8<br>
lxml: 3.8.0<br>
bs4: 4.6.0<br>
html5lib: 0.9999999<br>
sqlalchemy: 1.1.13<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: 0.5.0</p>
</details> | <p dir="auto">Compare these 2 plots below, this is not expected behavior:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd
from numpy.random import rand
testarr1=rand(100)
testarr2=rand(100)
pd.DataFrame(testarr2,index=testarr1).plot(style='.')
pd.DataFrame(testarr2,index=testarr1).sort().plot(style='.')"><pre class="notranslate"><code class="notranslate">import pandas as pd
from numpy.random import rand
testarr1=rand(100)
testarr2=rand(100)
pd.DataFrame(testarr2,index=testarr1).plot(style='.')
pd.DataFrame(testarr2,index=testarr1).sort().plot(style='.')
</code></pre></div> | 1 |
<p dir="auto">When installing some git dependencies using the Docker image node:10-alpine via <code class="notranslate">npm ci</code>, attempts to <code class="notranslate">npm prune --production</code> result in an error like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q https://github.com/nodecraft/ampify.git /root/.npm/_cacache/tmp/git-clone-6573274f/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-6573274f/.git'"><pre class="notranslate"><code class="notranslate">npm ERR! code 128
npm ERR! Command failed: git clone --mirror -q https://github.com/nodecraft/ampify.git /root/.npm/_cacache/tmp/git-clone-6573274f/.git
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-6573274f/.git'
</code></pre></div>
<p dir="auto">To help replicate the issue, I have a directory that contains a <code class="notranslate">package.json</code> and <code class="notranslate">package-lock.json</code>. I then have a <code class="notranslate">Dockerfile</code> which when building, illustrates the issue.</p>
<p dir="auto">I've created a repository at <a href="https://github.com/Cherry/npm-prune-ci-bug">https://github.com/Cherry/npm-prune-ci-bug</a> detailing this, including commands to run to replicate the issue.</p>
<p dir="auto">Last known working version: <code class="notranslate">6.10.3</code>. This issue does not occur if I use npm version <code class="notranslate">6.10.3</code> or earlier.<br>
Tested versions that throw the above error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="6.11.0
6.11.1
6.11.2
6.11.3
6.12.1
6.13.1"><pre class="notranslate"><code class="notranslate">6.11.0
6.11.1
6.11.2
6.11.3
6.12.1
6.13.1
</code></pre></div>
<p dir="auto">It appears this regression was introduced in <code class="notranslate">6.11.0</code>, and exists through to the latest version.</p>
<p dir="auto">If I can provide any further information, please let me know.</p> | <h1 dir="auto">What / Why</h1>
<p dir="auto">This bug is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="521884660" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/476" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/476/hovercard?comment_id=553917541&comment_type=issue_comment" href="https://github.com/npm/cli/issues/476#issuecomment-553917541">#476 (comment)</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="527439839" data-permission-text="Title is private" data-url="https://github.com/npm/cli/issues/514" data-hovercard-type="issue" data-hovercard-url="/npm/cli/issues/514/hovercard" href="https://github.com/npm/cli/issues/514">#514</a></p>
<h2 dir="auto">When</h2>
<p dir="auto"><code class="notranslate">npm install</code> packages from git in docker</p>
<h2 dir="auto">Where</h2>
<ul dir="auto">
<li>packages from public git repositories</li>
</ul>
<h2 dir="auto">How</h2>
<h3 dir="auto">Current Behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# npm i
npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b v2.0.5 git://github.com/boblauer/MockDate.git /root/.npm/_cacache/tmp/git-clone-c9699b7f
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-c9699b7f': Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-23T09_49_05_990Z-debug.log"><pre class="notranslate"><code class="notranslate"># npm i
npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b v2.0.5 git://github.com/boblauer/MockDate.git /root/.npm/_cacache/tmp/git-clone-c9699b7f
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-c9699b7f': Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-12-23T09_49_05_990Z-debug.log
</code></pre></div>
<h3 dir="auto">Steps to Reproduce</h3>
<ul dir="auto">
<li>Create simple package.json with git dependency</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"name": "test-npm",
"dependencies": {
"mockdate": "git://github.com/boblauer/MockDate.git#v2.0.5"
}
}"><pre class="notranslate"><code class="notranslate">{
"name": "test-npm",
"dependencies": {
"mockdate": "git://github.com/boblauer/MockDate.git#v2.0.5"
}
}
</code></pre></div>
<ul dir="auto">
<li>run <code class="notranslate">docker run --network=host -it -v $(pwd):/var/work/test -w /var/work/test node:12.14.0 /bin/bash</code></li>
<li><code class="notranslate">ls -l</code> shows that files are owned by unknown user and unknown group (this is typical behaviour on build agents like teamcity, teamcity clones git repo and mounts it inside docker container)</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# ls -l
-rw-r--r-- 1 20857 115755 114 Dec 23 09:46 package.json"><pre class="notranslate"><code class="notranslate"># ls -l
-rw-r--r-- 1 20857 115755 114 Dec 23 09:46 package.json
</code></pre></div>
<ul dir="auto">
<li>run <code class="notranslate">npm install</code></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# Depends on environment you can get
npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b v2.0.5 git://github.com/boblauer/MockDate.git /root/.npm/_cacache/tmp/git-clone-c9699b7f
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-c9699b7f': Permission denied
npm ERR!
# or
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@<private server>/admin-template.git
npm ERR!
npm ERR! No user exists for uid 1000
npm ERR! fatal: Could not read from remote repository."><pre class="notranslate"><code class="notranslate"># Depends on environment you can get
npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b v2.0.5 git://github.com/boblauer/MockDate.git /root/.npm/_cacache/tmp/git-clone-c9699b7f
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-c9699b7f': Permission denied
npm ERR!
# or
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@<private server>/admin-template.git
npm ERR!
npm ERR! No user exists for uid 1000
npm ERR! fatal: Could not read from remote repository.
</code></pre></div>
<ul dir="auto">
<li>run <code class="notranslate">npm i -g [email protected]</code> (downgrade to npm 6.10.X)</li>
<li>run <code class="notranslate">npm install</code></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# all works well!
updated 1 package and audited 1 package in 1.355s
found 0 vulnerabilities"><pre class="notranslate"><code class="notranslate"># all works well!
updated 1 package and audited 1 package in 1.355s
found 0 vulnerabilities
</code></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<ul dir="auto">
<li><code class="notranslate">npm install</code> / <code class="notranslate">npm ci</code> works well like [email protected]</li>
</ul> | 1 |
<p dir="auto">Hey,</p>
<p dir="auto">Recently I've been putting together a page that has a lot of data. I'd like to consolidate this more by adding a scrollable feature to my table, however, overflowing the table in y with a max height causes the header to scroll. I've tried several CSS tricks and looked all over the internet for a solution. Most people suggest turning tbody into a block element, however this messes up all of the column formatting.</p>
<p dir="auto">Having the ability to do something similar to <table class="table table-bordered table-scroll table-fixed-header" .... would be awesome.</p> | <p dir="auto">Please consider adding a class named table-fixedheader that can be applied to a table so that the body scrolls under fixed headers.</p>
<p dir="auto">See this JSFiddle for a working demo: <a href="http://jsfiddle.net/drueter/yqgB5/3/" rel="nofollow">http://jsfiddle.net/drueter/yqgB5/3/</a></p>
<p dir="auto">All that is needed:</p>
<div class="highlight highlight-source-css notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="table.table-fixedheader>tbody {
display: block;
}
table.table-fixedheader>tbody {
overflow-y: auto;
height: 50px; /*placeholder: override as needed*/
}
table.table-fixedheader>thead>tr>th, table.table-fixedheader>tbody>tr>td {
float: left;
width: 100px; /*placeholder: override as needed*/
}"><pre class="notranslate"><span class="pl-ent">table</span>.<span class="pl-c1">table-fixedheader</span><span class="pl-c1">></span><span class="pl-ent">tbody</span> {
<span class="pl-c1">display</span><span class="pl-kos">:</span> block;
}
<span class="pl-ent">table</span>.<span class="pl-c1">table-fixedheader</span><span class="pl-c1">></span><span class="pl-ent">tbody</span> {
<span class="pl-c1">overflow-y</span><span class="pl-kos">:</span> auto;
<span class="pl-c1">height</span><span class="pl-kos">:</span> <span class="pl-c1">50<span class="pl-smi">px</span></span>; <span class="pl-c">/*placeholder: override as needed*/</span>
}
<span class="pl-ent">table</span>.<span class="pl-c1">table-fixedheader</span><span class="pl-c1">></span><span class="pl-ent">thead</span><span class="pl-c1">></span><span class="pl-ent">tr</span><span class="pl-c1">></span><span class="pl-ent">th</span><span class="pl-kos">,</span> <span class="pl-ent">table</span>.<span class="pl-c1">table-fixedheader</span><span class="pl-c1">></span><span class="pl-ent">tbody</span><span class="pl-c1">></span><span class="pl-ent">tr</span><span class="pl-c1">></span><span class="pl-ent">td</span> {
<span class="pl-c1">float</span><span class="pl-kos">:</span> left;
<span class="pl-c1">width</span><span class="pl-kos">:</span> <span class="pl-c1">100<span class="pl-smi">px</span></span>; <span class="pl-c">/*placeholder: override as needed*/</span>
}</pre></div>
<p dir="auto">See comments in JSFiddle for usage notes. This seems to work well.</p> | 1 |
<p dir="auto">This is a follow up to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="186020810" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/12601" data-hovercard-type="pull_request" data-hovercard-url="/angular/angular/pull/12601/hovercard" href="https://github.com/angular/angular/pull/12601">#12601</a>. Basically, I'd like to find a way to have a flattened view of router params available to components so that each components need not know about how the router tree has been configured. See <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="186020810" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/12601" data-hovercard-type="pull_request" data-hovercard-url="/angular/angular/pull/12601/hovercard" href="https://github.com/angular/angular/pull/12601">#12601</a> for an implementation idea.</p>
<p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[x] feature request"><pre class="notranslate"><code class="notranslate">[x] feature request
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong></p>
<p dir="auto">Components would need to manually traverse the tree in order to find parameters defined in router tree.</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Components can now be incognizant of the router configuration when finding parameter values.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto">This helps the components consuming ActivatedRoute finding all the parameters defined in the<br>
route, decoupling them from the knowledge of how nested routers are configured.</p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.X</li>
</ul> | <p dir="auto"><strong>I'm submitting a ...</strong> (check one with "x")</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[x] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question"><pre class="notranslate"><code class="notranslate">[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[x] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre></div>
<p dir="auto"><strong>Current behavior</strong><br>
When using a parametrized route which targets a component, only this component can access those parameters.</p>
<p dir="auto"><strong>Expected/desired behavior</strong><br>
It might be necessary to read the parameters in other components.</p>
<p dir="auto"><strong>Reproduction of the problem</strong><br>
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via <a href="https://plnkr.co" rel="nofollow">https://plnkr.co</a> or similar (you can use this template as a starting point: <a href="http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5" rel="nofollow">http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5</a>).<br>
Consider the following route configuration</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export const routes: RouterConfig = [
{ path: 'confirmation/:hashID', component: ConfirmationComponent, canActivate: [AuthGuard] },
];
"><pre class="notranslate"><code class="notranslate">export const routes: RouterConfig = [
{ path: 'confirmation/:hashID', component: ConfirmationComponent, canActivate: [AuthGuard] },
];
</code></pre></div>
<p dir="auto">Consider the following code as part of the ConfirmationComponent</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="this.activatedRoute.params.subscribe(params => {
var hashID = params['hashID'];
},"><pre class="notranslate"><code class="notranslate">this.activatedRoute.params.subscribe(params => {
var hashID = params['hashID'];
},
</code></pre></div>
<p dir="auto">If I use the above code in any other component, hashID won't be available. It is necessary to read location.path() and extract the hashID value.</p>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
Although I understand that the targeted component it the ConfirmationComponent, sometimes other components might need to have access to the parameters explicitly written in the URL.</p>
<p dir="auto"><strong>What is the motivation / use case for changing the behavior?</strong></p>
<p dir="auto"><strong>Please tell us about your environment:</strong></p>
<ul dir="auto">
<li><strong>Angular version:</strong> 2.0.0-rc.4</li>
<li><strong>Browser:</strong> [<strong>all</strong> | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]</li>
<li><strong>Language:</strong> [all | <strong>TypeScript 1.8</strong> | ES6/7 | <strong>ES5</strong>]</li>
</ul> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/node</code> and <code class="notranslate">@types/react-native</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>. (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alloy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alloy">@alloy</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gyzerok/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gyzerok">@gyzerok</a></li>
</ul>
</li>
</ul>
<p dir="auto">Both of the modules seem to define <code class="notranslate">require</code> and this results in some compliation trouble:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="../node_modules/@types/node/index.d.ts(49,13): error TS2451: Cannot redeclare block-scoped variable 'global'.
../node_modules/@types/node/index.d.ts(73,13): error TS2300: Duplicate identifier 'require'.
../node_modules/@types/react-native/index.d.ts(8541,11): error TS2451: Cannot redeclare block-scoped variable 'global'.
../node_modules/@types/react-native/index.d.ts(8542,14): error TS2300: Duplicate identifier 'require'."><pre class="notranslate"><code class="notranslate">../node_modules/@types/node/index.d.ts(49,13): error TS2451: Cannot redeclare block-scoped variable 'global'.
../node_modules/@types/node/index.d.ts(73,13): error TS2300: Duplicate identifier 'require'.
../node_modules/@types/react-native/index.d.ts(8541,11): error TS2451: Cannot redeclare block-scoped variable 'global'.
../node_modules/@types/react-native/index.d.ts(8542,14): error TS2300: Duplicate identifier 'require'.
</code></pre></div>
<p dir="auto">Any tips/workarounds?</p> | <p dir="auto">I am unable to get Type script definition through nuget & package mangers shows error message saying <code class="notranslate">Unable to resolve dependencies. 'bootstrap 3.0.0' is not compatible with 'Twitter.Bootstrap 3.0.1.1 constraint: bootstrap (≥ 3.0.1)'.</code><br>
<code class="notranslate">At line:1 char:1</code><br>
<code class="notranslate">+ Install-Package office-js.TypeScript.DefinitelyTyped</code><br>
<code class="notranslate">+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</code><br>
<code class="notranslate">+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception</code><br>
<code class="notranslate">+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand</code></p> | 0 |
<ul dir="auto">
<li>[*] I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li>[*] I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.5-SNAPSHOT</li>
<li>Dubbo branch: master</li>
<li>Operating System version: macOS Catalina</li>
<li>Java version: jdk-11.0.5</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>start zookeeper in localhost and port is 2181</li>
<li>write provider-side code</li>
<li>start provider, the provider-side code looks like this</li>
</ol>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="public class Application {
private static String zookeeperHost = System.getProperty("zookeeper.address", "127.0.0.1");
public static void main(String[] args) throws Exception {
ServiceConfig<DemoService> service = new ServiceConfig<DemoService>();
service.setApplication(new ApplicationConfig("first-dubbo-provider"));
service.setRegistry(new RegistryConfig("zookeeper://" + zookeeperHost + ":2181"));
service.setInterface(DemoService.class);
service.setRef(new DemoServiceImpl());
service.export();
System.out.println("dubbo service started");
new CountDownLatch(1).await();
}
}"><pre class="notranslate"><span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">Application</span> {
<span class="pl-k">private</span> <span class="pl-k">static</span> <span class="pl-smi">String</span> <span class="pl-s1">zookeeperHost</span> = <span class="pl-smi">System</span>.<span class="pl-en">getProperty</span>(<span class="pl-s">"zookeeper.address"</span>, <span class="pl-s">"127.0.0.1"</span>);
<span class="pl-k">public</span> <span class="pl-k">static</span> <span class="pl-smi">void</span> <span class="pl-en">main</span>(<span class="pl-smi">String</span>[] <span class="pl-s1">args</span>) <span class="pl-k">throws</span> <span class="pl-smi">Exception</span> {
<span class="pl-smi">ServiceConfig</span><<span class="pl-smi">DemoService</span>> <span class="pl-s1">service</span> = <span class="pl-k">new</span> <span class="pl-smi">ServiceConfig</span><<span class="pl-smi">DemoService</span>>();
<span class="pl-s1">service</span>.<span class="pl-en">setApplication</span>(<span class="pl-k">new</span> <span class="pl-smi">ApplicationConfig</span>(<span class="pl-s">"first-dubbo-provider"</span>));
<span class="pl-s1">service</span>.<span class="pl-en">setRegistry</span>(<span class="pl-k">new</span> <span class="pl-smi">RegistryConfig</span>(<span class="pl-s">"zookeeper://"</span> + <span class="pl-s1">zookeeperHost</span> + <span class="pl-s">":2181"</span>));
<span class="pl-s1">service</span>.<span class="pl-en">setInterface</span>(<span class="pl-smi">DemoService</span>.<span class="pl-k">class</span>);
<span class="pl-s1">service</span>.<span class="pl-en">setRef</span>(<span class="pl-k">new</span> <span class="pl-smi">DemoServiceImpl</span>());
<span class="pl-s1">service</span>.<span class="pl-en">export</span>();
<span class="pl-smi">System</span>.<span class="pl-s1">out</span>.<span class="pl-en">println</span>(<span class="pl-s">"dubbo service started"</span>);
<span class="pl-k">new</span> <span class="pl-smi">CountDownLatch</span>(<span class="pl-c1">1</span>).<span class="pl-en">await</span>();
}
}</pre></div>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">But I got an exception.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread "main" java.lang.NullPointerException
at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$7(AbstractInterfaceConfig.java:628)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$8(AbstractInterfaceConfig.java:620)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at org.apache.dubbo.config.AbstractInterfaceConfig.useRegistryForConfigIfNecessary(AbstractInterfaceConfig.java:618)
at org.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:208)
at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:303)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:370)
at com.example.studydubboProvider.Application.main(Application.java:22)"><pre class="notranslate"><code class="notranslate">Exception in thread "main" java.lang.NullPointerException
at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$7(AbstractInterfaceConfig.java:628)
at java.base/java.util.Optional.orElseGet(Optional.java:369)
at org.apache.dubbo.config.AbstractInterfaceConfig.lambda$useRegistryForConfigIfNecessary$8(AbstractInterfaceConfig.java:620)
at java.base/java.util.Optional.ifPresent(Optional.java:183)
at org.apache.dubbo.config.AbstractInterfaceConfig.useRegistryForConfigIfNecessary(AbstractInterfaceConfig.java:618)
at org.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:208)
at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:303)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:370)
at com.example.studydubboProvider.Application.main(Application.java:22)
</code></pre></div>
<p dir="auto">Is this an issue?</p> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.5</li>
<li>Operating System version: CentOS7</li>
<li>Java version: JDK8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">I just updated my application from DUBBO 2.7.3 to 2.7.5. Then I find my 3 group services of same interface lost 2 of them in the registry (NACOS). I also use <code class="notranslate">dubbo-spring-boot-samples /org.apache.dubbo.spring.boot.demo.provider</code> to verify and get the same problem. The following are my steps:</p>
<ol dir="auto">
<li>I difine two @Services implementations of a same interface and use "group" to identify each one.</li>
</ol>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@service(group="s1", version = "1.0.0")
public class DefaultDemoService implements DemoService {}
@service(group="s2", version = "1.0.0")
public class DefaultDemoService2 implements DemoService {}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">service</span>(<span class="pl-s1">group</span>=<span class="pl-s">"s1"</span>, <span class="pl-s1">version</span> = <span class="pl-s">"1.0.0"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">DefaultDemoService</span> <span class="pl-k">implements</span> <span class="pl-smi">DemoService</span> {}
<span class="pl-c1">@</span><span class="pl-c1">service</span>(<span class="pl-s1">group</span>=<span class="pl-s">"s2"</span>, <span class="pl-s1">version</span> = <span class="pl-s">"1.0.0"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">DefaultDemoService2</span> <span class="pl-k">implements</span> <span class="pl-smi">DemoService</span> {}</pre></div>
<p dir="auto">then got the following logs, and only find service with group s1 has registered in NACOS. If I downgrade dubbo to 2.7.3, everything works well as before.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="2020-03-26 18:34:03.243 INFO 12596 --- [ main] b.f.a.ServiceAnnotationBeanPostProcessor : [DUBBO] The BeanDefinition[Root bean: class [org.apache.dubbo.config.spring.ServiceBean]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] of ServiceBean has been registered with name : **ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s1**, dubbo version: 2.7.5, current host: ...
2020-03-26 18:34:03.246 INFO 12596 --- [ main] b.f.a.ServiceAnnotationBeanPostProcessor : [DUBBO] The BeanDefinition[Root bean: class [org.apache.dubbo.config.spring.ServiceBean]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] of ServiceBean has been registered with name : **ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s2**, dubbo version: 2.7.5, current host: ...
2020-03-26 18:34:04.195 WARN 12596 --- [ main] o.a.dubbo.config.context.**ConfigManager** : [DUBBO] **Duplicate ServiceBean found**, there already has one default ServiceBean or more than two ServiceBeans have the same id, you can try to give each ServiceBean a different id : <dubbo:service beanName="ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s2" exported="false" unexported="false" ref="org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService2@abf688e" prefix="dubbo.service.org.apache.dubbo.spring.boot.demo.consumer.DemoService" uniqueServiceName="s2/org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0" interface="org.apache.dubbo.spring.boot.demo.consumer.DemoService" dynamic="true" version="1.0.0" deprecated="false" group="s2" id="**org.apache.dubbo.spring.boot.demo.consumer.DemoService**" valid="true" />, dubbo version: 2.7.5, current host: ..."><pre class="notranslate">2020-03-26 18:34:03.243 INFO 12596 --- [ main] b.f.a.ServiceAnnotationBeanPostProcessor <span class="pl-c1">:</span> [DUBBO] The BeanDefinition[Root bean: class [org.apache.dubbo.config.spring.ServiceBean]<span class="pl-k">;</span> scope<span class="pl-k">=</span><span class="pl-k">;</span> abstract<span class="pl-k">=</span>false<span class="pl-k">;</span> lazyInit<span class="pl-k">=</span>null<span class="pl-k">;</span> autowireMode<span class="pl-k">=</span>0<span class="pl-k">;</span> dependencyCheck<span class="pl-k">=</span>0<span class="pl-k">;</span> autowireCandidate<span class="pl-k">=</span>true<span class="pl-k">;</span> primary<span class="pl-k">=</span>false<span class="pl-k">;</span> factoryBeanName<span class="pl-k">=</span>null<span class="pl-k">;</span> factoryMethodName<span class="pl-k">=</span>null<span class="pl-k">;</span> initMethodName<span class="pl-k">=</span>null<span class="pl-k">;</span> destroyMethodName<span class="pl-k">=</span>null] of ServiceBean has been registered with name <span class="pl-c1">:</span> <span class="pl-k">**</span>ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s1<span class="pl-k">**</span>, dubbo version: 2.7.5, current host: ...
2020-03-26 18:34:03.246 INFO 12596 --- [ main] b.f.a.ServiceAnnotationBeanPostProcessor <span class="pl-c1">:</span> [DUBBO] The BeanDefinition[Root bean: class [org.apache.dubbo.config.spring.ServiceBean]<span class="pl-k">;</span> scope<span class="pl-k">=</span><span class="pl-k">;</span> abstract<span class="pl-k">=</span>false<span class="pl-k">;</span> lazyInit<span class="pl-k">=</span>null<span class="pl-k">;</span> autowireMode<span class="pl-k">=</span>0<span class="pl-k">;</span> dependencyCheck<span class="pl-k">=</span>0<span class="pl-k">;</span> autowireCandidate<span class="pl-k">=</span>true<span class="pl-k">;</span> primary<span class="pl-k">=</span>false<span class="pl-k">;</span> factoryBeanName<span class="pl-k">=</span>null<span class="pl-k">;</span> factoryMethodName<span class="pl-k">=</span>null<span class="pl-k">;</span> initMethodName<span class="pl-k">=</span>null<span class="pl-k">;</span> destroyMethodName<span class="pl-k">=</span>null] of ServiceBean has been registered with name <span class="pl-c1">:</span> <span class="pl-k">**</span>ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s2<span class="pl-k">**</span>, dubbo version: 2.7.5, current host: ...
2020-03-26 18:34:04.195 WARN 12596 --- [ main] o.a.dubbo.config.context.<span class="pl-k">**</span>ConfigManager<span class="pl-k">**</span> <span class="pl-c1">:</span> [DUBBO] <span class="pl-k">**</span>Duplicate ServiceBean found<span class="pl-k">**</span>, there already has one default ServiceBean or more than two ServiceBeans have the same id, you can try to give each ServiceBean a different id <span class="pl-c1">:</span> <span class="pl-k"><</span>dubbo:service beanName=<span class="pl-s"><span class="pl-pds">"</span>ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s2<span class="pl-pds">"</span></span> exported=<span class="pl-s"><span class="pl-pds">"</span>false<span class="pl-pds">"</span></span> unexported=<span class="pl-s"><span class="pl-pds">"</span>false<span class="pl-pds">"</span></span> ref=<span class="pl-s"><span class="pl-pds">"</span>org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService2@abf688e<span class="pl-pds">"</span></span> prefix=<span class="pl-s"><span class="pl-pds">"</span>dubbo.service.org.apache.dubbo.spring.boot.demo.consumer.DemoService<span class="pl-pds">"</span></span> uniqueServiceName=<span class="pl-s"><span class="pl-pds">"</span>s2/org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0<span class="pl-pds">"</span></span> interface=<span class="pl-s"><span class="pl-pds">"</span>org.apache.dubbo.spring.boot.demo.consumer.DemoService<span class="pl-pds">"</span></span> dynamic=<span class="pl-s"><span class="pl-pds">"</span>true<span class="pl-pds">"</span></span> version=<span class="pl-s"><span class="pl-pds">"</span>1.0.0<span class="pl-pds">"</span></span> deprecated=<span class="pl-s"><span class="pl-pds">"</span>false<span class="pl-pds">"</span></span> group=<span class="pl-s"><span class="pl-pds">"</span>s2<span class="pl-pds">"</span></span> id=<span class="pl-s"><span class="pl-pds">"</span>**org.apache.dubbo.spring.boot.demo.consumer.DemoService**<span class="pl-pds">"</span></span> valid=<span class="pl-s"><span class="pl-pds">"</span>true<span class="pl-pds">"</span></span> /<span class="pl-k">></span>, dubbo version: 2.7.5, current host: ...</pre></div>
<ol start="2" dir="auto">
<li>I tried add "provider" for <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/service/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/service">@service</a> :</li>
</ol>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@service(provider = "defaultDemoService", group="s1", version = "1.0.0")
public class DefaultDemoService implements DemoService {}
@service(provider = "defaultDemoService2", group="s2", version = "1.0.0")
public class DefaultDemoService2 implements DemoService {}"><pre class="notranslate"><span class="pl-c1">@</span><span class="pl-c1">service</span>(<span class="pl-s1">provider</span> = <span class="pl-s">"defaultDemoService"</span>, <span class="pl-s1">group</span>=<span class="pl-s">"s1"</span>, <span class="pl-s1">version</span> = <span class="pl-s">"1.0.0"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">DefaultDemoService</span> <span class="pl-k">implements</span> <span class="pl-smi">DemoService</span> {}
<span class="pl-c1">@</span><span class="pl-c1">service</span>(<span class="pl-s1">provider</span> = <span class="pl-s">"defaultDemoService2"</span>, <span class="pl-s1">group</span>=<span class="pl-s">"s2"</span>, <span class="pl-s1">version</span> = <span class="pl-s">"1.0.0"</span>)
<span class="pl-k">public</span> <span class="pl-k">class</span> <span class="pl-smi">DefaultDemoService2</span> <span class="pl-k">implements</span> <span class="pl-smi">DemoService</span> {}</pre></div>
<p dir="auto">then got the fllowing logs:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="2020-03-26 22:27:19.428 WARN 7068 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s1': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService' to required type 'org.apache.dubbo.config.ProviderConfig' for property 'provider'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService' to required type 'org.apache.dubbo.config.ProviderConfig' for property 'provider': no matching editors or conversion strategy found"><pre class="notranslate">2020-03-26 22:27:19.428 WARN 7068 --- [ main] s.c.a.AnnotationConfigApplicationContext <span class="pl-c1">:</span> Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name <span class="pl-s"><span class="pl-pds">'</span>ServiceBean:org.apache.dubbo.spring.boot.demo.consumer.DemoService:1.0.0:s1<span class="pl-pds">'</span></span>: Initialization of bean failed<span class="pl-k">;</span> nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of <span class="pl-c1">type</span> <span class="pl-s"><span class="pl-pds">'</span>org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService<span class="pl-pds">'</span></span> to required <span class="pl-c1">type</span> <span class="pl-s"><span class="pl-pds">'</span>org.apache.dubbo.config.ProviderConfig<span class="pl-pds">'</span></span> <span class="pl-k">for</span> property <span class="pl-s"><span class="pl-pds">'</span>provider<span class="pl-pds">'</span></span><span class="pl-k">;</span> nested exception is java.lang.IllegalStateException: Cannot convert value of <span class="pl-c1">type</span> <span class="pl-s"><span class="pl-pds">'</span>org.apache.dubbo.spring.boot.demo.provider.service.DefaultDemoService<span class="pl-pds">'</span></span> to required <span class="pl-c1">type</span> <span class="pl-s"><span class="pl-pds">'</span>org.apache.dubbo.config.ProviderConfig<span class="pl-pds">'</span></span> <span class="pl-k">for</span> property <span class="pl-s"><span class="pl-pds">'</span>provider<span class="pl-pds">'</span></span>: no matching editors or conversion strategy found</pre></div>
<ol start="3" dir="auto">
<li>I compared the ConfigManager 2.7.3 against 2.7.5, New version add "checkDuplicate" features. I also notice DUBBO may use <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/service/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/service">@service</a>(provider="id") as Bean ID, I tried use this attribute, But also failed with other exceptions.</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<p dir="auto"><a href="https://github.com/apache/dubbo-spring-boot-project/tree/master/dubbo-spring-boot-samples/auto-configure-samples/provider-sample">https://github.com/apache/dubbo-spring-boot-project/tree/master/dubbo-spring-boot-samples/auto-configure-samples/provider-sample</a></p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">I want to use <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/service/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/service">@service</a>(group) to register all my services.</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">Encounter 'Duplicate ServiceBean found'、<code class="notranslate">Failed to convert property value of type</code> failure.</p> | 0 |
<p dir="auto">Feature request: I would like an option to tell Text that it should never overflow its container (in either direction) or edge of the screen. If it does detect such an overflow, I would like it to replace as many characters as necessary with an ellipsis so that there is no overflow.</p> | <p dir="auto">This is a feature request to have text optionally end with ellipsis when overflowing its container. (regardless of multi-line or not)</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/abarth/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/abarth">@abarth</a></p> | 1 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/callemall/material-ui/issues">issues</a> of this repository and believe that this is not a duplicate, although <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="263544855" data-permission-text="Title is private" data-url="https://github.com/mui/material-ui/issues/8580" data-hovercard-type="issue" data-hovercard-url="/mui/material-ui/issues/8580/hovercard" href="https://github.com/mui/material-ui/issues/8580">#8580</a> is certainly related and could be the same root cause.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Am able to use withTheme in my React 16 application</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">When using withTheme from [email protected] with React 16, React gives the following warning, which is fatal to the execution of my app.</p>
<p dir="auto">Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.</p>
<h2 dir="auto">Steps to Reproduce</h2>
<p dir="auto">Here is an example of how I am using withTheme:</p>
<p dir="auto">const MyComponent = props => {<br>
// use props.theme.palette.text.primary<br>
};<br>
export default withTheme(MyComponent);</p>
<h2 dir="auto">Environment</h2>
<p dir="auto">Issue did not exist when using withTheme with React 15. Issue occurs post-upgrade of React.</p>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>1.0.0-beta.16</td>
</tr>
<tr>
<td>React</td>
<td>[email protected], [email protected]</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome Version 61.0.3163.100</td>
</tr>
</tbody>
</table> | <p dir="auto">Adding an errorText dynamically makes all the following content jump unpleasantly.<br>
Perhaps the space for the error text could be reserved in advance, or it could animate the vertical motion instead?</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/113721/11031187/54dcdb68-86db-11e5-8284-6543c4bc2ff1.gif"><img src="https://cloud.githubusercontent.com/assets/113721/11031187/54dcdb68-86db-11e5-8284-6543c4bc2ff1.gif" alt="2" data-animated-image="" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">After the 0.19.0 update, there is an issue with the alignment of FancyZones when there is a change in multiple monitor setup (either connecting/disconnecting my Surface Pro to/from the second monitor). My taskbar positioning is at the top and it seems like the FancyZones thinks that the Taskbar is at the bottom and disregards the area covered by the Taskbar at the top, which leads to this misalignment. It works fine if I restart PowerToys after every change (connect/disconnect) in multiple monitor setup.</p> | <p dir="auto">I think a big enhancement to FancyZones would be if it could remember the original Window size before being put into a Zone and when dragging the Window outside of the Zone it could restore the original Window Size.</p> | 0 |
<p dir="auto">Assume we have a file <code class="notranslate">main.rs</code> which defines a module <code class="notranslate">foo</code> residing in <code class="notranslate">foo.rs</code>. When the package has previously been built, <code class="notranslate">rustpkg build …</code> only checks the timestamp of <code class="notranslate">main.rs</code>, but not that of <code class="notranslate">foo.rs</code>, ignoring changes done there.</p>
<p dir="auto">This also applies to <code class="notranslate">rustpkg test</code> with <code class="notranslate">test.rs</code>.</p> | <p dir="auto">When I go to build something with rustpkg after modifying any file other than main.rs, despite main.rs having <code class="notranslate">mod foo;</code> where the file I'm editing is foo.rs, it doesn't check if that file has been updated when I build.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustpkg --version
WARNING: The Rust package manager is experimental and may be unstable
rustpkg 0.8-pre (4c6bf48 2013-09-17 20:35:54 -0700)
host: x86_64-unknown-linux-gnu"><pre class="notranslate"><code class="notranslate">$ rustpkg --version
WARNING: The Rust package manager is experimental and may be unstable
rustpkg 0.8-pre (4c6bf48 2013-09-17 20:35:54 -0700)
host: x86_64-unknown-linux-gnu
</code></pre></div> | 1 |
<p dir="auto">When enabling log scale for the bar plot, the bars are not plotted properly and the plot is empty.</p>
<p dir="auto">See also this bug report <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1087901" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/163" data-hovercard-type="issue" data-hovercard-url="/matplotlib/matplotlib/issues/163/hovercard" href="https://github.com/matplotlib/matplotlib/issues/163">#163</a> and the corresponding fix <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="15879439" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/2147" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/2147/hovercard" href="https://github.com/matplotlib/matplotlib/pull/2147">#2147</a>.</p>
<p dir="auto">Commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/matplotlib/matplotlib/commit/dda42abd96332578d6764c8f00ae6f520f0691bd/hovercard" href="https://github.com/matplotlib/matplotlib/commit/dda42abd96332578d6764c8f00ae6f520f0691bd"><tt>dda42ab</tt></a> changed the default value of <code class="notranslate">nonpos</code> parameter from <code class="notranslate">clip</code> to <code class="notranslate">mask</code> which introduced the issue. I cannot tell whether <code class="notranslate">clip</code> should be default behavior or <code class="notranslate">mask</code> doesn't work as intended.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib.pyplot as plt
plt.bar(x=[1,2,3], height=[1000,2,3])
plt.yscale("log")
plt.show()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-s1">plt</span>.<span class="pl-en">bar</span>(<span class="pl-s1">x</span><span class="pl-c1">=</span>[<span class="pl-c1">1</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>], <span class="pl-s1">height</span><span class="pl-c1">=</span>[<span class="pl-c1">1000</span>,<span class="pl-c1">2</span>,<span class="pl-c1">3</span>])
<span class="pl-s1">plt</span>.<span class="pl-en">yscale</span>(<span class="pl-s">"log"</span>)
<span class="pl-s1">plt</span>.<span class="pl-en">show</span>()</pre></div>
<p dir="auto">Result is an empty plot. Saving to an image file or PDF doesn't make a change.</p>
<p dir="auto">Adding</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="plt.yscale("log", nonposy="clip")"><pre class="notranslate"><span class="pl-s1">plt</span>.<span class="pl-en">yscale</span>(<span class="pl-s">"log"</span>, <span class="pl-s1">nonposy</span><span class="pl-c1">=</span><span class="pl-s">"clip"</span>)</pre></div>
<p dir="auto">fixes that issue.</p>
<p dir="auto">Additional info:<br>
Latest Miniconda<br>
Various platforms (Ubuntu 16.04, Windows 10, macOS)<br>
Matplotlib 2.1.0, Qt5Agg (from Anaconda)</p> | <h3 dir="auto">Bug report</h3>
<p dir="auto"><strong>Bug summary</strong></p>
<p dir="auto">Setting a logarithmic y-axis with <code class="notranslate">ax.set_yscale('log')</code> causes histograms to disappear from the axis. This occurs in <a href="https://github.com/matplotlib/matplotlib/releases/tag/v2.1.0">2.1.0</a> but not in 2.0.2.</p>
<p dir="auto"><strong>Code for reproduction</strong></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
xs = np.random.normal(size=int(1e6))
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.hist(xs, range=(-5, 5), bins=100)
ax2.hist(xs, range=(-5, 5), bins=100)
ax2.set_ylim(ymin=1)
ax2.set_yscale('log')
fig.savefig('histogram.png')"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-s1">matplotlib</span>.<span class="pl-en">use</span>(<span class="pl-s">'Agg'</span>)
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">pyplot</span> <span class="pl-k">as</span> <span class="pl-s1">plt</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-s1">xs</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">normal</span>(<span class="pl-s1">size</span><span class="pl-c1">=</span><span class="pl-en">int</span>(<span class="pl-c1">1e6</span>))
<span class="pl-s1">fig</span>, (<span class="pl-s1">ax1</span>, <span class="pl-s1">ax2</span>) <span class="pl-c1">=</span> <span class="pl-s1">plt</span>.<span class="pl-en">subplots</span>(<span class="pl-c1">1</span>, <span class="pl-c1">2</span>)
<span class="pl-s1">ax1</span>.<span class="pl-en">hist</span>(<span class="pl-s1">xs</span>, <span class="pl-s1">range</span><span class="pl-c1">=</span>(<span class="pl-c1">-</span><span class="pl-c1">5</span>, <span class="pl-c1">5</span>), <span class="pl-s1">bins</span><span class="pl-c1">=</span><span class="pl-c1">100</span>)
<span class="pl-s1">ax2</span>.<span class="pl-en">hist</span>(<span class="pl-s1">xs</span>, <span class="pl-s1">range</span><span class="pl-c1">=</span>(<span class="pl-c1">-</span><span class="pl-c1">5</span>, <span class="pl-c1">5</span>), <span class="pl-s1">bins</span><span class="pl-c1">=</span><span class="pl-c1">100</span>)
<span class="pl-s1">ax2</span>.<span class="pl-en">set_ylim</span>(<span class="pl-s1">ymin</span><span class="pl-c1">=</span><span class="pl-c1">1</span>)
<span class="pl-s1">ax2</span>.<span class="pl-en">set_yscale</span>(<span class="pl-s">'log'</span>)
<span class="pl-s1">fig</span>.<span class="pl-en">savefig</span>(<span class="pl-s">'histogram.png'</span>)</pre></div>
<p dir="auto"><strong>Actual outcome</strong></p>
<p dir="auto">With <strong>2.1.0</strong>:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/540853/31249955-9632ab66-aa19-11e7-8aab-c6a7ccac306f.png"><img src="https://user-images.githubusercontent.com/540853/31249955-9632ab66-aa19-11e7-8aab-c6a7ccac306f.png" alt="2.1.0" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Expected outcome</strong></p>
<p dir="auto">I expect to see a logarithm y-axis <em>and</em> the histogram, but I only see the former. With <strong>2.0.2</strong> I see this:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/540853/31249924-795ab998-aa19-11e7-8c3f-f205ea54e817.png"><img src="https://user-images.githubusercontent.com/540853/31249924-795ab998-aa19-11e7-8c3f-f205ea54e817.png" alt="2.0.2" style="max-width: 100%;"></a></p> | 1 |
<p dir="auto">[Enter steps to reproduce below:]</p>
<ol dir="auto">
<li>Try to open /Applications/Atom.app/Contents/Resources/app.asar</li>
</ol>
<p dir="auto"><strong>Atom Version</strong>: 0.194.0<br>
<strong>System</strong>: Mac OS X 10.10.3<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: ENOENT, not found in /Applications/Atom.app/Contents/Resources/app.asar</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At /Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:457
Error: ENOENT, not found in /Applications/Atom.app/Contents/Resources/app.asar
at createNotFoundError (ATOM_SHELL_ASAR.js:101:13)
at Object.module.(anonymous function) [as open] (ATOM_SHELL_ASAR.js:156:25)
at ReadStream.open (fs.js:1668:6)
at new ReadStream (fs.js:1655:10)
at Object.fs.createReadStream (fs.js:1610:10)
at File.module.exports.File.read (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:286:27)
at TextBuffer.module.exports.TextBuffer.updateCachedDiskContents (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:948:61)
at TextBuffer.module.exports.TextBuffer.load (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:974:19)
at Project.module.exports.Project.buildBuffer (/Applications/Atom.app/Contents/Resources/app.asar/src/project.js:446:21)
at Project.module.exports.Project.bufferForPath (/Applications/Atom.app/Contents/Resources/app.asar/src/project.js:416:63)"><pre class="notranslate"><code class="notranslate">At /Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:457
Error: ENOENT, not found in /Applications/Atom.app/Contents/Resources/app.asar
at createNotFoundError (ATOM_SHELL_ASAR.js:101:13)
at Object.module.(anonymous function) [as open] (ATOM_SHELL_ASAR.js:156:25)
at ReadStream.open (fs.js:1668:6)
at new ReadStream (fs.js:1655:10)
at Object.fs.createReadStream (fs.js:1610:10)
at File.module.exports.File.read (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:286:27)
at TextBuffer.module.exports.TextBuffer.updateCachedDiskContents (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:948:61)
at TextBuffer.module.exports.TextBuffer.load (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:974:19)
at Project.module.exports.Project.buildBuffer (/Applications/Atom.app/Contents/Resources/app.asar/src/project.js:446:21)
at Project.module.exports.Project.bufferForPath (/Applications/Atom.app/Contents/Resources/app.asar/src/project.js:416:63)
</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<h3 dir="auto">Config</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"core": {
"themes": [
"one-dark-ui",
"one-dark-syntax"
]
},
"editor": {
"invisibles": {},
"fontSize": 12
}
}"><pre class="notranslate">{
<span class="pl-ent">"core"</span>: {
<span class="pl-ent">"themes"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>one-dark-ui<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>one-dark-syntax<span class="pl-pds">"</span></span>
]
},
<span class="pl-ent">"editor"</span>: {
<span class="pl-ent">"invisibles"</span>: {},
<span class="pl-ent">"fontSize"</span>: <span class="pl-c1">12</span>
}
}</pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
No installed packages
# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
<span class="pl-en">No</span> <span class="pl-en">installed</span> packages
<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div> | <p dir="auto">This one is easy to reproduce in my environment.</p>
<p dir="auto">/opt/atom is where I have atom installed<br>
$ pwd<br>
/opt/atom/share/atom/resources<br>
$ ls -lsn<br>
total 116<br>
4 drwxrwxr-x. 15 1000 1000 4096 Mar 27 01:22 app<br>
112 -rw-rw-r--. 1 1000 1000 112711 Mar 27 01:22 atom.asar</p>
<p dir="auto">[Enter steps to reproduce below:]</p>
<ol dir="auto">
<li>cd /opt/atom/share/atom/resources/</li>
<li>atom</li>
<li>click "atom.asar" in tree view</li>
</ol>
<p dir="auto"><strong>Atom Version</strong>: 0.188.0-d462895<br>
<strong>System</strong>: linux 3.19.1-201.fc21.i686<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: ENOENT, not found in /opt/atom/share/atom/resources/atom.asar</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At /opt/atom/share/atom/resources/app/src/workspace.js:518
Error: ENOENT, not found in /opt/atom/share/atom/resources/atom.asar
at createNotFoundError (ATOM_SHELL_ASAR.js:101:13)
at Object.module.(anonymous function) [as open] (ATOM_SHELL_ASAR.js:156:25)
at ReadStream.open (fs.js:1630:6)
at new ReadStream (fs.js:1617:10)
at Object.fs.createReadStream (fs.js:1571:10)
at File.module.exports.File.read (/opt/atom/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:307:27)
at TextBuffer.module.exports.TextBuffer.updateCachedDiskContents (/opt/atom/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1009:61)
at TextBuffer.module.exports.TextBuffer.load (/opt/atom/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1033:19)
at Project.module.exports.Project.buildBuffer (/opt/atom/share/atom/resources/app/src/project.js:507:21)
at Project.module.exports.Project.bufferForPath (/opt/atom/share/atom/resources/app/src/project.js:477:63)"><pre class="notranslate"><code class="notranslate">At /opt/atom/share/atom/resources/app/src/workspace.js:518
Error: ENOENT, not found in /opt/atom/share/atom/resources/atom.asar
at createNotFoundError (ATOM_SHELL_ASAR.js:101:13)
at Object.module.(anonymous function) [as open] (ATOM_SHELL_ASAR.js:156:25)
at ReadStream.open (fs.js:1630:6)
at new ReadStream (fs.js:1617:10)
at Object.fs.createReadStream (fs.js:1571:10)
at File.module.exports.File.read (/opt/atom/share/atom/resources/app/node_modules/pathwatcher/lib/file.js:307:27)
at TextBuffer.module.exports.TextBuffer.updateCachedDiskContents (/opt/atom/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1009:61)
at TextBuffer.module.exports.TextBuffer.load (/opt/atom/share/atom/resources/app/node_modules/text-buffer/lib/text-buffer.js:1033:19)
at Project.module.exports.Project.buildBuffer (/opt/atom/share/atom/resources/app/src/project.js:507:21)
at Project.module.exports.Project.bufferForPath (/opt/atom/share/atom/resources/app/src/project.js:477:63)
</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<h3 dir="auto">Config</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"core": {
"excludeVcsIgnoredPaths": false,
"autoHideMenuBar": true
},
"editor": {
"invisibles": {},
"autoIndentOnPaste": false,
"showInvisibles": true,
"softWrap": true,
"fontSize": 14
}
}"><pre class="notranslate">{
<span class="pl-ent">"core"</span>: {
<span class="pl-ent">"excludeVcsIgnoredPaths"</span>: <span class="pl-c1">false</span>,
<span class="pl-ent">"autoHideMenuBar"</span>: <span class="pl-c1">true</span>
},
<span class="pl-ent">"editor"</span>: {
<span class="pl-ent">"invisibles"</span>: {},
<span class="pl-ent">"autoIndentOnPaste"</span>: <span class="pl-c1">false</span>,
<span class="pl-ent">"showInvisibles"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"softWrap"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"fontSize"</span>: <span class="pl-c1">14</span>
}
}</pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
tabs-to-spaces, v0.9.0
# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
tabs<span class="pl-k">-</span>to<span class="pl-k">-</span>spaces, v0.<span class="pl-ii">9</span>.<span class="pl-ii">0</span>
<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div> | 1 |
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:<br>
"webpack": "^5.74.0",<br>
"webpack-cli": "^4.10.0",<br>
"webpack-dev-middleware": "3.7.3",<br>
"webpack-hot-server-middleware": "^0.6.1",<br>
Node.js version: 16<br>
Operating System: mac windows<br>
Additional tools: vscode<br>
I was using webpack webpack-dev-middleware Webpack-hot-server-middleware for Node SSR Webpack-hot-server-middleware Hot updates will report errors in Webpack V5.<br>
error message:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="client.8d64ed71.js:55443 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
at self.webpackHotUpdatewebpack_demo1 (client.8d64ed71.js:55443:46)
at client.cbbc1ef178f03782094c.hot-update.js:2:38
self.webpackHotUpdatewebpack_demo1 @ client.8d64ed71.js:55443
(anonymous) @ client.cbbc1ef178f03782094c.hot-update.js:2
vendors.8d64ed71.js:29085 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
at self.webpackHotUpdatewebpack_demo1 (vendors.8d64ed71.js:29085:46)
at vendors.cbbc1ef178f03782094c.hot-update.js:2:38"><pre class="notranslate"><code class="notranslate">client.8d64ed71.js:55443 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
at self.webpackHotUpdatewebpack_demo1 (client.8d64ed71.js:55443:46)
at client.cbbc1ef178f03782094c.hot-update.js:2:38
self.webpackHotUpdatewebpack_demo1 @ client.8d64ed71.js:55443
(anonymous) @ client.cbbc1ef178f03782094c.hot-update.js:2
vendors.8d64ed71.js:29085 Uncaught TypeError: Cannot read properties of undefined (reading 'push')
at self.webpackHotUpdatewebpack_demo1 (vendors.8d64ed71.js:29085:46)
at vendors.cbbc1ef178f03782094c.hot-update.js:2:38
</code></pre></div>
<p dir="auto">I think Webpack-hot-Server-middleware is not compatible with Webpack V5. I hope you can upgrade Webpack-hot-Server-middleware。</p>
<p dir="auto">Also, when I use WebPack V5, Webpack-dev-middleware is not upgraded to the highest V5 version, otherwise, res.getHeader is undefined。<br>
I an error making project address: <a href="https://github.com/qq281113270/react-ssr-lazy-loading">https://github.com/qq281113270/react-ssr-lazy-loading</a></p> | <h1 dir="auto">The fix</h1>
<p dir="auto">Clean your <code class="notranslate">dist</code> folder before building (suggestion: use the <code class="notranslate">clean-webpack-plugin</code>)</p>
<h1 dir="auto">Bug report</h1>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">For some reason, having a large number of old builds/files in the <code class="notranslate">dist</code> folder will cause webpack to run out of memory and die during compilation. I don't understand why webpack would be interacting with these files or why this matters, but it does.</p>
<p dir="auto">Running <code class="notranslate">webpack -p</code> dies with out of memory</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory"><pre class="notranslate"><code class="notranslate">FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
</code></pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<ol dir="auto">
<li>Have one successful build in the <code class="notranslate">dist</code> folder</li>
<li>Comment out your <code class="notranslate">clean-webpack-plugin</code></li>
<li>Duplicate this bundle a bunch of times</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="for i in {1..50}; do cp dist/index-13ca58.bundle.js "dist/index-$i-13ca58.bundle.js"; done
for i in {1..50}; do cp dist/index-13ca58.bundle.css "dist/index-$i-13ca58.bundle.css"; done
./node_modules/.bin/webpack -p"><pre class="notranslate"><code class="notranslate">for i in {1..50}; do cp dist/index-13ca58.bundle.js "dist/index-$i-13ca58.bundle.js"; done
for i in {1..50}; do cp dist/index-13ca58.bundle.css "dist/index-$i-13ca58.bundle.css"; done
./node_modules/.bin/webpack -p
</code></pre></div>
<ol start="4" dir="auto">
<li>Wait foreverrrr, then observe webpack die</li>
</ol>
<p dir="auto">Here's my config</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// webpack.config.js
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const path = require('path');
const process = require('process');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const webpack = require('webpack');
const isProd = process.env.NODE_ENV === 'production';
const distDirName = 'dist';
const sharedPlugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['index'],
template: './index.html',
favicon: './favicon.ico',
inject: true,
}),
];
const prodPlugins = [
// new CleanWebpackPlugin(distDirName),
...sharedPlugins,
new ExtractTextPlugin('[name]-[hash:6].bundle.css'),
];
const devPlugins = [
...sharedPlugins,
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin({
filename: 'tests.html',
chunks: ['tests'],
template: './tests.html',
inject: true,
}),
];
const prodEntry = { index: ['index.tsx'] };
const devEntry = { ...prodEntry, tests: ['tests.ts'] };
const rhlBabelLoader = {
loader: 'babel-loader',
options: {
plugins: [
'react-hot-loader/babel',
],
},
}
const urlLoader = 'url-loader?limit=16384&name=[path][name]-[hash:6].[ext]';
const tsLoader = 'ts-loader';
const styleLoader = 'style-loader?sourceMap';
const cssModulesLoader = 'typings-for-css-modules-loader?modules&sass&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]&banner=// This file automatically generated by typings-for-css-modules-loader';
const cssLoader = 'css-loader';
const postCssLoader = {
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: (loader) => [
require('autoprefixer')(),
],
sourceMap: true,
},
};
const sassLoader = 'sass-loader?sourceMap';
module.exports = {
context: path.resolve(__dirname),
entry: isProd ? prodEntry : devEntry,
output: {
publicPath: '/', // Where you uploaded your bundled files. (Relative to server root)
path: path.resolve(__dirname, distDirName), // Local disk directory to store all your output files (Absolute path)
filename: '[name]-[hash:6].bundle.js',
},
module: {
rules: [
{
test: /\.(j|t)sx?$/,
exclude: [path.resolve(__dirname, 'node_modules')],
use: isProd ? [tsLoader] : [rhlBabelLoader, tsLoader],
},
{
test: /\.(png|jpg|gif)$/,
use: [urlLoader]
},
{
test: /\.(s*)css$/,
include: [path.resolve(__dirname, 'node_modules'), path.resolve(__dirname, 'styles')],
use: isProd
? ExtractTextPlugin.extract({ use: [cssLoader, postCssLoader, sassLoader], fallback: styleLoader })
: [styleLoader, cssLoader, postCssLoader, sassLoader],
},
{
test: /\.(s*)css$/,
include: [path.resolve(__dirname, 'components')],
use: isProd
? ExtractTextPlugin.extract({ use: [cssModulesLoader, postCssLoader, sassLoader], fallback: styleLoader })
: [styleLoader, cssModulesLoader, postCssLoader, sassLoader],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '*'],
modules: [
path.join(__dirname, ''),
path.join(__dirname, 'node_modules'),
],
},
devServer: {
publicPath: '/', // URL path where the webpack files are served from
contentBase: path.join(__dirname, distDirName), // A directory to serve files non-webpack files from
host: '0.0.0.0',
port: process.env.PORT,
disableHostCheck: true,
hot: true,
inline: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000,
ignored: /node_modules/,
},
historyApiFallback: true,
},
plugins: isProd ? prodPlugins : devPlugins,
};
/* eslint-enable import/no-commonjs */"><pre class="notranslate"><code class="notranslate">// webpack.config.js
/* eslint-disable import/no-commonjs */
const fs = require('fs');
const path = require('path');
const process = require('process');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const webpack = require('webpack');
const isProd = process.env.NODE_ENV === 'production';
const distDirName = 'dist';
const sharedPlugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['index'],
template: './index.html',
favicon: './favicon.ico',
inject: true,
}),
];
const prodPlugins = [
// new CleanWebpackPlugin(distDirName),
...sharedPlugins,
new ExtractTextPlugin('[name]-[hash:6].bundle.css'),
];
const devPlugins = [
...sharedPlugins,
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin({
filename: 'tests.html',
chunks: ['tests'],
template: './tests.html',
inject: true,
}),
];
const prodEntry = { index: ['index.tsx'] };
const devEntry = { ...prodEntry, tests: ['tests.ts'] };
const rhlBabelLoader = {
loader: 'babel-loader',
options: {
plugins: [
'react-hot-loader/babel',
],
},
}
const urlLoader = 'url-loader?limit=16384&name=[path][name]-[hash:6].[ext]';
const tsLoader = 'ts-loader';
const styleLoader = 'style-loader?sourceMap';
const cssModulesLoader = 'typings-for-css-modules-loader?modules&sass&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]&banner=// This file automatically generated by typings-for-css-modules-loader';
const cssLoader = 'css-loader';
const postCssLoader = {
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: (loader) => [
require('autoprefixer')(),
],
sourceMap: true,
},
};
const sassLoader = 'sass-loader?sourceMap';
module.exports = {
context: path.resolve(__dirname),
entry: isProd ? prodEntry : devEntry,
output: {
publicPath: '/', // Where you uploaded your bundled files. (Relative to server root)
path: path.resolve(__dirname, distDirName), // Local disk directory to store all your output files (Absolute path)
filename: '[name]-[hash:6].bundle.js',
},
module: {
rules: [
{
test: /\.(j|t)sx?$/,
exclude: [path.resolve(__dirname, 'node_modules')],
use: isProd ? [tsLoader] : [rhlBabelLoader, tsLoader],
},
{
test: /\.(png|jpg|gif)$/,
use: [urlLoader]
},
{
test: /\.(s*)css$/,
include: [path.resolve(__dirname, 'node_modules'), path.resolve(__dirname, 'styles')],
use: isProd
? ExtractTextPlugin.extract({ use: [cssLoader, postCssLoader, sassLoader], fallback: styleLoader })
: [styleLoader, cssLoader, postCssLoader, sassLoader],
},
{
test: /\.(s*)css$/,
include: [path.resolve(__dirname, 'components')],
use: isProd
? ExtractTextPlugin.extract({ use: [cssModulesLoader, postCssLoader, sassLoader], fallback: styleLoader })
: [styleLoader, cssModulesLoader, postCssLoader, sassLoader],
},
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json', '*'],
modules: [
path.join(__dirname, ''),
path.join(__dirname, 'node_modules'),
],
},
devServer: {
publicPath: '/', // URL path where the webpack files are served from
contentBase: path.join(__dirname, distDirName), // A directory to serve files non-webpack files from
host: '0.0.0.0',
port: process.env.PORT,
disableHostCheck: true,
hot: true,
inline: true,
watchOptions: {
aggregateTimeout: 300,
poll: 1000,
ignored: /node_modules/,
},
historyApiFallback: true,
},
plugins: isProd ? prodPlugins : devPlugins,
};
/* eslint-enable import/no-commonjs */
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
compilation should be successful</p>
<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version: <code class="notranslate">^3.8.1</code><br>
Node.js version: <code class="notranslate">9.11.1</code> and <code class="notranslate">8.9.1</code> (confirmed on both)<br>
Operating System: Ubuntu 14, 2GB of ram, 4GB of swap, running a docker container using image <code class="notranslate">node:9.11.1</code><br>
Additional tools:</p> | 0 |
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
When using <code class="notranslate">useState()</code> hook in a functional component, I get the following error:</p>
<blockquote>
<p dir="auto">Hooks can only be called inside the body of a function component</p>
</blockquote>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.</strong><br>
The functional component where the hook is being used:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const AuthForm = () => {
const [value, setValue] = useState(1);
return (
<Paper square>
<Tabs
value={value}
indicatorColor="primary"
textColor="primary"
onChange={() => setValue(value)}
>
<Tab label="Active" />
<Tab label="Active" />
</Tabs>
</Paper>
);
};"><pre class="notranslate"><code class="notranslate">const AuthForm = () => {
const [value, setValue] = useState(1);
return (
<Paper square>
<Tabs
value={value}
indicatorColor="primary"
textColor="primary"
onChange={() => setValue(value)}
>
<Tab label="Active" />
<Tab label="Active" />
</Tabs>
</Paper>
);
};
</code></pre></div>
<p dir="auto">package.json:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
"main": "index.js",
"scripts": {
"dev": "nodemon index.js --ignore client"
},
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@material-ui/core": "^3.9.2",
"apollo-boost": "^0.1.27",
"axios": "^0.18.0",
"babel-loader": "^8.0.5",
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.16.0",
"connect-mongo": "^2.0.3",
"express": "^4.16.4",
"express-graphql": "^0.7.1",
"express-session": "^1.15.6",
"graphql": "^14.1.1",
"html-webpack-plugin": "^3.2.0",
"lodash": "^4.17.4",
"mongoose": "^5.4.11",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"react": "16.8.1",
"react-apollo": "^2.4.1",
"react-dom": "16.8.1",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"webpack": "^4.29.3",
"webpack-dev-middleware": "^3.5.2"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/plugin-transform-react-jsx": "^7.3.0"
}
}"><pre class="notranslate"><code class="notranslate">{
"main": "index.js",
"scripts": {
"dev": "nodemon index.js --ignore client"
},
"dependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@material-ui/core": "^3.9.2",
"apollo-boost": "^0.1.27",
"axios": "^0.18.0",
"babel-loader": "^8.0.5",
"bcrypt-nodejs": "0.0.3",
"body-parser": "^1.16.0",
"connect-mongo": "^2.0.3",
"express": "^4.16.4",
"express-graphql": "^0.7.1",
"express-session": "^1.15.6",
"graphql": "^14.1.1",
"html-webpack-plugin": "^3.2.0",
"lodash": "^4.17.4",
"mongoose": "^5.4.11",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"react": "16.8.1",
"react-apollo": "^2.4.1",
"react-dom": "16.8.1",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"webpack": "^4.29.3",
"webpack-dev-middleware": "^3.5.2"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/plugin-transform-react-jsx": "^7.3.0"
}
}
</code></pre></div>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
App should run without any errors.</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong><br>
React: 16.8.1<br>
ReactDOM: 16.8.1<br>
Chrome: 71.0.3578.98</p> | <p dir="auto">Currently, <code class="notranslate">createElement</code> throws the warning:</p>
<blockquote>
<p dir="auto">Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components).</p>
</blockquote>
<p dir="auto">It would be more helpful if the warning actually said what value was passed, e.g.:</p>
<blockquote>
<p dir="auto">Warning: React.createElement: 5 is an invalid value for type. It should be a string (for DOM elements) or a ReactClass (for composite components).</p>
</blockquote> | 0 |
<ul dir="auto">
<li>Electron version: 1.8.2</li>
<li>Operating system: OSX, Windows</li>
</ul>
<p dir="auto">Issue: Whenever <code class="notranslate">gulp = require("gulp");</code> is invoked, Electron 1.8.2 application crashes with "DevTools was disconnected from the page" message.</p>
<p dir="auto">Everything works fine with Electron 1.7.11.</p> | <ul dir="auto">
<li>Electron version: Anything over 1.7.8, until the latest 1.8.2-beta.1</li>
<li>Node: 8.8.0</li>
<li>Operating system: high sierra</li>
</ul>
<p dir="auto">Going over 1.7.8 seems to break Electron for one of our projects. It's hard to track down what's going on but here's the output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="❯ yarn run electron
yarn run v1.2.1
$ electron .dev/electron.js
/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron[41928]: ../../vendor/node/src/async-wrap.cc:399:void node::SetupHooks(const FunctionCallbackInfo<v8::Value> &): Assertion `env->async_hooks_init_function().IsEmpty()' failed.
1: node::Abort() [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
2: node::Assert(char const* const (*) [4]) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
3: node::AsyncWrap::Initialize(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
4: v8::internal::StrDup(char const*) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
5: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
6: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
7: 0x3eadf51843fd
8: 0x3eadf527777c
9: 0x3eadf523be1c
✨ Done in 0.40s."><pre class="notranslate"><code class="notranslate">❯ yarn run electron
yarn run v1.2.1
$ electron .dev/electron.js
/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron[41928]: ../../vendor/node/src/async-wrap.cc:399:void node::SetupHooks(const FunctionCallbackInfo<v8::Value> &): Assertion `env->async_hooks_init_function().IsEmpty()' failed.
1: node::Abort() [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
2: node::Assert(char const* const (*) [4]) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
3: node::AsyncWrap::Initialize(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Context>) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
4: v8::internal::StrDup(char const*) [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
5: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
6: v8::internal::compiler::BranchElimination::ControlPathConditions::operator==(v8::internal::compiler::BranchElimination::ControlPathConditions const&) const [/Users/drcmda/dev/stepdoctor/node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libnode.dylib]
7: 0x3eadf51843fd
8: 0x3eadf527777c
9: 0x3eadf523be1c
✨ Done in 0.40s.
</code></pre></div>
<p dir="auto">It happens when we require a file that has async/await calls in it, but nothing's yet executed. But the moment we go back to 1.7.8 it starts working again.</p> | 1 |
<p dir="auto">The following code should be disallowed in strict mode and ES5:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""\5";
"\05";
"\55";
"\055";"><pre class="notranslate"><code class="notranslate">"\5";
"\05";
"\55";
"\055";
</code></pre></div>
<p dir="auto">This is disallowed by Annex B.1.2 of the EcmaScript 5 spec.</p> | <p dir="auto">When setting up a default <code class="notranslate">tsconfig.json</code> file, we had initially put <code class="notranslate">noEmit: true</code>, so that people could run tsc to typecheck without generating a file (useful for some people's IDE configs and development styles).</p>
<p dir="auto">It would be nice to be able to still use <code class="notranslate">--out</code> (or perhaps some other keyword if <code class="notranslate">noEmit</code> is meant to capture mistakes) so that we wouldn't need to modify our config to generate an output file, while not having people accidentally generate a bunch of files when calling without <code class="notranslate">--out</code>.</p>
<p dir="auto">Current behavior is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="╰─$ tsc --out test.tsout
error TS5053: Option 'noEmit' cannot be specified with option 'out'."><pre class="notranslate"><code class="notranslate">╰─$ tsc --out test.tsout
error TS5053: Option 'noEmit' cannot be specified with option 'out'.
</code></pre></div> | 0 |
<p dir="auto">In rustc 1.3.0 stable the following code triggers an ICE:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct FooBar<'a> {
func: &'a Fn(&mut u32),
}
const FOO: FooBar<'static> = FooBar {
func: &|bar: &mut u32| {
println!("{}", *bar);
// This statement results in an ICE.
let inner = |bar: &mut u32| {
println!("{}", *bar);
};
// Uncomment this for a different(?) ICE.
//(inner)(bar);
}
};
fn main() {
let mut bar = 5;
(FOO.func)(&mut bar);
}"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">FooBar</span><span class="pl-kos"><</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-c1">func</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-c1">'</span><span class="pl-ent">a</span> <span class="pl-smi">Fn</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>
<span class="pl-k">const</span> <span class="pl-v">FOO</span><span class="pl-kos">:</span> <span class="pl-smi">FooBar</span><span class="pl-kos"><</span><span class="pl-c1">'</span><span class="pl-ent">static</span><span class="pl-kos">></span> = <span class="pl-smi">FooBar</span> <span class="pl-kos">{</span>
<span class="pl-c1">func</span><span class="pl-kos">:</span> <span class="pl-c1">&</span>|<span class="pl-s1">bar</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">u32</span>| <span class="pl-kos">{</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, *bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// This statement results in an ICE.</span>
<span class="pl-k">let</span> inner = |<span class="pl-s1">bar</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">u32</span>| <span class="pl-kos">{</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, *bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// Uncomment this for a different(?) ICE.</span>
<span class="pl-c">//(inner)(bar);</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-k">mut</span> bar = <span class="pl-c1">5</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span><span class="pl-v">FOO</span><span class="pl-kos">.</span><span class="pl-c1">func</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The above code as-is produces the following stack trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Compiling ice_nested_closure v0.1.0 (file:///home/faultyram/code/rust/ice_nested_closure)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:363
stack backtrace:
1: 0x7f0bc200f66e - sys::backtrace::write::ha67a6a2049d22fadIvs
2: 0x7f0bc2017d55 - panicking::on_panic::hfa4bf0215983f759lzx
3: 0x7f0bc1fd894e - rt::unwind::begin_unwind_inner::ha1b5da93bdf7e8ffC0w
4: 0x7f0bc1fd96b6 - rt::unwind::begin_unwind_fmt::hac9e09b20e42a51cIZw
5: 0x7f0bc20178f6 - rust_begin_unwind
6: 0x7f0bc205eb64 - panicking::panic_fmt::hd75b6cee85f3afe4SgC
7: 0x7f0bc205891d - panicking::panic::h25435899636f1091pfC
8: 0x7f0bc01adc45 - middle::ty::ctxt<'tcx>::closure_kind::h3ef8af572aaca971Em8
9: 0x7f0bc0def7af - trans::base::self_type_for_closure::hce2ac9a27a7229f9cWg
10: 0x7f0bc0df0585 - trans::declare::declare_rust_fn::h23ae5856407a285cI0A
11: 0x7f0bc0e534b1 - trans::declare::define_internal_rust_fn::he183aa012af49686gcB
12: 0x7f0bc0e526e9 - trans::closure::get_or_create_closure_declaration::hf10894c31fc3f525pmr
13: 0x7f0bc0e542cb - trans::closure::trans_closure_expr::hcc02521c6bd07707qrr
14: 0x7f0bc0e67f76 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
15: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
16: 0x7f0bc0e66a9a - trans::consts::get_const_expr_as_global::hd38709c357ba535cxjt
17: 0x7f0bc0e7d935 - trans::expr::trans_into::hd80da72fd88f78b0voB
18: 0x7f0bc0eebcf0 - trans::_match::mk_binding_alloca::h8933109284487913883
19: 0x7f0bc0df68d4 - trans::base::init_local::h05162f2d49649b99pOh
20: 0x7f0bc0e0bec6 - trans::controlflow::trans_block::h712a0dbbff7e0feau1v
21: 0x7f0bc0ea4b4f - trans::expr::trans_rvalue_dps_unadjusted::h0c5c402374fadccbRyC
22: 0x7f0bc0e7dbc8 - trans::expr::trans_into::hd80da72fd88f78b0voB
23: 0x7f0bc0e0c213 - trans::controlflow::trans_block::h712a0dbbff7e0feau1v
24: 0x7f0bc0e0afd6 - trans::base::trans_closure::h5ba05285462a4747sDi
25: 0x7f0bc0e544f9 - trans::closure::trans_closure_expr::hcc02521c6bd07707qrr
26: 0x7f0bc0e67f76 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
27: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
28: 0x7f0bc0e6a4c2 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
29: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
30: 0x7f0bc0e71727 - trans::consts::const_expr_unadjusted::closure.49914
31: 0x7f0bc0e7149e - vec::Vec<T>.FromIterator<T>::from_iter::h17887475302167253138
32: 0x7f0bc0e71089 - trans::consts::const_expr_unadjusted::closure.49903
33: 0x7f0bc0e69212 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
34: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
35: 0x7f0bc0e66a9a - trans::consts::get_const_expr_as_global::hd38709c357ba535cxjt
36: 0x7f0bc0e6901d - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
37: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
38: 0x7f0bc0e6800b - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
39: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
40: 0x7f0bc0e68cdf - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
41: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
42: 0x7f0bc0e66a9a - trans::consts::get_const_expr_as_global::hd38709c357ba535cxjt
43: 0x7f0bc0deb10c - trans::expr::trans::h0a46d0057de341dfLuB
44: 0x7f0bc0e414ff - trans::callee::trans_args::h9758e89dd2def684Efp
45: 0x7f0bc0ec727f - trans::callee::trans_call_inner::h3610184059173036198
46: 0x7f0bc0ea5666 - trans::expr::trans_rvalue_dps_unadjusted::h0c5c402374fadccbRyC
47: 0x7f0bc0e7dbc8 - trans::expr::trans_into::hd80da72fd88f78b0voB
48: 0x7f0bc0e7d4a2 - trans::controlflow::trans_stmt_semi::haea6d90b71002e6cy0v
49: 0x7f0bc0e0be9a - trans::controlflow::trans_block::h712a0dbbff7e0feau1v
50: 0x7f0bc0e0afd6 - trans::base::trans_closure::h5ba05285462a4747sDi
51: 0x7f0bc0e0c808 - trans::base::trans_fn::h05022c5934c7e8c7fNi
52: 0x7f0bc0e0f928 - trans::base::trans_item::hd3ac3af06c93993fPdj
53: 0x7f0bc0e1c40c - trans::base::trans_crate::h14e6ea6d455593f8i0j
54: 0x7f0bc25812f4 - driver::phase_4_translate_to_llvm::h8ce7c7bfb0fd9b185Oa
55: 0x7f0bc257b885 - driver::phase_3_run_analysis_passes::closure.16542
56: 0x7f0bc2575ab1 - middle::ty::ctxt<'tcx>::create_and_enter::h9578579149294230291
57: 0x7f0bc2570991 - driver::phase_3_run_analysis_passes::h8415522514568150077
58: 0x7f0bc2554a90 - driver::compile_input::h52c7dafd49963360Tba
59: 0x7f0bc263aa63 - run_compiler::h473c62e00f865fa9A7b
60: 0x7f0bc26384de - boxed::F.FnBox<A>::call_box::h10713159552398332324
61: 0x7f0bc2637e09 - rt::unwind::try::try_fn::h16887904248528792425
62: 0x7f0bc201784d - __rust_try
63: 0x7f0bc20028f7 - rt::unwind::try::inner_try::hafffff77ddacfa5fvWw
64: 0x7f0bc2638028 - boxed::F.FnBox<A>::call_box::h5417278073590676257
65: 0x7f0bc2016991 - sys::thread::Thread::new::thread_start::h29dca2a2cf2294b535v
66: 0x7f0bbc88e4a3 - start_thread
67: 0x7f0bc1c7013c - clone
68: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate"> Compiling ice_nested_closure v0.1.0 (file:///home/faultyram/code/rust/ice_nested_closure)
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:363
stack backtrace:
1: 0x7f0bc200f66e - sys::backtrace::write::ha67a6a2049d22fadIvs
2: 0x7f0bc2017d55 - panicking::on_panic::hfa4bf0215983f759lzx
3: 0x7f0bc1fd894e - rt::unwind::begin_unwind_inner::ha1b5da93bdf7e8ffC0w
4: 0x7f0bc1fd96b6 - rt::unwind::begin_unwind_fmt::hac9e09b20e42a51cIZw
5: 0x7f0bc20178f6 - rust_begin_unwind
6: 0x7f0bc205eb64 - panicking::panic_fmt::hd75b6cee85f3afe4SgC
7: 0x7f0bc205891d - panicking::panic::h25435899636f1091pfC
8: 0x7f0bc01adc45 - middle::ty::ctxt<'tcx>::closure_kind::h3ef8af572aaca971Em8
9: 0x7f0bc0def7af - trans::base::self_type_for_closure::hce2ac9a27a7229f9cWg
10: 0x7f0bc0df0585 - trans::declare::declare_rust_fn::h23ae5856407a285cI0A
11: 0x7f0bc0e534b1 - trans::declare::define_internal_rust_fn::he183aa012af49686gcB
12: 0x7f0bc0e526e9 - trans::closure::get_or_create_closure_declaration::hf10894c31fc3f525pmr
13: 0x7f0bc0e542cb - trans::closure::trans_closure_expr::hcc02521c6bd07707qrr
14: 0x7f0bc0e67f76 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
15: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
16: 0x7f0bc0e66a9a - trans::consts::get_const_expr_as_global::hd38709c357ba535cxjt
17: 0x7f0bc0e7d935 - trans::expr::trans_into::hd80da72fd88f78b0voB
18: 0x7f0bc0eebcf0 - trans::_match::mk_binding_alloca::h8933109284487913883
19: 0x7f0bc0df68d4 - trans::base::init_local::h05162f2d49649b99pOh
20: 0x7f0bc0e0bec6 - trans::controlflow::trans_block::h712a0dbbff7e0feau1v
21: 0x7f0bc0ea4b4f - trans::expr::trans_rvalue_dps_unadjusted::h0c5c402374fadccbRyC
22: 0x7f0bc0e7dbc8 - trans::expr::trans_into::hd80da72fd88f78b0voB
23: 0x7f0bc0e0c213 - trans::controlflow::trans_block::h712a0dbbff7e0feau1v
24: 0x7f0bc0e0afd6 - trans::base::trans_closure::h5ba05285462a4747sDi
25: 0x7f0bc0e544f9 - trans::closure::trans_closure_expr::hcc02521c6bd07707qrr
26: 0x7f0bc0e67f76 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
27: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
28: 0x7f0bc0e6a4c2 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
29: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
30: 0x7f0bc0e71727 - trans::consts::const_expr_unadjusted::closure.49914
31: 0x7f0bc0e7149e - vec::Vec<T>.FromIterator<T>::from_iter::h17887475302167253138
32: 0x7f0bc0e71089 - trans::consts::const_expr_unadjusted::closure.49903
33: 0x7f0bc0e69212 - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
34: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
35: 0x7f0bc0e66a9a - trans::consts::get_const_expr_as_global::hd38709c357ba535cxjt
36: 0x7f0bc0e6901d - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
37: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
38: 0x7f0bc0e6800b - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
39: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
40: 0x7f0bc0e68cdf - trans::consts::const_expr_unadjusted::h1d2d83c04c480e728Et
41: 0x7f0bc0e65e7f - trans::consts::const_expr::h08aedd7988733ed6Yot
42: 0x7f0bc0e66a9a - trans::consts::get_const_expr_as_global::hd38709c357ba535cxjt
43: 0x7f0bc0deb10c - trans::expr::trans::h0a46d0057de341dfLuB
44: 0x7f0bc0e414ff - trans::callee::trans_args::h9758e89dd2def684Efp
45: 0x7f0bc0ec727f - trans::callee::trans_call_inner::h3610184059173036198
46: 0x7f0bc0ea5666 - trans::expr::trans_rvalue_dps_unadjusted::h0c5c402374fadccbRyC
47: 0x7f0bc0e7dbc8 - trans::expr::trans_into::hd80da72fd88f78b0voB
48: 0x7f0bc0e7d4a2 - trans::controlflow::trans_stmt_semi::haea6d90b71002e6cy0v
49: 0x7f0bc0e0be9a - trans::controlflow::trans_block::h712a0dbbff7e0feau1v
50: 0x7f0bc0e0afd6 - trans::base::trans_closure::h5ba05285462a4747sDi
51: 0x7f0bc0e0c808 - trans::base::trans_fn::h05022c5934c7e8c7fNi
52: 0x7f0bc0e0f928 - trans::base::trans_item::hd3ac3af06c93993fPdj
53: 0x7f0bc0e1c40c - trans::base::trans_crate::h14e6ea6d455593f8i0j
54: 0x7f0bc25812f4 - driver::phase_4_translate_to_llvm::h8ce7c7bfb0fd9b185Oa
55: 0x7f0bc257b885 - driver::phase_3_run_analysis_passes::closure.16542
56: 0x7f0bc2575ab1 - middle::ty::ctxt<'tcx>::create_and_enter::h9578579149294230291
57: 0x7f0bc2570991 - driver::phase_3_run_analysis_passes::h8415522514568150077
58: 0x7f0bc2554a90 - driver::compile_input::h52c7dafd49963360Tba
59: 0x7f0bc263aa63 - run_compiler::h473c62e00f865fa9A7b
60: 0x7f0bc26384de - boxed::F.FnBox<A>::call_box::h10713159552398332324
61: 0x7f0bc2637e09 - rt::unwind::try::try_fn::h16887904248528792425
62: 0x7f0bc201784d - __rust_try
63: 0x7f0bc20028f7 - rt::unwind::try::inner_try::hafffff77ddacfa5fvWw
64: 0x7f0bc2638028 - boxed::F.FnBox<A>::call_box::h5417278073590676257
65: 0x7f0bc2016991 - sys::thread::Thread::new::thread_start::h29dca2a2cf2294b535v
66: 0x7f0bbc88e4a3 - start_thread
67: 0x7f0bc1c7013c - clone
68: 0x0 - <unknown>
</code></pre></div>
<p dir="auto">Uncommenting the line <code class="notranslate">//(inner)(foobar);</code> produces:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" Compiling ice_nested_closure v0.1.0 (file:///home/faultyram/code/rust/ice_nested_closure)
thread 'rustc' panicked at 'assertion failed: self.inh.deferred_call_resolutions.borrow().is_empty()', src/librustc_typeck/check/mod.rs:1971
stack backtrace:
1: 0x7fef4483766e - sys::backtrace::write::ha67a6a2049d22fadIvs
2: 0x7fef4483fd55 - panicking::on_panic::hfa4bf0215983f759lzx
3: 0x7fef4480094e - rt::unwind::begin_unwind_inner::ha1b5da93bdf7e8ffC0w
4: 0x7fef43f8ed91 - rt::unwind::begin_unwind::h12043835423437895913
5: 0x7fef43fb2712 - check::FnCtxt<'a, 'tcx>::select_all_obligations_or_error::h1fb080f55aa6bc05Vyp
6: 0x7fef4401f29f - check::check_const::hdf9e82e64dc18ba9pns
7: 0x7fef4400ee1f - check::check_item_type::h2be86c0a5866445bdRn
8: 0x7fef44015124 - check::check_item_types::he8badf30eb589763ewn
9: 0x7fef440d4bab - check_crate::h341139d405597625laD
10: 0x7fef44d9f199 - driver::phase_3_run_analysis_passes::closure.16542
11: 0x7fef44d9dab1 - middle::ty::ctxt<'tcx>::create_and_enter::h9578579149294230291
12: 0x7fef44d98991 - driver::phase_3_run_analysis_passes::h8415522514568150077
13: 0x7fef44d7ca90 - driver::compile_input::h52c7dafd49963360Tba
14: 0x7fef44e62a63 - run_compiler::h473c62e00f865fa9A7b
15: 0x7fef44e604de - boxed::F.FnBox<A>::call_box::h10713159552398332324
16: 0x7fef44e5fe09 - rt::unwind::try::try_fn::h16887904248528792425
17: 0x7fef4483f84d - __rust_try
18: 0x7fef4482a8f7 - rt::unwind::try::inner_try::hafffff77ddacfa5fvWw
19: 0x7fef44e60028 - boxed::F.FnBox<A>::call_box::h5417278073590676257
20: 0x7fef4483e991 - sys::thread::Thread::new::thread_start::h29dca2a2cf2294b535v
21: 0x7fef3f0b64a3 - start_thread
22: 0x7fef4449813c - clone
23: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate"> Compiling ice_nested_closure v0.1.0 (file:///home/faultyram/code/rust/ice_nested_closure)
thread 'rustc' panicked at 'assertion failed: self.inh.deferred_call_resolutions.borrow().is_empty()', src/librustc_typeck/check/mod.rs:1971
stack backtrace:
1: 0x7fef4483766e - sys::backtrace::write::ha67a6a2049d22fadIvs
2: 0x7fef4483fd55 - panicking::on_panic::hfa4bf0215983f759lzx
3: 0x7fef4480094e - rt::unwind::begin_unwind_inner::ha1b5da93bdf7e8ffC0w
4: 0x7fef43f8ed91 - rt::unwind::begin_unwind::h12043835423437895913
5: 0x7fef43fb2712 - check::FnCtxt<'a, 'tcx>::select_all_obligations_or_error::h1fb080f55aa6bc05Vyp
6: 0x7fef4401f29f - check::check_const::hdf9e82e64dc18ba9pns
7: 0x7fef4400ee1f - check::check_item_type::h2be86c0a5866445bdRn
8: 0x7fef44015124 - check::check_item_types::he8badf30eb589763ewn
9: 0x7fef440d4bab - check_crate::h341139d405597625laD
10: 0x7fef44d9f199 - driver::phase_3_run_analysis_passes::closure.16542
11: 0x7fef44d9dab1 - middle::ty::ctxt<'tcx>::create_and_enter::h9578579149294230291
12: 0x7fef44d98991 - driver::phase_3_run_analysis_passes::h8415522514568150077
13: 0x7fef44d7ca90 - driver::compile_input::h52c7dafd49963360Tba
14: 0x7fef44e62a63 - run_compiler::h473c62e00f865fa9A7b
15: 0x7fef44e604de - boxed::F.FnBox<A>::call_box::h10713159552398332324
16: 0x7fef44e5fe09 - rt::unwind::try::try_fn::h16887904248528792425
17: 0x7fef4483f84d - __rust_try
18: 0x7fef4482a8f7 - rt::unwind::try::inner_try::hafffff77ddacfa5fvWw
19: 0x7fef44e60028 - boxed::F.FnBox<A>::call_box::h5417278073590676257
20: 0x7fef4483e991 - sys::thread::Thread::new::thread_start::h29dca2a2cf2294b535v
21: 0x7fef3f0b64a3 - start_thread
22: 0x7fef4449813c - clone
23: 0x0 - <unknown>
</code></pre></div>
<p dir="auto">Note that the following compiles and runs successfully:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="struct FooBar<'a> {
func: &'a Fn(&mut u32),
}
fn main() {
let foo = FooBar {
func: &|bar: &mut u32| {
println!("{}", *bar);
// This statement results in an ICE.
let inner = |bar: &mut u32| {
println!("{}", *bar);
};
// Uncomment this for a different(?) ICE.
(inner)(bar);
}
};
let mut bar = 5;
(foo.func)(&mut bar);
}"><pre class="notranslate"><span class="pl-k">struct</span> <span class="pl-smi">FooBar</span><span class="pl-kos"><</span><span class="pl-c1">'</span><span class="pl-ent">a</span><span class="pl-kos">></span> <span class="pl-kos">{</span>
<span class="pl-c1">func</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-c1">'</span><span class="pl-ent">a</span> <span class="pl-smi">Fn</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> foo = <span class="pl-smi">FooBar</span> <span class="pl-kos">{</span>
<span class="pl-c1">func</span><span class="pl-kos">:</span> <span class="pl-c1">&</span>|<span class="pl-s1">bar</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">u32</span>| <span class="pl-kos">{</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, *bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// This statement results in an ICE.</span>
<span class="pl-k">let</span> inner = |<span class="pl-s1">bar</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">u32</span>| <span class="pl-kos">{</span>
<span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span>, *bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// Uncomment this for a different(?) ICE.</span>
<span class="pl-kos">(</span>inner<span class="pl-kos">)</span><span class="pl-kos">(</span>bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-k">mut</span> bar = <span class="pl-c1">5</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span>foo<span class="pl-kos">.</span><span class="pl-c1">func</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> bar<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div> | <p dir="auto">I tried this code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const X: u8 = || -> u8 { 5 }();"><pre class="notranslate"><code class="notranslate">const X: u8 = || -> u8 { 5 }();
</code></pre></div>
<p dir="auto">I expected to see this happen: Either a compilation error, or to be equivalent to const X: u8 = 5.</p>
<p dir="auto">Instead, this happened: Internal compiler error</p>
<h2 dir="auto">Meta</h2>
<p dir="auto"><code class="notranslate">rustc --version --verbose</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="rustc 1.4.0-nightly (20a8412e0 2015-08-28)
binary: rustc
commit-hash: 20a8412e09e2883489736b4ae3dc138f243d1a17
commit-date: 2015-08-28
host: x86_64-unknown-linux-gnu
release: 1.4.0-nightly"><pre class="notranslate"><code class="notranslate">rustc 1.4.0-nightly (20a8412e0 2015-08-28)
binary: rustc
commit-hash: 20a8412e09e2883489736b4ae3dc138f243d1a17
commit-date: 2015-08-28
host: x86_64-unknown-linux-gnu
release: 1.4.0-nightly
</code></pre></div>
<p dir="auto">Backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'rustc' panicked at 'assertion failed: self.inh.deferred_call_resolutions.borrow().is_empty()', ../src/librustc_typeck/check/mod.rs:2023
stack backtrace:
1: 0x7fc7fbaf90a9 - sys::backtrace::tracing::imp::write::he11991336d112ae3Aes
2: 0x7fc7fbb00d76 - panicking::on_panic::hd741984fb33f3e317ex
3: 0x7fc7fbac55de - rt::unwind::begin_unwind_inner::h837b3c3463e1a06eLHw
4: 0x7fc7fab0ca9f - rt::unwind::begin_unwind::h10622579821064218427
5: 0x7fc7fab3216c - check::FnCtxt<'a, 'tcx>::select_all_obligations_or_error::h966bbb42357b6836dvr
6: 0x7fc7fabd43fc - check::check_const::hbed0eb360d678b26Acu
7: 0x7fc7fabc22c7 - check::check_item_type::h25c10dc6ab99c072tKp
8: 0x7fc7fac84392 - check_crate::hf540b00aced9403awAE
9: 0x7fc7fc049a8e - driver::phase_3_run_analysis_passes::closure.20656
10: 0x7fc7fc02c0c3 - middle::ty::ctxt<'tcx>::create_and_enter::h8301109304510330010
11: 0x7fc7fc02745d - driver::phase_3_run_analysis_passes::h13747097652036984327
12: 0x7fc7fc00a876 - driver::compile_input::h0626ad86fff9a5b9Tba
13: 0x7fc7fc16c98b - run_compiler::h4c5bab99983d75bd0bc
14: 0x7fc7fc16a257 - boxed::F.FnBox<A>::call_box::h7998076066074844987
15: 0x7fc7fc169cc4 - rt::unwind::try::try_fn::h11048267709636862519
16: 0x7fc7fbb00918 - __rust_try
17: 0x7fc7fbaed1d2 - rt::unwind::try::inner_try::h62b49309b595e978EDw
18: 0x7fc7fc169e58 - boxed::F.FnBox<A>::call_box::h8109257951937123469
19: 0x7fc7fbaffd63 - sys::thread::Thread::new::thread_start::h78cb9ca46e8b6bb6rNv
20: 0x7fc7f56c0181 - start_thread
21: 0x7fc7fb77947c - __clone
22: 0x0 - <unknown>
"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'assertion failed: self.inh.deferred_call_resolutions.borrow().is_empty()', ../src/librustc_typeck/check/mod.rs:2023
stack backtrace:
1: 0x7fc7fbaf90a9 - sys::backtrace::tracing::imp::write::he11991336d112ae3Aes
2: 0x7fc7fbb00d76 - panicking::on_panic::hd741984fb33f3e317ex
3: 0x7fc7fbac55de - rt::unwind::begin_unwind_inner::h837b3c3463e1a06eLHw
4: 0x7fc7fab0ca9f - rt::unwind::begin_unwind::h10622579821064218427
5: 0x7fc7fab3216c - check::FnCtxt<'a, 'tcx>::select_all_obligations_or_error::h966bbb42357b6836dvr
6: 0x7fc7fabd43fc - check::check_const::hbed0eb360d678b26Acu
7: 0x7fc7fabc22c7 - check::check_item_type::h25c10dc6ab99c072tKp
8: 0x7fc7fac84392 - check_crate::hf540b00aced9403awAE
9: 0x7fc7fc049a8e - driver::phase_3_run_analysis_passes::closure.20656
10: 0x7fc7fc02c0c3 - middle::ty::ctxt<'tcx>::create_and_enter::h8301109304510330010
11: 0x7fc7fc02745d - driver::phase_3_run_analysis_passes::h13747097652036984327
12: 0x7fc7fc00a876 - driver::compile_input::h0626ad86fff9a5b9Tba
13: 0x7fc7fc16c98b - run_compiler::h4c5bab99983d75bd0bc
14: 0x7fc7fc16a257 - boxed::F.FnBox<A>::call_box::h7998076066074844987
15: 0x7fc7fc169cc4 - rt::unwind::try::try_fn::h11048267709636862519
16: 0x7fc7fbb00918 - __rust_try
17: 0x7fc7fbaed1d2 - rt::unwind::try::inner_try::h62b49309b595e978EDw
18: 0x7fc7fc169e58 - boxed::F.FnBox<A>::call_box::h8109257951937123469
19: 0x7fc7fbaffd63 - sys::thread::Thread::new::thread_start::h78cb9ca46e8b6bb6rNv
20: 0x7fc7f56c0181 - start_thread
21: 0x7fc7fb77947c - __clone
22: 0x0 - <unknown>
</code></pre></div> | 1 |
<p dir="auto">[Enter steps to reproduce below:]</p>
<ol dir="auto">
<li>...</li>
<li>...</li>
</ol>
<p dir="auto"><strong>Atom Version</strong>: 0.209.0<br>
<strong>System</strong>: Mac OS X 10.10.3<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: EIO: i/o error, open '/Volumes/bifrost.melted.pw/var/www/steelbea.ms/index.html'</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:759
Error: EIO: i/o error, open '/Volumes/bifrost.melted.pw/var/www/steelbea.ms/index.html'
at Error (native)
at Object.fs.openSync (fs.js:544:18)
at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
at Object.fs.writeFileSync (fs.js:1155:15)
at Object.fsPlus.writeFileSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/fs-plus/lib/fs-plus.js:279:17)
at File.module.exports.File.writeFileSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:264:19)
at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:362:21)
at File.module.exports.File.writeSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:336:12)
at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:992:17)
at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:978:19)"><pre class="notranslate"><code class="notranslate">At /Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:759
Error: EIO: i/o error, open '/Volumes/bifrost.melted.pw/var/www/steelbea.ms/index.html'
at Error (native)
at Object.fs.openSync (fs.js:544:18)
at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
at Object.fs.writeFileSync (fs.js:1155:15)
at Object.fsPlus.writeFileSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/fs-plus/lib/fs-plus.js:279:17)
at File.module.exports.File.writeFileSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:264:19)
at File.module.exports.File.writeFileWithPrivilegeEscalationSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:362:21)
at File.module.exports.File.writeSync (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/pathwatcher/lib/file.js:336:12)
at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:992:17)
at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:978:19)
</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -0:06.9.0 core:paste (atom-text-editor.editor.is-focused)
10x -0:02.3.0 core:save (atom-text-editor.editor.is-focused)"><pre class="notranslate"><code class="notranslate"> -0:06.9.0 core:paste (atom-text-editor.editor.is-focused)
10x -0:02.3.0 core:save (atom-text-editor.editor.is-focused)
</code></pre></div>
<h3 dir="auto">Config</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"core": {},
"editor": {
"invisibles": {}
}
}"><pre class="notranslate">{
<span class="pl-ent">"core"</span>: {},
<span class="pl-ent">"editor"</span>: {
<span class="pl-ent">"invisibles"</span>: {}
}
}</pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
No installed packages
# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
<span class="pl-en">No</span> <span class="pl-en">installed</span> packages
<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div> | <p dir="auto">[Enter steps to reproduce below:]</p>
<ol dir="auto">
<li>have SFTP Net Drive (Free version) map a remote location to drive</li>
<li>opened this drive with Atom</li>
<li>wrote to a file on local machine without issue</li>
<li>changed permissions remotely so i could execute this file</li>
<li>atom gives me the jarring red window of erroneous doom</li>
<li>send report, and thank atom developers / debuggers for their awesome tool</li>
</ol>
<p dir="auto"><strong>Atom Version</strong>: 0.190.0<br>
<strong>System</strong>: Microsoft Windows 7 Ultimate<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: EIO: i/o error, open 'U:\new_p4\build'</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\src\pane.js:734
Error: EIO: i/o error, open 'U:\new_p4\build'
at Error (native)
at Object.fs.openSync (fs.js:544:18)
at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
at Object.fs.writeFileSync (fs.js:1155:15)
at Object.fsPlus.writeFileSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\fs-plus\lib\fs-plus.js:246:17)
at File.module.exports.File.writeFileSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\pathwatcher\lib\file.js:264:19)
at File.module.exports.File.writeFileWithPrivilegeEscalationSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\pathwatcher\lib\file.js:362:21)
at File.module.exports.File.writeSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\pathwatcher\lib\file.js:336:12)
at TextBuffer.module.exports.TextBuffer.saveAs (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:913:17)
at TextBuffer.module.exports.TextBuffer.save (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:899:19)"><pre class="notranslate"><code class="notranslate">At C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\src\pane.js:734
Error: EIO: i/o error, open 'U:\new_p4\build'
at Error (native)
at Object.fs.openSync (fs.js:544:18)
at Object.module.(anonymous function) [as openSync] (ATOM_SHELL_ASAR.js:118:20)
at Object.fs.writeFileSync (fs.js:1155:15)
at Object.fsPlus.writeFileSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\fs-plus\lib\fs-plus.js:246:17)
at File.module.exports.File.writeFileSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\pathwatcher\lib\file.js:264:19)
at File.module.exports.File.writeFileWithPrivilegeEscalationSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\pathwatcher\lib\file.js:362:21)
at File.module.exports.File.writeSync (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\pathwatcher\lib\file.js:336:12)
at TextBuffer.module.exports.TextBuffer.saveAs (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:913:17)
at TextBuffer.module.exports.TextBuffer.save (C:\Users\Luke\AppData\Local\atom\app-0.190.0\resources\app\node_modules\text-buffer\lib\text-buffer.js:899:19)
</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -4:16.8 core:confirm (atom-text-editor.editor.mini)
-3:49.7 core:backspace (atom-text-editor.editor.is-focused)
-3:47.4 core:save (atom-text-editor.editor.is-focused)
15x -1:48.1 core:backspace (atom-text-editor.editor.is-focused)
-1:09.5 core:copy (atom-text-editor.editor)
-1:06.3 core:paste (atom-text-editor.editor.is-focused)
4x -1:04.0 core:backspace (atom-text-editor.editor.is-focused)
2x -0:15.5 core:paste (atom-text-editor.editor.is-focused)
-0:06.0 core:save (atom-text-editor.editor.is-focused)"><pre class="notranslate"><code class="notranslate"> -4:16.8 core:confirm (atom-text-editor.editor.mini)
-3:49.7 core:backspace (atom-text-editor.editor.is-focused)
-3:47.4 core:save (atom-text-editor.editor.is-focused)
15x -1:48.1 core:backspace (atom-text-editor.editor.is-focused)
-1:09.5 core:copy (atom-text-editor.editor)
-1:06.3 core:paste (atom-text-editor.editor.is-focused)
4x -1:04.0 core:backspace (atom-text-editor.editor.is-focused)
2x -0:15.5 core:paste (atom-text-editor.editor.is-focused)
-0:06.0 core:save (atom-text-editor.editor.is-focused)
</code></pre></div>
<h3 dir="auto">Config</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"core": {
"themes": [
"one-dark-ui",
"one-dark-syntax"
]
},
"editor": {
"fontSize": 16
}
}"><pre class="notranslate">{
<span class="pl-ent">"core"</span>: {
<span class="pl-ent">"themes"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>one-dark-ui<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>one-dark-syntax<span class="pl-pds">"</span></span>
]
},
<span class="pl-ent">"editor"</span>: {
<span class="pl-ent">"fontSize"</span>: <span class="pl-c1">16</span>
}
}</pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
No installed packages
# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
<span class="pl-en">No</span> <span class="pl-en">installed</span> packages
<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div> | 1 |
<p dir="auto">When you execute a subprocess there's no guarantees of what it can do - all security bets are off. <code class="notranslate">--allow-run</code> masks this and is an extra command line flag. Therefore I suggest removing it entirely and requiring users to supply <code class="notranslate">--allow-all</code>.</p> | <p dir="auto">Both of the tests below have the same async function. They should both fail for leaking async ops. The first creates 2 timeouts, but the failure shows there is only 1 more dispatched than completed async ops. When the next test starts, it starts with there being one more dispatched op than completed ops. The setTimeout calls in the second test do not result in any change to the number of dispatched and completed async ops. Because of that, the second test does not fail.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { delay } from "https://deno.land/[email protected]/async/delay.ts";
Deno.test("example 1", async () => {
let metrics = Deno.metrics();
console.log(
`
Before:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
setTimeout(() => {}, 10000);
setTimeout(() => {}, 10001);
metrics = Deno.metrics();
console.log(
`After:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
await delay(0);
});
Deno.test("example 2", async () => {
let metrics = Deno.metrics();
console.log(
`
Before:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
setTimeout(() => {}, 10000);
setTimeout(() => {}, 10001);
metrics = Deno.metrics();
console.log(
`After:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
await delay(0);
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">delay</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"https://deno.land/[email protected]/async/delay.ts"</span><span class="pl-kos">;</span>
<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"example 1"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`</span>
<span class="pl-s">Before:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10001</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`After:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-en">delay</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"example 2"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`</span>
<span class="pl-s">Before:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10001</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`After:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">await</span> <span class="pl-en">delay</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno --version
deno 1.6.0 (release, x86_64-unknown-linux-gnu)
v8 8.8.278.2
typescript 4.1.2
deno test example_test.ts
Check file:///mnt/c/Users/kylej/projects/deno/test_suite/$deno$test.ts
running 2 tests
test example 1 ...
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 1
- completed: 0
FAILED (5ms)
test example 2 ...
Before:
- dispatched: 5
- completed: 4
After:
- dispatched: 5
- completed: 4
ok (3ms)
failures:
example 1
AssertionError: Test case is leaking async ops.
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 5
- completed: 4
Make sure to await all promises returned from Deno APIs before
finishing test case.
at assert (deno:cli/rt/06_util.js:33:13)
at asyncOpSanitizer (deno:cli/rt/40_testing.js:46:7)
at async Object.resourceSanitizer [as fn] (deno:cli/rt/40_testing.js:70:7)
at async TestRunner.[Symbol.asyncIterator] (deno:cli/rt/40_testing.js:245:13)
at async Object.runTests (deno:cli/rt/40_testing.js:322:22)
at async $deno$test.ts:3:1
failures:
example 1
test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out (9ms)"><pre class="notranslate">deno --version
deno 1.6.0 (release, x86_64-unknown-linux-gnu)
v8 8.8.278.2
typescript 4.1.2
deno <span class="pl-c1">test</span> example_test.ts
Check file:///mnt/c/Users/kylej/projects/deno/test_suite/<span class="pl-smi">$deno$test</span>.ts
running 2 tests
<span class="pl-c1">test</span> example 1 ...
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 1
- completed: 0
FAILED (5ms)
<span class="pl-c1">test</span> example 2 ...
Before:
- dispatched: 5
- completed: 4
After:
- dispatched: 5
- completed: 4
ok (3ms)
failures:
example 1
AssertionError: Test <span class="pl-k">case</span> is leaking async ops.
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 5
- completed: 4
Make sure to await all promises returned from Deno APIs before
finishing <span class="pl-c1">test</span> case.
at assert (deno:cli/rt/06_util.js:33:13)
at asyncOpSanitizer (deno:cli/rt/40_testing.js:46:7)
at async Object.resourceSanitizer [as fn] (deno:cli/rt/40_testing.js:70:7)
at async TestRunner.[Symbol.asyncIterator] (deno:cli/rt/40_testing.js:245:13)
at async Object.runTests (deno:cli/rt/40_testing.js:322:22)
at async <span class="pl-smi">$deno$test</span>.ts:3:1
failures:
example 1
<span class="pl-c1">test</span> result: FAILED. 1 passed<span class="pl-k">;</span> 1 failed<span class="pl-k">;</span> 0 ignored<span class="pl-k">;</span> 0 measured<span class="pl-k">;</span> 0 filtered out (9ms)</pre></div>
<p dir="auto">The same issue applies if I make the test function syncronous by removing async key word and the await delay(0) from the end.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Deno.test("example 1", () => {
let metrics = Deno.metrics();
console.log(
`
Before:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
setTimeout(() => {}, 10000);
setTimeout(() => {}, 10001);
metrics = Deno.metrics();
console.log(
`After:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
});
Deno.test("example 2", () => {
let metrics = Deno.metrics();
console.log(
`
Before:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
setTimeout(() => {}, 10000);
setTimeout(() => {}, 10001);
metrics = Deno.metrics();
console.log(
`After:
- dispatched: ${metrics.opsDispatchedAsync}
- completed: ${metrics.opsCompletedAsync}`,
);
});"><pre class="notranslate"><span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"example 1"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`</span>
<span class="pl-s">Before:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10001</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`After:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"example 2"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> <span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`</span>
<span class="pl-s">Before:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">setTimeout</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-c1">10001</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">metrics</span> <span class="pl-c1">=</span> <span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-en">metrics</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span>
<span class="pl-s">`After:</span>
<span class="pl-s">- dispatched: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsDispatchedAsync</span><span class="pl-kos">}</span></span></span>
<span class="pl-s">- completed: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">metrics</span><span class="pl-kos">.</span><span class="pl-c1">opsCompletedAsync</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span>
<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="deno test example_test.ts
Check file:///mnt/c/Users/kylej/projects/deno/test_suite/$deno$test.ts
running 2 tests
test example 1 ...
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 1
- completed: 0
FAILED (3ms)
test example 2 ...
Before:
- dispatched: 3
- completed: 2
After:
- dispatched: 3
- completed: 2
ok (2ms)
failures:
example 1
AssertionError: Test case is leaking async ops.
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 3
- completed: 2
Make sure to await all promises returned from Deno APIs before
finishing test case.
at assert (deno:cli/rt/06_util.js:33:13)
at asyncOpSanitizer (deno:cli/rt/40_testing.js:46:7)
at async Object.resourceSanitizer [as fn] (deno:cli/rt/40_testing.js:70:7)
at async TestRunner.[Symbol.asyncIterator] (deno:cli/rt/40_testing.js:245:13)
at async Object.runTests (deno:cli/rt/40_testing.js:322:22)
at async $deno$test.ts:3:1
failures:
example 1
test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out (5ms)"><pre class="notranslate">deno <span class="pl-c1">test</span> example_test.ts
Check file:///mnt/c/Users/kylej/projects/deno/test_suite/<span class="pl-smi">$deno$test</span>.ts
running 2 tests
<span class="pl-c1">test</span> example 1 ...
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 1
- completed: 0
FAILED (3ms)
<span class="pl-c1">test</span> example 2 ...
Before:
- dispatched: 3
- completed: 2
After:
- dispatched: 3
- completed: 2
ok (2ms)
failures:
example 1
AssertionError: Test <span class="pl-k">case</span> is leaking async ops.
Before:
- dispatched: 0
- completed: 0
After:
- dispatched: 3
- completed: 2
Make sure to await all promises returned from Deno APIs before
finishing <span class="pl-c1">test</span> case.
at assert (deno:cli/rt/06_util.js:33:13)
at asyncOpSanitizer (deno:cli/rt/40_testing.js:46:7)
at async Object.resourceSanitizer [as fn] (deno:cli/rt/40_testing.js:70:7)
at async TestRunner.[Symbol.asyncIterator] (deno:cli/rt/40_testing.js:245:13)
at async Object.runTests (deno:cli/rt/40_testing.js:322:22)
at async <span class="pl-smi">$deno$test</span>.ts:3:1
failures:
example 1
<span class="pl-c1">test</span> result: FAILED. 1 passed<span class="pl-k">;</span> 1 failed<span class="pl-k">;</span> 0 ignored<span class="pl-k">;</span> 0 measured<span class="pl-k">;</span> 0 filtered out (5ms)</pre></div> | 0 |
<p dir="auto">I'm trying to use Next.js to render part of my app, but I keep getting</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ReferenceError: document is not defined
at Object.<anonymous> (/Users/patricklu/Q5/lunyr/Lunyr-Frontend/node_modules/domkit/builtinStyle.js:3:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/patricklu/Q5/lunyr/Lunyr-Frontend/node_modules/domkit/getVendorPropertyName.js:3:20)
at Module._compile (module.js:569:30)"><pre class="notranslate"><code class="notranslate">ReferenceError: document is not defined
at Object.<anonymous> (/Users/patricklu/Q5/lunyr/Lunyr-Frontend/node_modules/domkit/builtinStyle.js:3:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/patricklu/Q5/lunyr/Lunyr-Frontend/node_modules/domkit/getVendorPropertyName.js:3:20)
at Module._compile (module.js:569:30)
</code></pre></div>
<p dir="auto">There's no instance in my app where I reference domkit, but somehow it keeps showing up. I only have one page in my app, and I've gone so far as to change my render method to this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="render() {
return (
<div>
</div>
);
}
}"><pre class="notranslate"><code class="notranslate">render() {
return (
<div>
</div>
);
}
}
</code></pre></div>
<p dir="auto">But it's still not rendering properly.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Renders fine.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Render error</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>5</td>
</tr>
<tr>
<td>node</td>
<td>8.1.2</td>
</tr>
<tr>
<td>OS</td>
<td>macOs</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | <p dir="auto">Hi there, I'm trying to find a way to know if i'm coming through browser history.<br>
The page gets its initial data through custom routing, eventually fetching it on its own if the<br>
variable is empty.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
class Index extends Component {
static async getInitialProps ({ query, store }) {
const loc = store.getState().localization
let pageData = query.initialData
if (!pageData) {
const Fetch = new ApiGetHome(`${loc.region}/${loc.language}`)
const res = await Fetch.getData()
pageData = res.response[0]
}
// destructuring response data
const { title, slider, main, footer } = pageData
[...]"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Index</span> <span class="pl-k">extends</span> <span class="pl-v">Component</span> <span class="pl-kos">{</span>
<span class="pl-k">static</span> <span class="pl-k">async</span> <span class="pl-c1">getInitialProps</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> query<span class="pl-kos">,</span> store <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">loc</span> <span class="pl-c1">=</span> <span class="pl-s1">store</span><span class="pl-kos">.</span><span class="pl-en">getState</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">localization</span>
<span class="pl-k">let</span> <span class="pl-s1">pageData</span> <span class="pl-c1">=</span> <span class="pl-s1">query</span><span class="pl-kos">.</span><span class="pl-c1">initialData</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">pageData</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-v">Fetch</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ApiGetHome</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">loc</span><span class="pl-kos">.</span><span class="pl-c1">region</span><span class="pl-kos">}</span></span>/<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">loc</span><span class="pl-kos">.</span><span class="pl-c1">language</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-s1">res</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-v">Fetch</span><span class="pl-kos">.</span><span class="pl-en">getData</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-s1">pageData</span> <span class="pl-c1">=</span> <span class="pl-s1">res</span><span class="pl-kos">.</span><span class="pl-c1">response</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span>
<span class="pl-c">// destructuring response data</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> title<span class="pl-kos">,</span> slider<span class="pl-kos">,</span> main<span class="pl-kos">,</span> footer <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">pageData</span>
<span class="pl-kos">[</span>...<span class="pl-kos">]</span></pre></div>
<p dir="auto">Navigating to an Internal URL, and then coming back from browser history, I think that getting a variable like <code class="notranslate">isFromHistory</code> or something similiar could be useful to prevent a new data fetch.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul> | 0 |
<p dir="auto">If you do <code class="notranslate">write!(w, ..)</code> instead of <code class="notranslate">write!(&mut w, ..)</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="task 'rustc' panicked at 'index out of bounds: the len is 6 but the index is 6', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/lib.rs:1
stack backtrace:
1: 0x7fabba9c69c0 - rt::backtrace::imp::write::h7fe8534f465d0e09y9s
2: 0x7fabba9c9b60 - failure::on_fail::h3fe2ecde6aab0bb8rwt
3: 0x7fabbb18fc80 - unwind::begin_unwind_inner::he6bc2073d4eb582enbd
4: 0x7fabbb18f900 - unwind::begin_unwind_fmt::h305b4b28825355b2y8c
5: 0x7fabbb18f8c0 - rust_begin_unwind
6: 0x7fabbb1d5a70 - panicking::panic_fmt::h9d03fcf6b4c3f8e10Nl
7: 0x7fabbb1dae60 - panicking::panic_bounds_check::h5c6357fea6530f04yMl
8: 0x7fabb883a130 - codemap::FileMap::get_line::h8bd7cfe56e6cfd5e1aF
9: 0x7fabb88689b0 - diagnostic::emit::h2322127ddc0c36debCG
10: 0x7fabb88653d0 - diagnostic::EmitterWriter.Emitter::emit::hb9a4d5c26c04e1df0xG
11: 0x7fabb8863c50 - diagnostic::Handler::emit::ha390aea82acc4940kfG
12: 0x7fabb8836910 - diagnostic::SpanHandler::span_err::h83b27707d23c7bfej3F
13: 0x7fabb9c34720 - middle::typeck::infer::InferCtxt<'a, 'tcx>::type_error_message_str_with_expected::h72941615d6be270289E
14: 0x7fabb9b40840 - middle::typeck::infer::InferCtxt<'a, 'tcx>::type_error_message::h3e78576a7aeba36csfF
15: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
16: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
17: 0x7fabb9bbec40 - middle::typeck::check::check_decl_local::h24893462a5fe4409xSn
18: 0x7fabb9bbee00 - middle::typeck::check::check_stmt::h1ca15bfe8a7d5a87xUn
19: 0x7fabb9af8d90 - middle::typeck::check::check_block_with_expected::heebc1a2b04a42760MYn
20: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
21: 0x7fabb9a75100 - middle::typeck::check::_match::check_match::h2c871678897b201eeA8
22: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
23: 0x7fabb9af8d90 - middle::typeck::check::check_block_with_expected::heebc1a2b04a42760MYn
24: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
25: 0x7fabb9bbee00 - middle::typeck::check::check_stmt::h1ca15bfe8a7d5a87xUn
26: 0x7fabb9af8d90 - middle::typeck::check::check_block_with_expected::heebc1a2b04a42760MYn
27: 0x7fabb9af4810 - middle::typeck::check::check_fn::hd39b1b6b62f22c3fici
28: 0x7fabb9af4530 - middle::typeck::check::check_bare_fn::h779ff7b2db70ca5bn1h
29: 0x7fabb9afbda0 - middle::typeck::check::check_method_body::h6418d5a11969c3d7nwi
30: 0x7fabb9af0310 - middle::typeck::check::check_item::hde22067b8b575546vli
31: 0x7fabb9af3e60 - visit::walk_mod::h974639367282189498
32: 0x7fabb9af3e60 - visit::walk_mod::h974639367282189498
33: 0x7fabb9af41c0 - middle::typeck::check::check_item_types::h7118271db2ab8ea8x0h
34: 0x7fabb9ee0e10 - util::common::time::h4997555828079517418
35: 0x7fabb9ee0020 - middle::typeck::check_crate::h0949dffd97487b5ejVL
36: 0x7fabbb693a10 - driver::driver::phase_3_run_analysis_passes::h7f3610cf195b4c3abfS
37: 0x7fabbb688830 - driver::driver::compile_input::h13734d451479d6e7VVR
38: 0x7fabbb70d7b0 - driver::run_compiler::h0a1cb9376c105f68pUT
39: 0x7fabbb70d6a0 - driver::run::closure.59745
40: 0x7fabbb519ee0 - task::TaskBuilder<S>::try_future::closure.39051
41: 0x7fabbb519cd0 - task::TaskBuilder<S>::spawn_internal::closure.39022
42: 0x7fabbba2db90 - task::NativeSpawner.Spawner::spawn::closure.2472
43: 0x7fabbb1e84c0 - rust_try_inner
44: 0x7fabbb1e84b0 - rust_try
45: 0x7fabbb18d5e0 - unwind::try::h7c27f4e149aed3f2IZc
46: 0x7fabbb18d470 - task::Task::run::h75863ac7ddab20c0y5b
47: 0x7fabbba2d8d0 - task::NativeSpawner.Spawner::spawn::closure.2398
48: 0x7fabbb18ec90 - thread::thread_start::h7822af80b22f729bEqc
49: 0x7fabb5a4e0c0 - start_thread
50: 0x7fabbae54f89 - __clone
51: 0x0 - <unknown>
"><pre class="notranslate"><code class="notranslate">task 'rustc' panicked at 'index out of bounds: the len is 6 but the index is 6', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/lib.rs:1
stack backtrace:
1: 0x7fabba9c69c0 - rt::backtrace::imp::write::h7fe8534f465d0e09y9s
2: 0x7fabba9c9b60 - failure::on_fail::h3fe2ecde6aab0bb8rwt
3: 0x7fabbb18fc80 - unwind::begin_unwind_inner::he6bc2073d4eb582enbd
4: 0x7fabbb18f900 - unwind::begin_unwind_fmt::h305b4b28825355b2y8c
5: 0x7fabbb18f8c0 - rust_begin_unwind
6: 0x7fabbb1d5a70 - panicking::panic_fmt::h9d03fcf6b4c3f8e10Nl
7: 0x7fabbb1dae60 - panicking::panic_bounds_check::h5c6357fea6530f04yMl
8: 0x7fabb883a130 - codemap::FileMap::get_line::h8bd7cfe56e6cfd5e1aF
9: 0x7fabb88689b0 - diagnostic::emit::h2322127ddc0c36debCG
10: 0x7fabb88653d0 - diagnostic::EmitterWriter.Emitter::emit::hb9a4d5c26c04e1df0xG
11: 0x7fabb8863c50 - diagnostic::Handler::emit::ha390aea82acc4940kfG
12: 0x7fabb8836910 - diagnostic::SpanHandler::span_err::h83b27707d23c7bfej3F
13: 0x7fabb9c34720 - middle::typeck::infer::InferCtxt<'a, 'tcx>::type_error_message_str_with_expected::h72941615d6be270289E
14: 0x7fabb9b40840 - middle::typeck::infer::InferCtxt<'a, 'tcx>::type_error_message::h3e78576a7aeba36csfF
15: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
16: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
17: 0x7fabb9bbec40 - middle::typeck::check::check_decl_local::h24893462a5fe4409xSn
18: 0x7fabb9bbee00 - middle::typeck::check::check_stmt::h1ca15bfe8a7d5a87xUn
19: 0x7fabb9af8d90 - middle::typeck::check::check_block_with_expected::heebc1a2b04a42760MYn
20: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
21: 0x7fabb9a75100 - middle::typeck::check::_match::check_match::h2c871678897b201eeA8
22: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
23: 0x7fabb9af8d90 - middle::typeck::check::check_block_with_expected::heebc1a2b04a42760MYn
24: 0x7fabb9b49f70 - middle::typeck::check::check_expr_with_unifier::h23742768f253d831DLl
25: 0x7fabb9bbee00 - middle::typeck::check::check_stmt::h1ca15bfe8a7d5a87xUn
26: 0x7fabb9af8d90 - middle::typeck::check::check_block_with_expected::heebc1a2b04a42760MYn
27: 0x7fabb9af4810 - middle::typeck::check::check_fn::hd39b1b6b62f22c3fici
28: 0x7fabb9af4530 - middle::typeck::check::check_bare_fn::h779ff7b2db70ca5bn1h
29: 0x7fabb9afbda0 - middle::typeck::check::check_method_body::h6418d5a11969c3d7nwi
30: 0x7fabb9af0310 - middle::typeck::check::check_item::hde22067b8b575546vli
31: 0x7fabb9af3e60 - visit::walk_mod::h974639367282189498
32: 0x7fabb9af3e60 - visit::walk_mod::h974639367282189498
33: 0x7fabb9af41c0 - middle::typeck::check::check_item_types::h7118271db2ab8ea8x0h
34: 0x7fabb9ee0e10 - util::common::time::h4997555828079517418
35: 0x7fabb9ee0020 - middle::typeck::check_crate::h0949dffd97487b5ejVL
36: 0x7fabbb693a10 - driver::driver::phase_3_run_analysis_passes::h7f3610cf195b4c3abfS
37: 0x7fabbb688830 - driver::driver::compile_input::h13734d451479d6e7VVR
38: 0x7fabbb70d7b0 - driver::run_compiler::h0a1cb9376c105f68pUT
39: 0x7fabbb70d6a0 - driver::run::closure.59745
40: 0x7fabbb519ee0 - task::TaskBuilder<S>::try_future::closure.39051
41: 0x7fabbb519cd0 - task::TaskBuilder<S>::spawn_internal::closure.39022
42: 0x7fabbba2db90 - task::NativeSpawner.Spawner::spawn::closure.2472
43: 0x7fabbb1e84c0 - rust_try_inner
44: 0x7fabbb1e84b0 - rust_try
45: 0x7fabbb18d5e0 - unwind::try::h7c27f4e149aed3f2IZc
46: 0x7fabbb18d470 - task::Task::run::h75863ac7ddab20c0y5b
47: 0x7fabbba2d8d0 - task::NativeSpawner.Spawner::spawn::closure.2398
48: 0x7fabbb18ec90 - thread::thread_start::h7822af80b22f729bEqc
49: 0x7fabb5a4e0c0 - start_thread
50: 0x7fabbae54f89 - __clone
51: 0x0 - <unknown>
</code></pre></div> | <h2 dir="auto"><em>Believed</em> current test case</h2>
<p dir="auto">(pnkfelix says: "if you are looking at this bug, please try to keep this test up-to-date ... potentially by checking the newest linked dupes in the comment feed below.")</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Very
// sensitive
pub struct BytePos(pub u32);
// to particular
// line numberings / offsets
fn main() {
let x = BytePos(1);
assert!(x, x);
}"><pre class="notranslate"><span class="pl-c">// Very</span>
<span class="pl-c">// sensitive</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">BytePos</span><span class="pl-kos">(</span><span class="pl-k">pub</span> <span class="pl-smi">u32</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">// to particular</span>
<span class="pl-c">// line numberings / offsets</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> x = <span class="pl-v">BytePos</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>x, x<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h2 dir="auto">Original Bug Filed</h2>
<p dir="auto">Script to reproduce:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="fn main() {
// if any comment line is removed, the ICE disappears
// adding more lines keep the ICE alive
//
//
//
//
//
//
//
//
//
assert!(vec!(1.0), vec!(1.0))
}"><pre class="notranslate"><span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-c">// if any comment line is removed, the ICE disappears</span>
<span class="pl-c">// adding more lines keep the ICE alive</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-c">//</span>
<span class="pl-en">assert</span><span class="pl-en">!</span><span class="pl-kos">(</span>vec!<span class="pl-kos">(</span><span class="pl-c1">1.0</span><span class="pl-kos">)</span>, vec!<span class="pl-kos">(</span><span class="pl-c1">1.0</span><span class="pl-kos">)</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ RUST_BACKTRACE=1 rustc ice.rs
<std macros>:8:12: 13:23 error: cannot apply unary operator `!` to type `std::vec::Vec<<generic float #0>>`
<std macros>:8 if !$cond {
<std macros>:9 fail!($($arg),+)
<std macros>:10 }
<std macros>:11 );
<std macros>:12 )
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 12 but the index is 12', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/lib.rs:1
stack backtrace:
1: 0x7f0c3dda8180 - rt::backtrace::imp::write::h706b65acfe967902xTF::v0.11.pre
2: 0x7f0c3dd11730 - rt::unwind::begin_unwind_inner::hcc57db58853efcfdAtF::v0.11.pre
3: 0x7f0c3dda7e10 - <unknown>
4: 0x7f0c3dda7d30 - rust_fail_bounds_check
5: 0x7f0c3ddb9a90 - failure::fail_bounds_check::h8ed58f060b870dd6EwF::v0.11.pre
6: 0x7f0c3d1d80f0 - codemap::FileMap::get_line::hbf104ad3bfda6f77Drd::v0.11.pre
7: 0x7f0c3d1d4e90 - <unknown>
8: 0x7f0c3d1ccd40 - diagnostic::EmitterWriter.Emitter::emit::h7c42f3840a82760aQcc::v0.11.pre
9: 0x7f0c3d1c9f90 - diagnostic::Handler::emit::h971cc5635478154dV0b::v0.11.pre
10: 0x7f0c3d1c8ec0 - diagnostic::SpanHandler::span_err::h3735f152282993cc3Sb::v0.11.pre
11: 0x7f0c3eadda90 - middle::typeck::infer::InferCtxt<'a>::type_error_message_str_with_expected::he1b302cd7901cc2apJq::v0.11.pre
12: 0x7f0c3eb7f0e0 - middle::typeck::infer::InferCtxt<'a>::type_error_message::h6e536a01d806a7af7Qq::v0.11.pre
13: 0x7f0c3eb8d9f0 - <unknown>
14: 0x7f0c3eb8b250 - <unknown>
15: 0x7f0c3eb8d650 - <unknown>
16: 0x7f0c3eb7fb20 - <unknown>
17: 0x7f0c3eb7fb20 - <unknown>
18: 0x7f0c3eb5fd00 - middle::typeck::check::check_block_with_expected::hec61a0d86b711c5ck7c::v0.11.pre
19: 0x7f0c3eb5af90 - <unknown>
20: 0x7f0c3eb5ad30 - <unknown>
21: 0x7f0c3eb53790 - middle::typeck::check::check_item::he7c19452bac809220R8::v0.11.pre
22: 0x7f0c3eb5ab30 - middle::typeck::check::check_item_types::hca38e25e2d3c1969ek8::v0.11.pre
23: 0x7f0c3ec9d280 - <unknown>
24: 0x7f0c3ec9c090 - middle::typeck::check_crate::h540b9b663571145fQgw::v0.11.pre
25: 0x7f0c3f0e8e90 - driver::driver::phase_3_run_analysis_passes::h129732fc31300f8bbei::v0.11.pre
26: 0x7f0c3f0eef10 - driver::driver::compile_input::h36b4d97be6c65511gEi::v0.11.pre
27: 0x7f0c3f1143c0 - run_compiler::hd111892d49d8dfe1saq::v0.11.pre
28: 0x7f0c3f12ffb0 - <unknown>
29: 0x7f0c3f12e860 - <unknown>
30: 0x7f0c3f129020 - <unknown>
31: 0x7f0c3e2ce670 - <unknown>
32: 0x7f0c3dd9f430 - <unknown>
33: 0x7f0c3ddc04a0 - rust_try
34: 0x7f0c3dd9f270 - rt::task::Task::run::hd2e6ec18f16de5eeiiD::v0.11.pre
35: 0x7f0c3e2ce440 - <unknown>
36: 0x7f0c3dda6c60 - <unknown>
37: 0x7f0c3ba9c000 - start_thread
38: 0x7f0c3d9e43d9 - clone
39: 0x0 - <unknown>"><pre class="notranslate"><code class="notranslate">$ RUST_BACKTRACE=1 rustc ice.rs
<std macros>:8:12: 13:23 error: cannot apply unary operator `!` to type `std::vec::Vec<<generic float #0>>`
<std macros>:8 if !$cond {
<std macros>:9 fail!($($arg),+)
<std macros>:10 }
<std macros>:11 );
<std macros>:12 )
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index out of bounds: the len is 12 but the index is 12', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/lib.rs:1
stack backtrace:
1: 0x7f0c3dda8180 - rt::backtrace::imp::write::h706b65acfe967902xTF::v0.11.pre
2: 0x7f0c3dd11730 - rt::unwind::begin_unwind_inner::hcc57db58853efcfdAtF::v0.11.pre
3: 0x7f0c3dda7e10 - <unknown>
4: 0x7f0c3dda7d30 - rust_fail_bounds_check
5: 0x7f0c3ddb9a90 - failure::fail_bounds_check::h8ed58f060b870dd6EwF::v0.11.pre
6: 0x7f0c3d1d80f0 - codemap::FileMap::get_line::hbf104ad3bfda6f77Drd::v0.11.pre
7: 0x7f0c3d1d4e90 - <unknown>
8: 0x7f0c3d1ccd40 - diagnostic::EmitterWriter.Emitter::emit::h7c42f3840a82760aQcc::v0.11.pre
9: 0x7f0c3d1c9f90 - diagnostic::Handler::emit::h971cc5635478154dV0b::v0.11.pre
10: 0x7f0c3d1c8ec0 - diagnostic::SpanHandler::span_err::h3735f152282993cc3Sb::v0.11.pre
11: 0x7f0c3eadda90 - middle::typeck::infer::InferCtxt<'a>::type_error_message_str_with_expected::he1b302cd7901cc2apJq::v0.11.pre
12: 0x7f0c3eb7f0e0 - middle::typeck::infer::InferCtxt<'a>::type_error_message::h6e536a01d806a7af7Qq::v0.11.pre
13: 0x7f0c3eb8d9f0 - <unknown>
14: 0x7f0c3eb8b250 - <unknown>
15: 0x7f0c3eb8d650 - <unknown>
16: 0x7f0c3eb7fb20 - <unknown>
17: 0x7f0c3eb7fb20 - <unknown>
18: 0x7f0c3eb5fd00 - middle::typeck::check::check_block_with_expected::hec61a0d86b711c5ck7c::v0.11.pre
19: 0x7f0c3eb5af90 - <unknown>
20: 0x7f0c3eb5ad30 - <unknown>
21: 0x7f0c3eb53790 - middle::typeck::check::check_item::he7c19452bac809220R8::v0.11.pre
22: 0x7f0c3eb5ab30 - middle::typeck::check::check_item_types::hca38e25e2d3c1969ek8::v0.11.pre
23: 0x7f0c3ec9d280 - <unknown>
24: 0x7f0c3ec9c090 - middle::typeck::check_crate::h540b9b663571145fQgw::v0.11.pre
25: 0x7f0c3f0e8e90 - driver::driver::phase_3_run_analysis_passes::h129732fc31300f8bbei::v0.11.pre
26: 0x7f0c3f0eef10 - driver::driver::compile_input::h36b4d97be6c65511gEi::v0.11.pre
27: 0x7f0c3f1143c0 - run_compiler::hd111892d49d8dfe1saq::v0.11.pre
28: 0x7f0c3f12ffb0 - <unknown>
29: 0x7f0c3f12e860 - <unknown>
30: 0x7f0c3f129020 - <unknown>
31: 0x7f0c3e2ce670 - <unknown>
32: 0x7f0c3dd9f430 - <unknown>
33: 0x7f0c3ddc04a0 - rust_try
34: 0x7f0c3dd9f270 - rt::task::Task::run::hd2e6ec18f16de5eeiiD::v0.11.pre
35: 0x7f0c3e2ce440 - <unknown>
36: 0x7f0c3dda6c60 - <unknown>
37: 0x7f0c3ba9c000 - start_thread
38: 0x7f0c3d9e43d9 - clone
39: 0x0 - <unknown>
</code></pre></div>
<p dir="auto">Version:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ rustc --version
rustc 0.11-pre (1001635 2014-05-10 09:56:34 -0700)
host: x86_64-unknown-linux-gnu"><pre class="notranslate"><code class="notranslate">$ rustc --version
rustc 0.11-pre (1001635 2014-05-10 09:56:34 -0700)
host: x86_64-unknown-linux-gnu
</code></pre></div> | 1 |
<p dir="auto">A playbook used for testing:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: all
remote_user: root
tasks:
- debug: msg="First task"
- debug: msg="Second task""><pre class="notranslate"><code class="notranslate">
---
- hosts: all
remote_user: root
tasks:
- debug: msg="First task"
- debug: msg="Second task"
</code></pre></div>
<p dir="auto">When run with command <code class="notranslate">ansible-playbook -i inventory -l hostname -k debug.yml</code>, Ansible connects to host as 'root' account, gathers facts, and for subsequent tasks connects to remote host using username from local system which is used to run <code class="notranslate">ansible-playbook</code> (in my case, 'drybjed'). Example output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="drybjed ansible-aiua/ $ ansible-playbook -i inventory -k debug.yml -l philote.aiua -vvv
SSH password:
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1382344700.02-43467222883968 && echo $HOME/.ansible/tmp/ansible-1382344700.02-43467222883968'"]
<philote.aiua> REMOTE_MODULE setup
<philote.aiua> PUT /tmp/tmpxTVWFf TO /root/.ansible/tmp/ansible-1382344700.02-43467222883968/setup
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-1382344700.02-43467222883968/setup; rm -rf /root/.ansible/tmp/ansible-1382344700.02-43467222883968/ >/dev/null 2>&1'"]
ok: [philote.aiua]
TASK: [debug msg="First task"] ************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: drybjed
ok: [philote.aiua] => {
"msg": "First task"
}
TASK: [debug msg="Second task"] ***********************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: drybjed
ok: [philote.aiua] => {
"msg": "Second task"
}
PLAY RECAP ********************************************************************
philote.aiua : ok=3 changed=0 unreachable=0 failed=0 "><pre class="notranslate"><code class="notranslate">drybjed ansible-aiua/ $ ansible-playbook -i inventory -k debug.yml -l philote.aiua -vvv
SSH password:
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1382344700.02-43467222883968 && echo $HOME/.ansible/tmp/ansible-1382344700.02-43467222883968'"]
<philote.aiua> REMOTE_MODULE setup
<philote.aiua> PUT /tmp/tmpxTVWFf TO /root/.ansible/tmp/ansible-1382344700.02-43467222883968/setup
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-1382344700.02-43467222883968/setup; rm -rf /root/.ansible/tmp/ansible-1382344700.02-43467222883968/ >/dev/null 2>&1'"]
ok: [philote.aiua]
TASK: [debug msg="First task"] ************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: drybjed
ok: [philote.aiua] => {
"msg": "First task"
}
TASK: [debug msg="Second task"] ***********************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: drybjed
ok: [philote.aiua] => {
"msg": "Second task"
}
PLAY RECAP ********************************************************************
philote.aiua : ok=3 changed=0 unreachable=0 failed=0
</code></pre></div>
<p dir="auto">When the same playbook is run with command <code class="notranslate">ansible-playbook -i inventory -k -u root -l hostname debug.yml</code>, playbook behaves as expected</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="drybjed ansible-aiua/ $ ansible-playbook -i inventory -k -u root debug.yml -l philote.aiua -vvv
SSH password:
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1382344783.69-47258613050074 && echo $HOME/.ansible/tmp/ansible-1382344783.69-47258613050074'"]
<philote.aiua> REMOTE_MODULE setup
<philote.aiua> PUT /tmp/tmpbDXxl2 TO /root/.ansible/tmp/ansible-1382344783.69-47258613050074/setup
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-1382344783.69-47258613050074/setup; rm -rf /root/.ansible/tmp/ansible-1382344783.69-47258613050074/ >/dev/null 2>&1'"]
ok: [philote.aiua]
TASK: [debug msg="First task"] ************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
ok: [philote.aiua] => {
"msg": "First task"
}
TASK: [debug msg="Second task"] ***********************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
ok: [philote.aiua] => {
"msg": "Second task"
}
PLAY RECAP ********************************************************************
philote.aiua : ok=3 changed=0 unreachable=0 failed=0 "><pre class="notranslate"><code class="notranslate">drybjed ansible-aiua/ $ ansible-playbook -i inventory -k -u root debug.yml -l philote.aiua -vvv
SSH password:
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1382344783.69-47258613050074 && echo $HOME/.ansible/tmp/ansible-1382344783.69-47258613050074'"]
<philote.aiua> REMOTE_MODULE setup
<philote.aiua> PUT /tmp/tmpbDXxl2 TO /root/.ansible/tmp/ansible-1382344783.69-47258613050074/setup
<philote.aiua> EXEC ['sshpass', '-d4', 'ssh', '-tt', '-q', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/drybjed/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'Port=22', '-o', 'GSSAPIAuthentication=no', '-o', 'PubkeyAuthentication=no', '-o', 'User=root', '-o', 'ConnectTimeout=10', 'philote.aiua', "/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-1382344783.69-47258613050074/setup; rm -rf /root/.ansible/tmp/ansible-1382344783.69-47258613050074/ >/dev/null 2>&1'"]
ok: [philote.aiua]
TASK: [debug msg="First task"] ************************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
ok: [philote.aiua] => {
"msg": "First task"
}
TASK: [debug msg="Second task"] ***********************************************
<philote.aiua> ESTABLISH CONNECTION FOR USER: root
ok: [philote.aiua] => {
"msg": "Second task"
}
PLAY RECAP ********************************************************************
philote.aiua : ok=3 changed=0 unreachable=0 failed=0
</code></pre></div>
<ul dir="auto">
<li>I'm using current ansible devel from git repository, created using <code class="notranslate">make deb</code></li>
<li>I don't have <code class="notranslate">remote_user</code> variable set in <code class="notranslate">ansible.cfg</code> or inventory.</li>
</ul> | <p dir="auto">Trivial playbook:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: somelist
user: root
tasks:
- name: test echo
command: echo {{ item }}
with_items:
- foo
- bar"><pre class="notranslate"><code class="notranslate">
---
- hosts: somelist
user: root
tasks:
- name: test echo
command: echo {{ item }}
with_items:
- foo
- bar
</code></pre></div>
<p dir="auto">with 1.3.3 both implicit <code class="notranslate">setup</code> and <code class="notranslate">command</code> tasks are run as <em>root</em>. With devel (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/afa781d628e8ee46da4d2c36cd70ed9366906e92/hovercard" href="https://github.com/ansible/ansible/commit/afa781d628e8ee46da4d2c36cd70ed9366906e92"><tt>afa781d</tt></a> at this moment) the implicit <code class="notranslate">setup</code> task is run as <em>root</em> and the <code class="notranslate">command</code> task is run as the current user.</p> | 1 |
<h2 dir="auto">Steps to Reproduce</h2>
<ol dir="auto">
<li>Create a <code class="notranslate">TextField</code> with <code class="notranslate">onSubmitted</code> function</li>
<li>Run app in Android simulator</li>
<li>Press enter on keyboard</li>
<li><code class="notranslate">onSubmitted</code> is not called</li>
</ol>
<h2 dir="auto">Logs</h2>
<p dir="auto">Whenever you press Enter these come up in the error log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="W/IInputConnectionWrapper( 8999): getCursorCapsMode on inactive InputConnection
W/IInputConnectionWrapper( 8999): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 8999): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 8999): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 8999): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper( 8999): endBatchEdit on inactive InputConnection"><pre class="notranslate"><code class="notranslate">W/IInputConnectionWrapper( 8999): getCursorCapsMode on inactive InputConnection
W/IInputConnectionWrapper( 8999): beginBatchEdit on inactive InputConnection
W/IInputConnectionWrapper( 8999): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 8999): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 8999): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper( 8999): endBatchEdit on inactive InputConnection
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[✓] Flutter (Channel master, v0.5.6-pre.121, on Mac OS X 10.13.5, locale en-US)
• Flutter version 0.5.6-pre.121 at /Users/droider/flutter
• Framework revision a4faa2e067 (85 minutes ago), 2018-07-02 16:35:43 -0700
• Engine revision 6fe748490d
• Dart version 2.0.0-dev.63.0.flutter-4c9689c1d2
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/droider/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.2
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Connected devices (1 available)
• Android SDK built for x86 • emulator-5556 • android-x86 • Android P (API 27) (emulator)"><pre class="notranslate"><code class="notranslate">[✓] Flutter (Channel master, v0.5.6-pre.121, on Mac OS X 10.13.5, locale en-US)
• Flutter version 0.5.6-pre.121 at /Users/droider/flutter
• Framework revision a4faa2e067 (85 minutes ago), 2018-07-02 16:35:43 -0700
• Engine revision 6fe748490d
• Dart version 2.0.0-dev.63.0.flutter-4c9689c1d2
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/droider/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.4.1, Build version 9F2000
• ios-deploy 1.9.2
• CocoaPods version 1.5.2
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] Connected devices (1 available)
• Android SDK built for x86 • emulator-5556 • android-x86 • Android P (API 27) (emulator)
</code></pre></div> | <p dir="auto">Enter key blurs the field, which is unexpected. It essentially maps to the "done" key on the android keyboard which hides the keyboard, but that seems wrong when using a physical keyboard. We should seek UX guidance on what the right behavior is here.</p> | 1 |
<p dir="auto">Hi,</p>
<p dir="auto">My masters thesis is on making neural nets use less memory. One technique I am looking at is memory checkpointing. I can solve for the optimal policy (including multiple recomputations), given the memory budget and per-operator compute/memory costs.</p>
<p dir="auto">I am attempting to implement memory checkpointing as done in <code class="notranslate">torch.utils.checkpoint</code>, except allowing for multiple recomputations. However, there a couple things from the implementation that I'm not quite sure I understand. Apologies if anything is obvious, I have been using PyTorch for <2 days.</p>
<ol dir="auto">
<li>
<p dir="auto"><strong>Why detach the inputs in the backward before recomputing the forward?</strong> Would you get something like the gradient of the forward being accumulated twice into the input's gradient? Also, does this detaching not duplicate the input resulting in higher than necessary memory cost?</p>
</li>
<li>
<p dir="auto">I was trying to implement multiple recomputations by trivially building on the existing checkpoint function, for example by creating a module that performs <code class="notranslate">1 -> drop(2) -> 3</code>, where the module <code class="notranslate">2</code> itself performs <code class="notranslate">2a -> drop(2b)</code>. <code class="notranslate">drop</code> is like a higher-order model whose forward simply performs <code class="notranslate">checkpoint(child_model, x)</code>. Thus, running <code class="notranslate">2</code> should drop <code class="notranslate">2a</code> and <code class="notranslate">2b</code> in the forward pass; and in the backward pass, recompute <code class="notranslate">2a</code>, recompute <code class="notranslate">2b</code> and drop it, then recompute <code class="notranslate">2b</code> a second time, this time actually saving it. Obviously, that's not so smart but its a simple example.</p>
<p dir="auto">I believe the following chain of events will occur in practice:</p>
<ol dir="auto">
<li>
<p dir="auto"><code class="notranslate">1</code>'s forward is performed, whose output is propagated to <code class="notranslate">drop(2)</code>'s forward function.</p>
</li>
<li>
<p dir="auto"><code class="notranslate">drop(2)</code>'s forward invokes <code class="notranslate">CheckpointFunction</code>'s forward, which saves (checkpoints) the input, and performs <code class="notranslate">2</code>'s forward without tracking gradient. The intent is that both the outputs of <code class="notranslate">2a</code> and <code class="notranslate">2b</code> will be dropped at this stage.</p>
</li>
<li>
<p dir="auto"><code class="notranslate">2a</code> performs its forward and the output is passed to <code class="notranslate">drop(2b)</code>'s forward.</p>
</li>
<li>
<p dir="auto">a. If I set up this 'drop' wrapper to not detach its input before passing to the child model, the <code class="notranslate">CheckpointFunction</code> forward will throw an error about none of the inputs have <code class="notranslate">requires_grad=True</code>.</p>
<p dir="auto">b. If I do detach the input, I <em>suspect</em> this will not work either: <strong>it will save the input to <code class="notranslate">2b</code> thus checkpointing it, which, as mentioned in step 3, I do not want to happen!</strong></p>
<p dir="auto">On the other hand, maybe it will be freed because of how everything is set up and autograd's reference counting?</p>
<p dir="auto">Maybe, as <code class="notranslate">drop(2b)</code> saves its input, and <code class="notranslate">2a</code> was run with no grad, you get an unreachable cycle between them that will get garbage collected?</p>
<p dir="auto">I really lack the autograd understanding to know (see the <2 days of PyTorch). I also do not know how to profile this to observe if it drops the tensor or not.</p>
</li>
</ol>
<p dir="auto"><strong>If my anaylsis is right, I will have to implement this <code class="notranslate">drop</code> operator from scratch such that it avoids this behaviour, correct?</strong></p>
</li>
</ol>
<p dir="auto">Thank you for making it this far and sorry if the above explanations are not great, it would be easier with diagrams. Any help on this would be greatly appreciated.</p> | <p dir="auto">It looks like THPVariable_invert should be implemented in C++ to avoid duplicate work from a JIT team.</p>
<p dir="auto">For more details, please, see <a href="https://github.com/pytorch/pytorch/pull/21113" data-hovercard-type="pull_request" data-hovercard-url="/pytorch/pytorch/pull/21113/hovercard">PR</a> comments.</p> | 0 |
<h3 dir="auto">System Information</h3>
<p dir="auto">System: macOS Monterery 12.6(21G115) mac Mini<br>
opencv branch master<br>
cmake version 3.25.0-rc2<br>
Python 3.9.7<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/7733842/197825150-746dff49-067e-4e9a-8d31-0a682ca111fe.png"><img src="https://user-images.githubusercontent.com/7733842/197825150-746dff49-067e-4e9a-8d31-0a682ca111fe.png" alt="截屏2022-10-26 00 06 28" style="max-width: 100%;"></a></p>
<h3 dir="auto">Detailed description</h3>
<p dir="auto">**I want to cross build opencv for ios. in my Mac mini use following command:<br>
python opencv/platforms/ios/build_framework.py ios --contrib opencv_contrib --iphoneos_archs arm64 --iphonesimulator_archs x86_64</p>
<p dir="auto">but i alway report error as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc/framework_build/opencv2.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'ALL_BUILD' from project 'opencv2')
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'opencv2')
/Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc/framework_build/opencv2.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'ZERO_CHECK' from project 'opencv2')
note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'opencv2')
BUILD FAILED
The following build commands failed:
SwiftCompile normal arm64 Compiling\ ImgcodecsExt.swift,\ ImgprocExt.swift,\ MlExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgcodecs/ImgcodecsExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgproc/ImgprocExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal arm64 /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal arm64 /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal arm64 /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
SwiftCompile normal arm64 Compiling\ ObjdetectExt.swift,\ PhotoExt.swift,\ Structured_lightExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/objdetect/ObjdetectExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/photo/PhotoExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')
(5 failures)
============================================================
ERROR: Command '['xcodebuild', 'BITCODE_GENERATION_MODE=bitcode', 'IPHONEOS_DEPLOYMENT_TARGET=9.0', 'ARCHS=arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
Traceback (most recent call last):
File "/Users/linxiaohai/source/opencv/opencv/platforms/ios/build_framework.py", line 181, in build
self._build(outdir)
File "/Users/linxiaohai/source/opencv/opencv/platforms/ios/build_framework.py", line 139, in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Users/linxiaohai/source/opencv/opencv/platforms/ios/build_framework.py", line 329, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")
File "/Users/linxiaohai/source/opencv/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/linxiaohai/.pyenv/versions/3.9.7/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', 'BITCODE_GENERATION_MODE=bitcode', 'IPHONEOS_DEPLOYMENT_TARGET=9.0', 'ARCHS=arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65."><pre class="notranslate"><code class="notranslate">/Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc/framework_build/opencv2.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'ALL_BUILD' from project 'opencv2')
note: Run script build phase 'Generate CMakeFiles/ALL_BUILD' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ALL_BUILD' from project 'opencv2')
/Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc/framework_build/opencv2.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'ZERO_CHECK' from project 'opencv2')
note: Run script build phase 'Generate CMakeFiles/ZERO_CHECK' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'ZERO_CHECK' from project 'opencv2')
BUILD FAILED
The following build commands failed:
SwiftCompile normal arm64 Compiling\ ImgcodecsExt.swift,\ ImgprocExt.swift,\ MlExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgcodecs/ImgcodecsExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgproc/ImgprocExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal arm64 /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal arm64 /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal arm64 /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
SwiftCompile normal arm64 Compiling\ ObjdetectExt.swift,\ PhotoExt.swift,\ Structured_lightExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/objdetect/ObjdetectExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/photo/PhotoExt.swift /Users/linxiaohai/source/opencv/ios/build/build-arm64-iphoneos/modules/objc_bindings_generator/ios/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')
(5 failures)
============================================================
ERROR: Command '['xcodebuild', 'BITCODE_GENERATION_MODE=bitcode', 'IPHONEOS_DEPLOYMENT_TARGET=9.0', 'ARCHS=arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
Traceback (most recent call last):
File "/Users/linxiaohai/source/opencv/opencv/platforms/ios/build_framework.py", line 181, in build
self._build(outdir)
File "/Users/linxiaohai/source/opencv/opencv/platforms/ios/build_framework.py", line 139, in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Users/linxiaohai/source/opencv/opencv/platforms/ios/build_framework.py", line 329, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")
File "/Users/linxiaohai/source/opencv/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/linxiaohai/.pyenv/versions/3.9.7/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', 'BITCODE_GENERATION_MODE=bitcode', 'IPHONEOS_DEPLOYMENT_TARGET=9.0', 'ARCHS=arm64', '-sdk', 'iphoneos', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
</code></pre></div>
<h3 dir="auto">Steps to reproduce</h3>
<ol dir="auto">
<li>run python opencv/platforms/ios/build_framework.py ios --contrib opencv_contrib --iphoneos_archs arm64 --iphonesimulator_archs x86_64 >> buildlog.log</li>
<li>i will report build error as menthon above.</li>
<li></li>
</ol>
<h3 dir="auto">Issue submission checklist</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I report the issue, it's not a question</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I updated to the latest OpenCV version and the issue is still there</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> There is reproducer code and related data files (videos, images, onnx, etc)</li>
</ul> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="** BUILD FAILED **
The following build commands failed:
EmitSwiftModule normal x86_64 (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/objdetect/ObjdetectExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/photo/PhotoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/aruco/ArucoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/calib3d/Calib3dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/ByteVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CoreExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CvTypeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/DoubleVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/FloatVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/dnn/DnnExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/face/FaceExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/features2d/Features2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/IntVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/MatExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/Typealiases.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/text/TextExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/video/VideoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/videoio/VideoioExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/wechat_qrcode/Wechat_qrcodeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/xfeatures2d/Xfeatures2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ximgproc/XimgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'opencv2' from project 'opencv2')
(27 failures)
============================================================
ERROR: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
Traceback (most recent call last):
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 181, in build
self._build(outdir)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 139, in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 329, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")
File "/Users/andy/Workspace/OpenCV/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/andy/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
ERROR: Command '['python3', '/Users/andy/Workspace/OpenCV/opencv/platforms/osx/build_framework.py', './build_xcframework/macos', '--macos_archs', 'x86_64,arm64', '--framework_name', 'opencv2', '--build_only_specified_archs', '--contrib', 'opencv_contrib']' returned non-zero exit status 1.
============================================================
Traceback (most recent call last):
File "opencv/platforms/apple/build_xcframework.py", line 99, in <module>
execute(command, cwd=os.getcwd())
File "/Users/andy/Workspace/OpenCV/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/andy/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python3', '/Users/andy/Workspace/OpenCV/opencv/platforms/osx/build_framework.py', './build_xcframework/macos', '--macos_archs', 'x86_64,arm64', '--framework_name', 'opencv2', '--build_only_specified_archs', '--contrib', 'opencv_contrib']' returned non-zero exit status 1.
"><pre class="notranslate"><code class="notranslate">** BUILD FAILED **
The following build commands failed:
EmitSwiftModule normal x86_64 (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/objdetect/ObjdetectExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/photo/PhotoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/structured_light/Structured_lightExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/aruco/ArucoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/calib3d/Calib3dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/ByteVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CoreExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgcodecs/ImgcodecsExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/imgproc/ImgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ml/MlExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/CvTypeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/DoubleVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/FloatVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/dnn/DnnExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/face/FaceExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/features2d/Features2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/IntVectorExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/MatExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/core/Typealiases.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/text/TextExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/video/VideoExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/videoio/VideoioExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/wechat_qrcode/Wechat_qrcodeExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/xfeatures2d/Xfeatures2dExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwift normal x86_64 /Users/andy/Workspace/OpenCV/build_xcframework/macos/build/build-x86_64-macosx/modules/objc_bindings_generator/osx/gen/objc/ximgproc/XimgprocExt.swift (in target 'opencv2' from project 'opencv2')
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'opencv2' from project 'opencv2')
(27 failures)
============================================================
ERROR: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
Traceback (most recent call last):
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 181, in build
self._build(outdir)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 139, in _build
self.buildOne(target[0], target[1], main_build_dir, cmake_flags)
File "/Users/andy/Workspace/OpenCV/opencv/platforms/ios/build_framework.py", line 329, in buildOne
execute(buildcmd + ["-target", "ALL_BUILD", "build"], cwd = builddir + "/modules/objc/framework_build")
File "/Users/andy/Workspace/OpenCV/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/andy/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['xcodebuild', 'MACOSX_DEPLOYMENT_TARGET=10.12', 'ARCHS=x86_64', '-sdk', 'macosx', '-configuration', 'Release', '-parallelizeTargets', '-jobs', '8', '-target', 'ALL_BUILD', 'build']' returned non-zero exit status 65.
============================================================
ERROR: Command '['python3', '/Users/andy/Workspace/OpenCV/opencv/platforms/osx/build_framework.py', './build_xcframework/macos', '--macos_archs', 'x86_64,arm64', '--framework_name', 'opencv2', '--build_only_specified_archs', '--contrib', 'opencv_contrib']' returned non-zero exit status 1.
============================================================
Traceback (most recent call last):
File "opencv/platforms/apple/build_xcframework.py", line 99, in <module>
execute(command, cwd=os.getcwd())
File "/Users/andy/Workspace/OpenCV/opencv/platforms/apple/cv_build_utils.py", line 13, in execute
retcode = check_call(cmd, cwd = cwd)
File "/Users/andy/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['python3', '/Users/andy/Workspace/OpenCV/opencv/platforms/osx/build_framework.py', './build_xcframework/macos', '--macos_archs', 'x86_64,arm64', '--framework_name', 'opencv2', '--build_only_specified_archs', '--contrib', 'opencv_contrib']' returned non-zero exit status 1.
</code></pre></div> | 1 |
<p dir="auto">Debugging a Node program that uses <a href="https://nodejs.org/api/util.html#util_util_inspect_object_options" rel="nofollow">util.inspect</a> hangs the underlying node process.</p>
<p dir="auto">I stumbled across this while working on an app that depends on the Azure Storage SDK for Node (it uses util.inspect). I don't have a workaround for debugging right now, but the app works fine when running directly from the command line.</p>
<p dir="auto">I've created a repro of the problem here:<br>
<a href="https://gist.github.com/benquarmby/36f6c00947ad04509212">https://gist.github.com/benquarmby/36f6c00947ad04509212</a></p>
<p dir="auto">Steps:</p>
<ul dir="auto">
<li>Create a script that invokes util.inspect on an object</li>
<li>Place a breakpoint in the script <em>after</em> the call util.inspect</li>
<li>Start debugging</li>
<li>Observe that the breakpoint is not hit</li>
</ul>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>VSCode 0.10.6</li>
<li>Windows 10 x64</li>
<li>Node 5.5 x64</li>
</ul> | <p dir="auto">launch this snippet <code class="notranslate">test.js</code>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var obj = {};
console.log(obj);
console.log(obj);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">obj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">with <code class="notranslate">node --debug-brk test.js</code> and attach a debugger, e.g. node-inspector or VSCode.</p>
<p dir="auto">The first <em>step</em> command works fine, the second <em>step</em> crashes node on all platforms.</p> | 1 |
<p dir="auto">Challenge <a href="http://www.freecodecamp.com/challenges/waypoint-add-placeholder-text-to-a-text-field#?solution=%3Clink%20href%3D%22http%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DLobster%22%20rel%3D%22stylesheet%22%20type%3D%22text%2Fcss%22%3E%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%20%20%20color%3A%20red%3B%0A%20%20%7D%0A%0A%20%20h2%20%7B%0A%20%20%20%20font-family%3A%20Lobster%2C%20Monospace%3B%0A%20%20%7D%0A%0A%20%20p%20%7B%0A%20%20%20%20font-size%3A%2016px%3B%0A%20%20%20%20font-family%3A%20Monospace%3B%0A%20%20%7D%0A%0A%20%20.thick-green-border%20%7B%0A%20%20%20%20border-color%3A%20green%3B%0A%20%20%20%20border-width%3A%2010px%3B%0A%20%20%20%20border-style%3A%20solid%3B%0A%20%20%20%20border-radius%3A%2050%25%3B%0A%20%20%7D%0A%0A%20%20.smaller-image%20%7B%0A%20%20%20%20width%3A%20100px%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EClick%20here%20for%20%3Ca%20href%3D%22%23%22%3Ecat%20photos%3C%2Fa%3E.%3C%2Fp%3E%0A%0A%3Ca%20href%3D%22%23%22%3E%3Cimg%20class%3D%22smaller-image%20thick-green-border%22%20alt%3D%22A%20cute%20orange%20cat%20lying%20on%20its%20back%22%20src%3D%22https%3A%2F%2Fbit.ly%2Ffcc-relaxing-cat%22%3E%3C%2Fa%3E%0A%0A%3Cp%3EThings%20cats%20love%3A%3C%2Fp%3E%0A%3Cul%3E%0A%20%20%3Cli%3Ecat%20nip%3C%2Fli%3E%0A%20%20%3Cli%3Elaser%20pointers%3C%2Fli%3E%0A%20%20%3Cli%3Elasagna%3C%2Fli%3E%0A%3C%2Ful%3E%0A%3Cp%3ETop%203%20things%20cats%20hate%3A%3C%2Fp%3E%0A%3Col%3E%0A%20%20%3Cli%3Eflea%20treatment%3C%2Fli%3E%0A%20%20%3Cli%3Ethunder%3C%2Fli%3E%0A%20%20%3Cli%3Eother%20cats%3C%2Fli%3E%0A%3C%2Fol%3E%0A%3Cinput%20type%3D%22text%22%20placeholder%3D%22cat%20photo%20URL%22%2F%3E%0A" rel="nofollow">Waypoint: Add Placeholder Text to a Text Field</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}
.smaller-image {
width: 100px;
}
</style>
<h2 class="red-text">CatPhotoApp</h2>
<p>Click here for <a href="#">cat photos</a>.</p>
<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>
<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<input type="text" placeholder="cat photo URL"/>
"><pre class="notranslate"><span class="pl-kos"><</span><span class="pl-ent">link</span> <span class="pl-c1">href</span>="<span class="pl-s">http://fonts.googleapis.com/css?family=Lobster</span>" <span class="pl-c1">rel</span>="<span class="pl-s">stylesheet</span>" <span class="pl-c1">type</span>="<span class="pl-s">text/css</span>"<span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">style</span><span class="pl-kos">></span>
.<span class="pl-c1">red-text</span> {
<span class="pl-c1">color</span><span class="pl-kos">:</span> red;
}
<span class="pl-ent">h2</span> {
<span class="pl-c1">font-family</span><span class="pl-kos">:</span> Lobster<span class="pl-kos">,</span> Monospace;
}
<span class="pl-ent">p</span> {
<span class="pl-c1">font-size</span><span class="pl-kos">:</span> <span class="pl-c1">16<span class="pl-smi">px</span></span>;
<span class="pl-c1">font-family</span><span class="pl-kos">:</span> Monospace;
}
.<span class="pl-c1">thick-green-border</span> {
<span class="pl-c1">border-color</span><span class="pl-kos">:</span> green;
<span class="pl-c1">border-width</span><span class="pl-kos">:</span> <span class="pl-c1">10<span class="pl-smi">px</span></span>;
<span class="pl-c1">border-style</span><span class="pl-kos">:</span> solid;
<span class="pl-c1">border-radius</span><span class="pl-kos">:</span> <span class="pl-c1">50<span class="pl-smi">%</span></span>;
}
.<span class="pl-c1">smaller-image</span> {
<span class="pl-c1">width</span><span class="pl-kos">:</span> <span class="pl-c1">100<span class="pl-smi">px</span></span>;
}
<span class="pl-kos"></</span><span class="pl-ent">style</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">h2</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">></span>CatPhotoApp<span class="pl-kos"></</span><span class="pl-ent">h2</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">p</span><span class="pl-kos">></span>Click here for <span class="pl-kos"><</span><span class="pl-ent">a</span> <span class="pl-c1">href</span>="<span class="pl-s">#</span>"<span class="pl-kos">></span>cat photos<span class="pl-kos"></</span><span class="pl-ent">a</span><span class="pl-kos">></span>.<span class="pl-kos"></</span><span class="pl-ent">p</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">a</span> <span class="pl-c1">href</span>="<span class="pl-s">#</span>"<span class="pl-kos">></span><span class="pl-kos"><</span><span class="pl-ent">img</span> <span class="pl-c1">class</span>="<span class="pl-s">smaller-image thick-green-border</span>" <span class="pl-c1">alt</span>="<span class="pl-s">A cute orange cat lying on its back</span>" <span class="pl-c1">src</span>="<span class="pl-s">https://bit.ly/fcc-relaxing-cat</span>"<span class="pl-kos">></span><span class="pl-kos"></</span><span class="pl-ent">a</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">p</span><span class="pl-kos">></span>Things cats love:<span class="pl-kos"></</span><span class="pl-ent">p</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">ul</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>cat nip<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>laser pointers<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>lasagna<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">ul</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">p</span><span class="pl-kos">></span>Top 3 things cats hate:<span class="pl-kos"></</span><span class="pl-ent">p</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">ol</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>flea treatment<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>thunder<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">li</span><span class="pl-kos">></span>other cats<span class="pl-kos"></</span><span class="pl-ent">li</span><span class="pl-kos">></span>
<span class="pl-kos"></</span><span class="pl-ent">ol</span><span class="pl-kos">></span>
<span class="pl-kos"><</span><span class="pl-ent">input</span> <span class="pl-c1">type</span>="<span class="pl-s">text</span>" <span class="pl-c1">placeholder</span>="<span class="pl-s">cat photo URL</span>"/></pre></div>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/4959023/12241895/1187ac70-b87d-11e5-9b9f-3ae91b568a7c.png"><img src="https://cloud.githubusercontent.com/assets/4959023/12241895/1187ac70-b87d-11e5-9b9f-3ae91b568a7c.png" alt="image" style="max-width: 100%;"></a></p> | <p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/make-a-person#?solution=/*jshint%20esversion%3A%206%20*/%0A%0Aclass%20Person%20%7B%0A%20%20constructor%28full%29%7B%0A%20%20%20%20this.tercero%20%3D%200%3B%0A%20%20%20%20this.quarto%20%3D%200%3B%0A%20%20%20%20this.quinto%20%3D%200%3B%0A%20%20%20%20this.sexto%20%3D%200%3B%0A%20%20%20%20%5Bthis.first%2C%20this.last%5D%20%3D%20full.split%28%27%20%27%29%0A%20%20%7D%0A%20%20getFirstName%28%29%20%7B%20return%20this.first%20%7D%0A%20%20getLastName%28%29%20%7B%20return%20this.last%20%7D%0A%20%20getFullName%28%29%20%7B%20return%20%60%24%7Bthis.first%7D%20%24%7Bthis.last%7D%60%20%7D%0A%20%20setFirstName%28first%29%20%7B%20this.first%20%3D%20first%20%7D%0A%20%20setLastName%28last%29%20%7B%20this.last%20%3D%20last%20%7D%0A%20%20setFullName%28full%29%20%7B%20%5Bthis.first%2C%20this.last%5D%20%3D%20full.split%28%27%20%27%29%20%7D%0A%7D%0A%0A%0Avar%20bob%20%3D%20new%20Person%28%27Bob%20Ross%27%29%3B%0AObject.keys%28bob%29.length%0Abob.getFullName%28%29%3B" rel="nofollow">Make a Person</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.21 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">So, the problem is, the Class keyword is supported by the linter but not by the problem checker.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/*jshint esversion: 6 */
class Person {
constructor(full){
// attemped fudge for old-school classes:
this.tercero = 0;
this.quarto = 0;
this.quinto = 0;
this.sexto = 0;
//
[this.first, this.last] = full.split(' ')
}
getFirstName() { return this.first }
getLastName() { return this.last }
getFullName() { return `${this.first} ${this.last}` }
setFirstName(first) { this.first = first }
setLastName(last) { this.last = last }
setFullName(full) { [this.first, this.last] = full.split(' ') }
}
var bob = new Person('Bob Ross');
Object.keys(bob).length
bob.getFullName();"><pre class="notranslate"><span class="pl-c">/*jshint esversion: 6 */</span>
<span class="pl-k">class</span> <span class="pl-v">Person</span> <span class="pl-kos">{</span>
<span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-s1">full</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
<span class="pl-c">// attemped fudge for old-school classes:</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">tercero</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">quarto</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">quinto</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">sexto</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-c">//</span>
<span class="pl-kos">[</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">first</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">last</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">full</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">' '</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-en">getFirstName</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">first</span> <span class="pl-kos">}</span>
<span class="pl-en">getLastName</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">last</span> <span class="pl-kos">}</span>
<span class="pl-en">getFullName</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">first</span><span class="pl-kos">}</span></span> <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">last</span><span class="pl-kos">}</span></span>`</span> <span class="pl-kos">}</span>
<span class="pl-en">setFirstName</span><span class="pl-kos">(</span><span class="pl-s1">first</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">first</span> <span class="pl-c1">=</span> <span class="pl-s1">first</span> <span class="pl-kos">}</span>
<span class="pl-en">setLastName</span><span class="pl-kos">(</span><span class="pl-s1">last</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">last</span> <span class="pl-c1">=</span> <span class="pl-s1">last</span> <span class="pl-kos">}</span>
<span class="pl-en">setFullName</span><span class="pl-kos">(</span><span class="pl-s1">full</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">[</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">first</span><span class="pl-kos">,</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">last</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">full</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">' '</span><span class="pl-kos">)</span> <span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-k">var</span> <span class="pl-s1">bob</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Person</span><span class="pl-kos">(</span><span class="pl-s">'Bob Ross'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-s1">bob</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">length</span>
<span class="pl-s1">bob</span><span class="pl-kos">.</span><span class="pl-en">getFullName</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div> | 0 |
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="156234118" data-permission-text="Title is private" data-url="https://github.com/microsoft/vscode/issues/6656" data-hovercard-type="issue" data-hovercard-url="/microsoft/vscode/issues/6656/hovercard" href="https://github.com/microsoft/vscode/issues/6656">#6656</a></p>
<p dir="auto">This might be a larger problem with the peek feature.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/2193314/15515142/81d8f884-21a1-11e6-87e1-7c14e2c946b0.png"><img src="https://cloud.githubusercontent.com/assets/2193314/15515142/81d8f884-21a1-11e6-87e1-7c14e2c946b0.png" alt="image" style="max-width: 100%;"></a></p> | <p dir="auto">I have several issues with it:</p>
<ol dir="auto">
<li>it appears that it at least partially ignores the configuration of the named task in the <code class="notranslate">tasks.json</code>. For example, if I have a task <code class="notranslate">watch:scss</code> with <code class="notranslate">"showOutput": "never"</code> there - running it manually doesn't invoke new tab with output, but if I also add it to <code class="notranslate">launch.json</code> via <code class="notranslate">"preLaunchTask": "watch:scss"</code> - it opens output every time I re/launch the app. However it seems that it does respect the <code class="notranslate">isWatching</code> flag, since it doesn't start the app until I terminate the task manually if the setting is false/omitted or it does start the app if the setting is set to true.</li>
<li>if the task is a persistent one (<code class="notranslate">"isWatching": true</code>) relaunching the app prompts me to terminate the already running one. And it doesn't start the app right away if I chose to terminate it in the prompt - I need to run it again. Which is annoying as hell as you can imagine. There should be an additional setting for either silently restarting the <code class="notranslate">preLaunchTask</code> or silently skip the task launch and assuming that the already running should run until the end of the current session. And/or there should be a default based on the either - in any case prompting is not an option.</li>
<li><code class="notranslate">preLaunchTask</code> is hardly present in the documentation at all. I think many more people would complain if they just knew that this option even exist...</li>
</ol>
<p dir="auto">thanks in advance.</p> | 0 |
<p dir="auto">[Enter steps to reproduce below:]</p>
<ol dir="auto">
<li>...</li>
<li>...</li>
</ol>
<p dir="auto"><strong>Atom Version</strong>: 1.0.0<br>
<strong>System</strong>: Windows 7 64bit<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: Cannot find module './context-menu'<br>
Error: Cannot find module './context-menu'<br>
at Function.Module._resolveFilename (module.js:328:15)<br>
at Function.Module._load (module.js:270:25)<br>
at Module.require (module.js:357:17)<br>
at require (module.js:376:17)<br>
at BrowserWindow. (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27)<br>
at emitOne (events.js:77:13)<br>
at BrowserWindow.emit (events.js:166:7)<br>
at callFunction (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)<br>
at EventEmitter. (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)<br>
at emitMany (events.js:108:13)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77
Error: Cannot find module './context-menu'
Error: Cannot find module './context-menu'
at Function.Module._resolveFilename (module.js:328:15)
at Function.Module._load (module.js:270:25)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at BrowserWindow.<anonymous> (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27)
at emitOne (events.js:77:13)
at BrowserWindow.emit (events.js:166:7)
at callFunction (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)
at EventEmitter.<anonymous> (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)
at emitMany (events.js:108:13)
at metaToValue (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77:15)
at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:111:26)
at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\context-menu-manager.js:170:31)
at HTMLDocument.<anonymous> (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:150:33)
at HTMLDocument.handler (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\space-pen-extensions.js:112:34)
at HTMLDocument.jQuery.event.dispatch (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
at HTMLDocument.elemData.handle (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)"><pre class="notranslate"><code class="notranslate">At C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77
Error: Cannot find module './context-menu'
Error: Cannot find module './context-menu'
at Function.Module._resolveFilename (module.js:328:15)
at Function.Module._load (module.js:270:25)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at BrowserWindow.<anonymous> (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\browser\atom-window.js:149:27)
at emitOne (events.js:77:13)
at BrowserWindow.emit (events.js:166:7)
at callFunction (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)
at EventEmitter.<anonymous> (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)
at emitMany (events.js:108:13)
at metaToValue (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:77:15)
at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\atom.asar\renderer\api\lib\remote.js:111:26)
at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\context-menu-manager.js:170:31)
at HTMLDocument.<anonymous> (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\window-event-handler.js:150:33)
at HTMLDocument.handler (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\src\space-pen-extensions.js:112:34)
at HTMLDocument.jQuery.event.dispatch (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
at HTMLDocument.elemData.handle (C:\Users\pc\AppData\Local\atom\app-1.0.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)
</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -2:23.9.0 git-control:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)"><pre class="notranslate"><code class="notranslate"> -2:23.9.0 git-control:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
</code></pre></div>
<h3 dir="auto">Config</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"core": {},
"editor": {
"invisibles": {},
"softWrap": true,
"tabLength": 4
}
}"><pre class="notranslate">{
<span class="pl-ent">"core"</span>: {},
<span class="pl-ent">"editor"</span>: {
<span class="pl-ent">"invisibles"</span>: {},
<span class="pl-ent">"softWrap"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"tabLength"</span>: <span class="pl-c1">4</span>
}
}</pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
git-control, v0.3.0
highlight-selected, v0.10.1
minimap, v4.10.1
# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
git<span class="pl-k">-</span>control, v0.<span class="pl-ii">3</span>.<span class="pl-ii">0</span>
highlight<span class="pl-k">-</span>selected, v0.<span class="pl-ii">10</span>.<span class="pl-ii">1</span>
minimap, v4.<span class="pl-ii">10</span>.<span class="pl-ii">1</span>
<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div> | <p dir="auto">I right-clicked on a folder in the tree view</p>
<p dir="auto"><strong>Atom Version</strong>: 0.194.0<br>
<strong>System</strong>: Windows 7 Entreprise<br>
<strong>Thrown From</strong>: Atom Core</p>
<h3 dir="auto">Stack Trace</h3>
<p dir="auto">Uncaught Error: Cannot find module './context-menu'<br>
Error: Cannot find module './context-menu'<br>
at Function.Module._resolveFilename (module.js:328:15)<br>
at Function.Module._load (module.js:270:25)<br>
at Module.require (module.js:357:17)<br>
at require (module.js:376:17)<br>
at BrowserWindow. (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\browser\atom-window.js:152:27)<br>
at emitOne (events.js:77:13)<br>
at BrowserWindow.emit (events.js:166:7)<br>
at callFunction (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)<br>
at EventEmitter. (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)<br>
at emitMany (events.js:108:13)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="At C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\renderer\api\lib\remote.js:77
Error: Cannot find module './context-menu'
Error: Cannot find module './context-menu'
at Function.Module._resolveFilename (module.js:328:15)
at Function.Module._load (module.js:270:25)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at BrowserWindow.<anonymous> (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\browser\atom-window.js:152:27)
at emitOne (events.js:77:13)
at BrowserWindow.emit (events.js:166:7)
at callFunction (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)
at EventEmitter.<anonymous> (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)
at emitMany (events.js:108:13)
at metaToValue (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\renderer\api\lib\remote.js:77:15)
at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\renderer\api\lib\remote.js:111:26)
at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\context-menu-manager.js:170:31)
at HTMLDocument.<anonymous> (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\window-event-handler.js:149:33)
at HTMLDocument.handler (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\space-pen-extensions.js:112:34)
at HTMLDocument.jQuery.event.dispatch (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
at HTMLDocument.elemData.handle (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)
"><pre class="notranslate"><code class="notranslate">At C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\renderer\api\lib\remote.js:77
Error: Cannot find module './context-menu'
Error: Cannot find module './context-menu'
at Function.Module._resolveFilename (module.js:328:15)
at Function.Module._load (module.js:270:25)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at BrowserWindow.<anonymous> (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\browser\atom-window.js:152:27)
at emitOne (events.js:77:13)
at BrowserWindow.emit (events.js:166:7)
at callFunction (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\browser\lib\rpc-server.js:116:18)
at EventEmitter.<anonymous> (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\browser\lib\rpc-server.js:208:14)
at emitMany (events.js:108:13)
at metaToValue (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\renderer\api\lib\remote.js:77:15)
at BrowserWindow.RemoteMemberFunction [as emit] (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\atom.asar\renderer\api\lib\remote.js:111:26)
at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\context-menu-manager.js:170:31)
at HTMLDocument.<anonymous> (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\window-event-handler.js:149:33)
at HTMLDocument.handler (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\src\space-pen-extensions.js:112:34)
at HTMLDocument.jQuery.event.dispatch (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4681:9)
at HTMLDocument.elemData.handle (C:\Users\jbrichardet\AppData\Local\atom\app-0.194.0\resources\app.asar\node_modules\space-pen\vendor\jquery.js:4359:46)
</code></pre></div>
<h3 dir="auto">Commands</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" -4:55.5.0 editor:checkout-head-revision (atom-text-editor.editor.is-focused)
2x -3:41.6.0 window:focus-pane-on-right (atom-text-editor.editor)
-3:17.5.0 application:add-project-folder (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-2:47.4.0 editor:newline (atom-text-editor.editor.is-focused)
-2:38.2.0 core:cut (atom-text-editor.editor)
-2:36.5.0 core:paste (atom-text-editor.editor.is-focused)
-2:26.6.0 core:save (atom-text-editor.editor.is-focused)
-2:20.6.0 core:move-down (atom-text-editor.editor)
-2:20.4.0 autocomplete-plus:confirm (atom-text-editor.editor)
-2:15.8.0 core:save (atom-text-editor.editor)
-2:08.7.0 core:copy (atom-text-editor.editor.is-focused)
-2:01.2.0 core:paste (atom-text-editor.editor.is-focused)
-1:59.7.0 core:save (atom-text-editor.editor.is-focused)
-1:52.2.0 core:paste (atom-text-editor.editor.is-focused)
-1:51.6.0 core:save (atom-text-editor.editor.is-focused)
-1:30.6.0 core:backspace (atom-text-editor.editor)"><pre class="notranslate"><code class="notranslate"> -4:55.5.0 editor:checkout-head-revision (atom-text-editor.editor.is-focused)
2x -3:41.6.0 window:focus-pane-on-right (atom-text-editor.editor)
-3:17.5.0 application:add-project-folder (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
-2:47.4.0 editor:newline (atom-text-editor.editor.is-focused)
-2:38.2.0 core:cut (atom-text-editor.editor)
-2:36.5.0 core:paste (atom-text-editor.editor.is-focused)
-2:26.6.0 core:save (atom-text-editor.editor.is-focused)
-2:20.6.0 core:move-down (atom-text-editor.editor)
-2:20.4.0 autocomplete-plus:confirm (atom-text-editor.editor)
-2:15.8.0 core:save (atom-text-editor.editor)
-2:08.7.0 core:copy (atom-text-editor.editor.is-focused)
-2:01.2.0 core:paste (atom-text-editor.editor.is-focused)
-1:59.7.0 core:save (atom-text-editor.editor.is-focused)
-1:52.2.0 core:paste (atom-text-editor.editor.is-focused)
-1:51.6.0 core:save (atom-text-editor.editor.is-focused)
-1:30.6.0 core:backspace (atom-text-editor.editor)
</code></pre></div>
<h3 dir="auto">Config</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
"core": {
"ignoredNames": [
"node_modules"
],
"themes": [
"atom-dark-ui",
"seti-syntax"
],
"disabledPackages": [
"Tern"
],
"projectHome": "Y:\\app-tfoumax"
},
"editor": {
"invisibles": {},
"softWrap": true,
"showIndentGuide": true
}
}"><pre class="notranslate">{
<span class="pl-ent">"core"</span>: {
<span class="pl-ent">"ignoredNames"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>node_modules<span class="pl-pds">"</span></span>
],
<span class="pl-ent">"themes"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>atom-dark-ui<span class="pl-pds">"</span></span>,
<span class="pl-s"><span class="pl-pds">"</span>seti-syntax<span class="pl-pds">"</span></span>
],
<span class="pl-ent">"disabledPackages"</span>: [
<span class="pl-s"><span class="pl-pds">"</span>Tern<span class="pl-pds">"</span></span>
],
<span class="pl-ent">"projectHome"</span>: <span class="pl-s"><span class="pl-pds">"</span>Y:<span class="pl-cce">\\</span>app-tfoumax<span class="pl-pds">"</span></span>
},
<span class="pl-ent">"editor"</span>: {
<span class="pl-ent">"invisibles"</span>: {},
<span class="pl-ent">"softWrap"</span>: <span class="pl-c1">true</span>,
<span class="pl-ent">"showIndentGuide"</span>: <span class="pl-c1">true</span>
}
}</pre></div>
<h3 dir="auto">Installed Packages</h3>
<div class="highlight highlight-source-coffee notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# User
autocomplete-plus, v2.12.0
autocomplete-snippets, v1.2.0
javascript-snippets, v1.0.0
jshint, v1.3.5
language-ejs, v0.1.0
linter, v0.12.1
pretty-json, v0.3.3
save-session, v0.14.0
Search, v0.4.0
seti-syntax, v0.4.0
# Dev
No dev packages"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span> User</span>
autocomplete<span class="pl-k">-</span>plus, v2.<span class="pl-ii">12</span>.<span class="pl-ii">0</span>
autocomplete<span class="pl-k">-</span>snippets, v1.<span class="pl-ii">2</span>.<span class="pl-ii">0</span>
javascript<span class="pl-k">-</span>snippets, v1.<span class="pl-ii">0</span>.<span class="pl-ii">0</span>
jshint, v1.<span class="pl-ii">3</span>.<span class="pl-ii">5</span>
language<span class="pl-k">-</span>ejs, v0.<span class="pl-ii">1</span>.<span class="pl-ii">0</span>
linter, v0.<span class="pl-ii">12</span>.<span class="pl-ii">1</span>
pretty<span class="pl-k">-</span>json, v0.<span class="pl-ii">3</span>.<span class="pl-ii">3</span>
save<span class="pl-k">-</span>session, v0.<span class="pl-ii">14</span>.<span class="pl-ii">0</span>
Search, v0.<span class="pl-ii">4</span>.<span class="pl-ii">0</span>
seti<span class="pl-k">-</span>syntax, v0.<span class="pl-ii">4</span>.<span class="pl-ii">0</span>
<span class="pl-c"><span class="pl-c">#</span> Dev</span>
<span class="pl-en">No</span> <span class="pl-en">dev</span> packages</pre></div> | 1 |
<p dir="auto">var a: Greeter = new Greeter();<br>
alert(typeof(a));</p>
<p dir="auto">why is "Object" , rather than "Greeter" ?</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.7.5 / 1.8.0-beta / nightly (1.9.0-dev.20160217)</p>
<p dir="auto"><strong>Code</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// A self-contained demonstration of the problem follows...
"><pre class="notranslate"><span class="pl-c">// A self-contained demonstration of the problem follows...</span></pre></div>
<p dir="auto"><strong>Expected behavior:</strong></p>
<p dir="auto"><strong>Actual behavior:</strong></p> | <p dir="auto">There are a few issues when using <code class="notranslate">Ctrl+,</code> functionality.</p>
<h3 dir="auto">Massive duplicated results:</h3>
<p dir="auto">It happens in .ts and .tsx files for any kind of symbol (class, variable, method,...)</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/720953/12866146/4094762e-ccc3-11e5-898b-535262da0af2.png"><img src="https://cloud.githubusercontent.com/assets/720953/12866146/4094762e-ccc3-11e5-898b-535262da0af2.png" alt="image" style="max-width: 100%;"></a></p>
<h3 dir="auto">Imported Symbols</h3>
<p dir="auto">Imported symbols should not be shown, or at least shown at the end of the list.</p>
<p dir="auto">Current results:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/720953/12866148/8476f88a-ccc3-11e5-93ec-a7d304e4a0cb.png"><img src="https://cloud.githubusercontent.com/assets/720953/12866148/8476f88a-ccc3-11e5-93ec-a7d304e4a0cb.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">Expected results:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/720953/12866163/09b909f2-ccc4-11e5-88c7-eae14fadf42c.png"><img src="https://cloud.githubusercontent.com/assets/720953/12866163/09b909f2-ccc4-11e5-88c7-eae14fadf42c.png" alt="image" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">Following a discussion with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/NelleV/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/NelleV">@NelleV</a> I suggest to decrease the number of CI builds to help easing the backlog.</p>
<ul dir="auto">
<li>drop USE_PYTEST (now useless)</li>
</ul>
<p dir="auto">On Travis, e.g.:</p>
<ul dir="auto">
<li>py2.7 mock numpy=1.7 pandas docs</li>
<li>py3.4</li>
<li>py3.6 pandas docs pep8 delete-font-cache</li>
<li>osx (=2.7) mock</li>
</ul>
<p dir="auto">Note that we really should build the docs on 2.7 too (extra points if we build them on OSX instead of the Linux 2.7 job) -- right now they don't build on 2.7 at all (due to failure in examples).</p>
<p dir="auto">On Appveyor the third job is currently a duplicate of the second(!) except that one has USE_PYTEST and not the other (which is the same). So we could be left with</p>
<ul dir="auto">
<li>py2.7 numpy=1.8 without extra dependencies</li>
<li>py3.5 numpy=1.10 without extra dependencies</li>
<li>py2.7 numpy=1.10 <em>32-bit</em> with extra dependencies<br>
(the last two could be merged into e.g. py3.5 numpy=1.10 32-bit with extra dependencies, if we're still under backlog pressure)</li>
</ul>
<p dir="auto">More extra points if someone manages to build the docs on Windows...</p> | <p dir="auto"><strong>Report</strong></p>
<p dir="auto"><strong>Summary</strong><br>
I was trying to use networkx to draw some graphs but matplotlib fails. So I tested some actual matplotlib examples without including networkx related code and I reproduced the same error. I suspect it may be related to Qt but cannot be sure. The error states as:</p>
<blockquote>
<p dir="auto">AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'</p>
</blockquote>
<p dir="auto"><strong>Code for reproduction</strong></p>
<p dir="auto">I am using python 2.7. The code I used was:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C,S = np.cos(X), np.sin(X)
plt.plot(X,C)
plt.plot(X,S)
plt.show()"><pre class="notranslate"><code class="notranslate">import numpy as np
import matplotlib.pyplot as plt
X = np.linspace(-np.pi, np.pi, 256, endpoint=True)
C,S = np.cos(X), np.sin(X)
plt.plot(X,C)
plt.plot(X,S)
plt.show()
</code></pre></div>
<p dir="auto">but it already fails in this line:</p>
<p dir="auto"><code class="notranslate">plt.plot(X,C)</code></p>
<p dir="auto"><strong>Expected outcome</strong><br>
Expected outcome is this picture:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/dfdccd3ad6495f3b101161a6e265228ac8650b86e2370babade6b0aedef1670e/68747470733a2f2f7777772e6c616272692e66722f706572736f2f6e726f75676965722f7465616368696e672f6d6174706c6f746c69622f666967757265732f65786572636963655f312e706e67"><img src="https://camo.githubusercontent.com/dfdccd3ad6495f3b101161a6e265228ac8650b86e2370babade6b0aedef1670e/68747470733a2f2f7777772e6c616272692e66722f706572736f2f6e726f75676965722f7465616368696e672f6d6174706c6f746c69622f666967757265732f65786572636963655f312e706e67" alt="picture" data-canonical-src="https://www.labri.fr/perso/nrougier/teaching/matplotlib/figures/exercice_1.png" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Matplotlib version</strong></p>
<ul dir="auto">
<li>Operating System: Lubuntu, 14.04.5 LTS</li>
<li>Matplotlib Version: 2.0.1</li>
<li>Python Version: Python 2.7.6</li>
</ul>
<p dir="auto">Qmake:</p>
<blockquote>
<p dir="auto">qmake --version<br>
QMake version 3.0<br>
Using Qt version 5.2.1 in /usr/lib/x86_64-linux-gnu</p>
</blockquote>
<p dir="auto">System info:</p>
<blockquote>
<p dir="auto">Distributor ID: Ubuntu<br>
Description: Ubuntu 14.04.5 LTS<br>
Release: 14.04<br>
Codename: trusty</p>
</blockquote>
<blockquote>
<p dir="auto">uname -a<br>
Linux thesisvm 4.4.0-75-generic <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="816376" data-permission-text="Title is private" data-url="https://github.com/matplotlib/matplotlib/issues/96" data-hovercard-type="pull_request" data-hovercard-url="/matplotlib/matplotlib/pull/96/hovercard" href="https://github.com/matplotlib/matplotlib/pull/96">#96</a>~14.04.1-Ubuntu SMP Thu Apr 20 11:06:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux</p>
</blockquote>
<p dir="auto">Matplotlib info:</p>
<blockquote>
<p dir="auto">matplotlib.<strong>version</strong><br>
'2.0.1'<br>
matplotlib.<strong>file</strong><br>
'/usr/local/lib/python2.7/dist-packages/matplotlib/<strong>init</strong>.pyc'</p>
</blockquote>
<p dir="auto">I cannot reproduce all the commands I issued but can give an outline.<br>
I issued these commands:</p>
<p dir="auto"><code class="notranslate">sudo apt-get build-dep python-matplotlib</code><br>
<code class="notranslate">sudo pip install matplotlib</code></p>
<p dir="auto">Full error trace:</p>
<blockquote>
<p dir="auto">plt.plot(X,C)<br>
Traceback (most recent call last):<br>
File "", line 1, in <br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 3306, in plot<br>
ax = gca()<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 950, in gca<br>
return gcf().gca(**kwargs)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 586, in gcf<br>
return figure()<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 535, in figure<br>
**kwargs)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt4agg.py", line 46, in new_figure_manager<br>
return new_figure_manager_given_figure(num, thisFig)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt4agg.py", line 54, in new_figure_manager_given_figure<br>
return FigureManagerQT(canvas, num)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 488, in <strong>init</strong><br>
self.toolbar = self._get_toolbar(self.canvas, self.window)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 539, in _get_toolbar<br>
toolbar = NavigationToolbar2QT(canvas, parent, False)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 585, in <strong>init</strong><br>
NavigationToolbar2.<strong>init</strong>(self, canvas)<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 2760, in <strong>init</strong><br>
self._init_toolbar()<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 601, in _init_toolbar<br>
a = self.addAction(self._icon(image_file + '.png'),<br>
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_qt5.py", line 591, in _icon<br>
pm.setDevicePixelRatio(self.canvas._dpi_ratio)<br>
AttributeError: 'QPixmap' object has no attribute 'setDevicePixelRatio'</p>
</blockquote> | 0 |
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(gdb) bt
#0 0x00007ffff7727630 in rust_fail ()
from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#1 0x00007ffff75cbd39 in rt::unwind::Unwinder::begin_unwind::h3b1cb9a3eb8d991bXOaD::v0.10.pre () from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#2 0x00007ffff2dd6aa8 in rt::unwind::begin_unwind::hd9a1d253d4a33d5aaQ::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#3 0x00007ffff3976efb in option::Option::unwrap::h144931b46c7e68dblhaV::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#4 0x00007ffff3869351 in metadata::creader::CrateLoader$Loader::load_crate::he9aa556ffd45c033OYae::v0.10.pre ()
from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#5 0x00007ffff62db6ab in ext::expand::load_extern_macros::h9b911bdebace7cc7aw::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#6 0x00007ffff62db384 in ext::expand::expand_view_item::hf01392e46aef41d3an::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#7 0x00007ffff62c9434 in ext::expand::Folder$MacroExpander::fold_view_item::hc549b12bf2909253TxaX::v0.10.pre ()
from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#8 0x00007ffff62c93c8 in fold::noop_fold_mod::anon::expr_fn::aVaW ()
from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#9 0x00007ffff62c98d6 in iter::Map::do_map::hcd7f6781e31a9c951za2::v0.10.pre
() from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#10 0x00007ffff62c9818 in iter::Iterator$Map::next::h9083bbf0fab46094r6a1::v0.10"><pre class="notranslate"><code class="notranslate">(gdb) bt
#0 0x00007ffff7727630 in rust_fail ()
from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#1 0x00007ffff75cbd39 in rt::unwind::Unwinder::begin_unwind::h3b1cb9a3eb8d991bXOaD::v0.10.pre () from /usr/bin/../lib/libstd-966edb7e-0.10-pre.so
#2 0x00007ffff2dd6aa8 in rt::unwind::begin_unwind::hd9a1d253d4a33d5aaQ::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#3 0x00007ffff3976efb in option::Option::unwrap::h144931b46c7e68dblhaV::v0.10.pre () from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#4 0x00007ffff3869351 in metadata::creader::CrateLoader$Loader::load_crate::he9aa556ffd45c033OYae::v0.10.pre ()
from /usr/bin/../lib/librustc-0d83f02f-0.10-pre.so
#5 0x00007ffff62db6ab in ext::expand::load_extern_macros::h9b911bdebace7cc7aw::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#6 0x00007ffff62db384 in ext::expand::expand_view_item::hf01392e46aef41d3an::v0.10.pre () from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#7 0x00007ffff62c9434 in ext::expand::Folder$MacroExpander::fold_view_item::hc549b12bf2909253TxaX::v0.10.pre ()
from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#8 0x00007ffff62c93c8 in fold::noop_fold_mod::anon::expr_fn::aVaW ()
from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#9 0x00007ffff62c98d6 in iter::Map::do_map::hcd7f6781e31a9c951za2::v0.10.pre
() from /usr/bin/../lib/libsyntax-ebc61d75-0.10-pre.so
#10 0x00007ffff62c9818 in iter::Iterator$Map::next::h9083bbf0fab46094r6a1::v0.10
</code></pre></div> | <h2 dir="auto">Updated Bug Report</h2>
<p dir="auto">We do not provide enough user feedback explaining why a type is non-copyable. The error messages just say "error: copying a value of non-copyable type <code class="notranslate">Type</code>"</p>
<p dir="auto">Things have gotten a bit better since this bug was filed, in part because our story has changed somewhat (we no longer implicitly copy vectors/strings; we no longer have <code class="notranslate">@fn</code>), but we still do not have great user feedback, particularly with respect to explaining <em>how</em> a type ended up being put into the "non-copyable" bucket.</p>
<h2 dir="auto">Sample Code Enumerating Non-copyable Cases</h2>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Issue 2634
// Better explanations for why non-implicitly copyable things are that way.
use NC = std::util::NonCopyable;
use NonCopyExamples::*;
mod NonCopyExamples {
use NC = std::util::NonCopyable;
enum Void {}
pub struct S { a: int, nc: NC }
pub struct T { a: int, own: ~int }
pub struct U<'self> { a: int, mu: &'self mut int }
pub struct V { a: int }
impl Drop for V { fn drop(&mut self) { } }
pub struct W<'self> { a: int, fun: &'self fn () }
pub struct X { a: int, oyvey: Option<Void> } // (strcat: maybe bug)
}
static mut global_u : int = 3;
fn fun() { println("Hello World"); }
fn construct() -> (S,T,U,V,W,X) {
let s = S{ a: 1, nc: NC };
let t = T{ a: 2, own: ~2 };
let u = unsafe { U{ a: 3, mu: &mut global_u } };
let v = V{ a: 4 };
let w = W{ a: 5, fun: fun };
let x = X{ a: 6, oyvey: None };
(s,t,u,v,w,x)
}
fn g<A>(a: A) { println!("{:?}", a); }
#[cfg(not(no_funcall_twice))]
fn funcall_twice() {
use NonCopyExamples::*;
let (s,t,u,v,w,x) = construct();
g(s); g(s);
g(t); g(t);
g(u); g(u);
g(v); g(v);
g(w); g(w);
g(x); g(x);
}
#[cfg(no_funcall_twice)] fn funcall_twice() { }
#[cfg(not(no_assign))]
fn assign() {
use NonCopyExamples::*;
let (s,t,u,v,w,x) = construct();
let s_1 = s; let s_2 = s;
let t_1 = t; let t_2 = t;
let u_1 = u; let u_2 = u;
let v_1 = v; let v_2 = v;
let w_1 = w; let w_2 = w;
let x_1 = x; let x_2 = x;
}
#[cfg(no_assign)] fn assign() { }
#[cfg(not(no_repeat))]
fn repeat() {
use NonCopyExamples::*;
let (s,t,u,v,w,x) = construct();
let ss = [s, ..2];
let tt = [t, ..2];
let uu = [u, ..2];
let vv = [v, ..2];
let ww = [w, ..2];
let xx = [x, ..2];
}
#[cfg(no_repeat)] fn repeat() { }
fn main() {
funcall_twice();
assign();
repeat();
}
"><pre class="notranslate"><span class="pl-c">// Issue 2634</span>
<span class="pl-c">// Better explanations for why non-implicitly copyable things are that way.</span>
<span class="pl-k">use</span> <span class="pl-v">NC</span> = std<span class="pl-kos">::</span>util<span class="pl-kos">::</span><span class="pl-v">NonCopyable</span><span class="pl-kos">;</span>
<span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>
<span class="pl-k">mod</span> <span class="pl-v">NonCopyExamples</span> <span class="pl-kos">{</span>
<span class="pl-k">use</span> <span class="pl-v">NC</span> = std<span class="pl-kos">::</span>util<span class="pl-kos">::</span><span class="pl-v">NonCopyable</span><span class="pl-kos">;</span>
<span class="pl-k">enum</span> <span class="pl-smi">Void</span> <span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">S</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">nc</span><span class="pl-kos">:</span> <span class="pl-smi">NC</span> <span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">T</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">own</span><span class="pl-kos">:</span> ~<span class="pl-smi">int</span> <span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">U</span><span class="pl-kos"><</span><span class="pl-c1">'</span><span class="pl-ent">self</span><span class="pl-kos">></span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">mu</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-c1">'</span><span class="pl-ent">self</span> <span class="pl-k">mut</span> <span class="pl-smi">int</span> <span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">V</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span> <span class="pl-kos">}</span>
<span class="pl-k">impl</span> <span class="pl-smi">Drop</span> <span class="pl-k">for</span> <span class="pl-smi">V</span> <span class="pl-kos">{</span> <span class="pl-k">fn</span> <span class="pl-en">drop</span><span class="pl-kos">(</span><span class="pl-c1">&</span><span class="pl-k">mut</span> <span class="pl-smi">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span> <span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">W</span><span class="pl-kos"><</span><span class="pl-c1">'</span><span class="pl-ent">self</span><span class="pl-kos">></span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">fun</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-c1">'</span><span class="pl-ent">self</span> <span class="pl-k">fn</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">}</span>
<span class="pl-k">pub</span> <span class="pl-k">struct</span> <span class="pl-smi">X</span> <span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-smi">int</span><span class="pl-kos">,</span> <span class="pl-c1">oyvey</span><span class="pl-kos">:</span> <span class="pl-smi">Option</span><span class="pl-kos"><</span><span class="pl-smi">Void</span><span class="pl-kos">></span> <span class="pl-kos">}</span> <span class="pl-c">// (strcat: maybe bug)</span>
<span class="pl-kos">}</span>
<span class="pl-k">static</span> <span class="pl-k">mut</span> global_u <span class="pl-kos">:</span> <span class="pl-smi">int</span> = <span class="pl-c1">3</span><span class="pl-kos">;</span>
<span class="pl-k">fn</span> <span class="pl-en">fun</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-kos">(</span><span class="pl-s">"Hello World"</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span> -> <span class="pl-kos">(</span><span class="pl-smi">S</span><span class="pl-kos">,</span><span class="pl-smi">T</span><span class="pl-kos">,</span><span class="pl-smi">U</span><span class="pl-kos">,</span><span class="pl-smi">V</span><span class="pl-kos">,</span><span class="pl-smi">W</span><span class="pl-kos">,</span><span class="pl-smi">X</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">let</span> s = <span class="pl-smi">S</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">nc</span><span class="pl-kos">:</span> <span class="pl-v">NC</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> t = <span class="pl-smi">T</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">own</span><span class="pl-kos">:</span> ~<span class="pl-c1">2</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> u = <span class="pl-k">unsafe</span> <span class="pl-kos">{</span> <span class="pl-smi">U</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">mu</span><span class="pl-kos">:</span> <span class="pl-c1">&</span><span class="pl-k">mut</span> global_u <span class="pl-kos">}</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> v = <span class="pl-smi">V</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">4</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> w = <span class="pl-smi">W</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-c1">fun</span><span class="pl-kos">:</span> fun <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> x = <span class="pl-smi">X</span><span class="pl-kos">{</span> <span class="pl-c1">a</span><span class="pl-kos">:</span> <span class="pl-c1">6</span><span class="pl-kos">,</span> <span class="pl-c1">oyvey</span><span class="pl-kos">:</span> <span class="pl-v">None</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">g</span><span class="pl-kos"><</span><span class="pl-smi">A</span><span class="pl-kos">></span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">:</span> <span class="pl-smi">A</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">println</span><span class="pl-en">!</span><span class="pl-kos">(</span><span class="pl-s">"{:?}"</span>, a<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>not<span class="pl-kos">(</span>no_funcall_twice<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">funcall_twice</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span> = <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">g</span><span class="pl-kos">(</span>s<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>s<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">g</span><span class="pl-kos">(</span>t<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>t<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">g</span><span class="pl-kos">(</span>u<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>u<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">g</span><span class="pl-kos">(</span>v<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>v<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">g</span><span class="pl-kos">(</span>w<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>w<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">g</span><span class="pl-kos">(</span>x<span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-en">g</span><span class="pl-kos">(</span>x<span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>no_funcall_twice<span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">fn</span> <span class="pl-en">funcall_twice</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>not<span class="pl-kos">(</span>no_assign<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span> = <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> s_1 = s<span class="pl-kos">;</span> <span class="pl-k">let</span> s_2 = s<span class="pl-kos">;</span>
<span class="pl-k">let</span> t_1 = t<span class="pl-kos">;</span> <span class="pl-k">let</span> t_2 = t<span class="pl-kos">;</span>
<span class="pl-k">let</span> u_1 = u<span class="pl-kos">;</span> <span class="pl-k">let</span> u_2 = u<span class="pl-kos">;</span>
<span class="pl-k">let</span> v_1 = v<span class="pl-kos">;</span> <span class="pl-k">let</span> v_2 = v<span class="pl-kos">;</span>
<span class="pl-k">let</span> w_1 = w<span class="pl-kos">;</span> <span class="pl-k">let</span> w_2 = w<span class="pl-kos">;</span>
<span class="pl-k">let</span> x_1 = x<span class="pl-kos">;</span> <span class="pl-k">let</span> x_2 = x<span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>no_assign<span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">fn</span> <span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>not<span class="pl-kos">(</span>no_repeat<span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">]</span></span>
<span class="pl-k">fn</span> <span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">use</span> <span class="pl-v">NonCopyExamples</span><span class="pl-kos">::</span><span class="pl-c1">*</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> <span class="pl-kos">(</span>s<span class="pl-kos">,</span>t<span class="pl-kos">,</span>u<span class="pl-kos">,</span>v<span class="pl-kos">,</span>w<span class="pl-kos">,</span>x<span class="pl-kos">)</span> = <span class="pl-en">construct</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> ss = <span class="pl-kos">[</span>s<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> tt = <span class="pl-kos">[</span>t<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> uu = <span class="pl-kos">[</span>u<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> vv = <span class="pl-kos">[</span>v<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> ww = <span class="pl-kos">[</span>w<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">let</span> xx = <span class="pl-kos">[</span>x<span class="pl-kos">,</span> ..<span class="pl-c1">2</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>
<span class="pl-c1">#<span class="pl-kos">[</span>cfg<span class="pl-kos">(</span>no_repeat<span class="pl-kos">)</span><span class="pl-kos">]</span></span> <span class="pl-k">fn</span> <span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-kos">}</span>
<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-en">funcall_twice</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">assign</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">repeat</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h2 dir="auto">Original Bug Report follows</h2>
<p dir="auto">I think the error messages would be clearer if they were along these lines:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="foo.rs:10: warning: copying a value of type '~str' requires memory allocation
foo.rs:10: note: suggest use of 'move' to avoid this copy
foo.rs:20: warning: copying a value of type `BlockContext` duplicates mutable fields
foo.rs:20: note: use 'copy' if the copy is desired
foo.rs:30: warning: call to 'f' might copy values of type '~str', incurring memory allocation
foo.rs:30: note: see 'copy' interface bound here
foo.rs:40: warning: call to 'g' might copy values of type '~BlockContext', incurring memory allocation and duplicating mutable fields
foo.rs:40: note: see 'copy' interface bound here"><pre class="notranslate"><code class="notranslate">foo.rs:10: warning: copying a value of type '~str' requires memory allocation
foo.rs:10: note: suggest use of 'move' to avoid this copy
foo.rs:20: warning: copying a value of type `BlockContext` duplicates mutable fields
foo.rs:20: note: use 'copy' if the copy is desired
foo.rs:30: warning: call to 'f' might copy values of type '~str', incurring memory allocation
foo.rs:30: note: see 'copy' interface bound here
foo.rs:40: warning: call to 'g' might copy values of type '~BlockContext', incurring memory allocation and duplicating mutable fields
foo.rs:40: note: see 'copy' interface bound here
</code></pre></div> | 0 |
<p dir="auto">Loving Vue JS - great job!</p>
<p dir="auto">I have a weird problem though with FastClick when being used with it. Events are firing, I';m listening for "click" accurately, Vue JS is not bothered by it, until I try and set the data from the event to an object that is data-bound. It's almost like it doesn't update the rendering of the view for that binding.</p>
<p dir="auto">The full use-case is I have an exercise selector component, where you select the exercise and then that exercise gets used in an input element on the previous screen. This all works fine until I use FastClick, and again the issue appears to be just the data-binding bit. Everything else is working fine.</p>
<p dir="auto">Quite odd.</p>
<p dir="auto">What's even weirder is that if I duplicate that exercise that has the selected exercise in it, then it shows up in the duplicated exercise in the array, but not the original. It's like the original isn't being rendered or hasn't detected a change.</p> | <h3 dir="auto">Version</h3>
<p dir="auto">2.2.6</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="http://codepen.io/anon/pen/WGyrdz" rel="nofollow">http://codepen.io/anon/pen/WGyrdz</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Open the codepen with MS Edge devtools open</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">No warning. When you execute <code class="notranslate">el.outerHTML</code> within vuejs while the element is being mounted, you will see that the class attribute is duplicated.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">A warning (duplicate attribute class)</p>
<hr>
<p dir="auto">This has been dealt with in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="182705551" data-permission-text="Title is private" data-url="https://github.com/vuejs/vue/issues/3929" data-hovercard-type="issue" data-hovercard-url="/vuejs/vue/issues/3929/hovercard" href="https://github.com/vuejs/vue/issues/3929">#3929</a> already but it seems that MS Edge 38 is not correctly handled.</p> | 0 |
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="body.modal-open,
.modal-open .navbar-fixed-top,
.modal-open .navbar-fixed-bottom {
margin-right: 15px;
margin-right: 0: // fix
}"><pre class="notranslate"><code class="notranslate">body.modal-open,
.modal-open .navbar-fixed-top,
.modal-open .navbar-fixed-bottom {
margin-right: 15px;
margin-right: 0: // fix
}
</code></pre></div>
<p dir="auto">In my individual use case, and over on the (getbootstrap.com)[http://getbootstrap.com/javascript/#modals] docs, the above CSS is causing an unnecessary margin change on body and fixed nav bars. Removing it or setting it to 0 fixes the issue.</p> | <p dir="auto">When launching the modal component (<a href="http://getbootstrap.com/javascript/#modals" rel="nofollow">http://getbootstrap.com/javascript/#modals</a>) the entire content will slightly move to the left on mac OS (haven't tried it on windows yet). With the active modal the scrollbar seem to disappear, while the content width still changes.</p>
<p dir="auto">You can observer the problem on the bootstrap page</p> | 1 |
<h3 dir="auto">System Info</h3>
<p dir="auto">transformers version: 4.17.0<br>
Python version: 3.7.0<br>
torch version: 1.10.1</p>
<h3 dir="auto">Who can help?</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Information</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The official example scripts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own modified scripts</li>
</ul>
<h3 dir="auto">Tasks</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> An officially supported task in the <code class="notranslate">examples</code> folder (such as GLUE/SQuAD, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<p dir="auto">CLIP(<a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text">https://github.com/huggingface/transformers/tree/main/examples/pytorch/contrastive-image-text</a>).</p>
<p dir="auto">I have implemented a Dataset to train, but i have found that after each epoch the training loss will drop suddenly. The Dataset overrides three methods(<strong>init</strong>, <strong>getitem</strong> and <strong>len</strong>) and i couldn't figure out the reason for the above phenomenon.</p>
<p dir="auto">I think the data is shuffled properly(checked) and the learning_rate drops smoothly(observed).<br>
I would appreciate it if you could afford time to help me.</p>
<p dir="auto">The picture is drawn according to the trainer_state.json</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/27990344/186142292-6c3d4a56-9c9e-45b2-a139-1668b995e59b.png"><img width="1108" alt="image" src="https://user-images.githubusercontent.com/27990344/186142292-6c3d4a56-9c9e-45b2-a139-1668b995e59b.png" style="max-width: 100%;"></a></p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Figure out the reason.</p> | <h3 dir="auto">System Info</h3>
<ul dir="auto">
<li><code class="notranslate">transformers</code> version: 4.27.0.dev0</li>
<li>Platform: Windows-10-10.0.19044-SP0</li>
<li>Python version: 3.10.4</li>
<li>Huggingface_hub version: 0.12.0</li>
<li>PyTorch version (GPU?): 1.13.1+cpu (False)</li>
<li>Tensorflow version (GPU?): not installed (NA)</li>
<li>Flax version (CPU?/GPU?/TPU?): not installed (NA)</li>
<li>Jax version: not installed</li>
<li>JaxLib version: not installed</li>
<li>Using GPU in script?: No</li>
<li>Using distributed or parallel set-up in script?: No</li>
</ul>
<h3 dir="auto">Who can help?</h3>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gante/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gante">@gante</a> I believe.</p>
<h3 dir="auto">Information</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> The official example scripts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> My own modified scripts</li>
</ul>
<h3 dir="auto">Tasks</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> An officially supported task in the <code class="notranslate">examples</code> folder (such as GLUE/SQuAD, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> My own task or dataset (give details below)</li>
</ul>
<h3 dir="auto">Reproduction</h3>
<ol dir="auto">
<li>Install transformers</li>
<li>Run the following script</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from transformers import pipeline
summarizer = pipeline("summarization", max_new_tokens=50)
prompt = "text to summarize"
summary = summarizer(prompt)"><pre class="notranslate"><code class="notranslate">from transformers import pipeline
summarizer = pipeline("summarization", max_new_tokens=50)
prompt = "text to summarize"
summary = summarizer(prompt)
</code></pre></div>
<ol start="3" dir="auto">
<li>It crashes with the following error:</li>
</ol>
<blockquote>
<p dir="auto">ValueError: Both <code class="notranslate">max_new_tokens</code> and <code class="notranslate">max_length</code> have been set but they serve the same purpose -- setting a limit to the generated output length. Remove one of those arguments. Please refer to the documentation for more information. (<a href="https://huggingface.co/docs/transformers/main/en/main_classes/text_generation" rel="nofollow">https://huggingface.co/docs/transformers/main/en/main_classes/text_generation</a>)</p>
</blockquote>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Expected behavior is that the script should run. I only set <code class="notranslate">max_new_tokens</code> and not <code class="notranslate">max_length</code>.<br>
This might seem like a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1510361311" data-permission-text="Title is private" data-url="https://github.com/huggingface/transformers/issues/20894" data-hovercard-type="issue" data-hovercard-url="/huggingface/transformers/issues/20894/hovercard" href="https://github.com/huggingface/transformers/issues/20894">#20894</a> but the issue persists even after installing the latest version of transformers with the fix for that issue.</p> | 0 |
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<p dir="auto">These seem related maybe?</p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="241313704" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/2499" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/2499/hovercard" href="https://github.com/vercel/next.js/issues/2499">#2499</a></li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="234454327" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/2197" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/2197/hovercard" href="https://github.com/vercel/next.js/issues/2197">#2197</a></li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">I should be able to add a <code class="notranslate">.babelrc</code> with a custom plugin and the <code class="notranslate">next/babel</code> preset and everything should work without having to include the <code class="notranslate">env</code> preset.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">When doing this I'm getting the following error when running tests (with Jest):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="~/Developer/glamorous-with-next (pr/fix-config)
😇 $ npm run test --silent
FAIL components/__tests__/toggle-button.js
● Test suite failed to run
/Users/kdodds/Developer/glamorous-with-next/components/__tests__/toggle-button.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){var _jsxFileName = '/Users/kdodds/Developer/glamorous-with-next/components/__tests__/toggle-button.js';import React from 'react';
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.908s
Ran all test suites."><pre class="notranslate"><code class="notranslate">~/Developer/glamorous-with-next (pr/fix-config)
😇 $ npm run test --silent
FAIL components/__tests__/toggle-button.js
● Test suite failed to run
/Users/kdodds/Developer/glamorous-with-next/components/__tests__/toggle-button.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){var _jsxFileName = '/Users/kdodds/Developer/glamorous-with-next/components/__tests__/toggle-button.js';import React from 'react';
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 0.908s
Ran all test suites.
</code></pre></div>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto">Run the following script (from a directory of your choosing):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="mkdir next-preset-issue
cd next-preset-issue
npm init -y
npm install next react react-dom jest babel-preset-env --save
echo "{\"presets\": [\"next/babel\"]}" > .babelrc
echo "import fs from 'fs';test('works', () => {});" > index.test.js
./node_modules/.bin/jest
echo "{\"presets\": [\"next/babel\", \"env\"]}" > .babelrc
./node_modules/.bin/jest"><pre class="notranslate"><code class="notranslate">mkdir next-preset-issue
cd next-preset-issue
npm init -y
npm install next react react-dom jest babel-preset-env --save
echo "{\"presets\": [\"next/babel\"]}" > .babelrc
echo "import fs from 'fs';test('works', () => {});" > index.test.js
./node_modules/.bin/jest
echo "{\"presets\": [\"next/babel\", \"env\"]}" > .babelrc
./node_modules/.bin/jest
</code></pre></div>
<p dir="auto">You'll notice that the first invocation of <code class="notranslate">jest</code> will fail with the error above, but the second (after adding the <code class="notranslate">env</code> preset has been added) will succeed.</p>
<h2 dir="auto">Context</h2>
<p dir="auto">I'm making a course for glamorous and I want to show how to do server rendering and testing. Next.js is the obvious choice, but I want to make sure I'm doing things properly and no more than necessary. If it's necessary to add the <code class="notranslate">env</code> preset that's fine, but I want to make sure that I understand why it's necessary.</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>v3.2.1</td>
</tr>
<tr>
<td>node</td>
<td>v8.3.0</td>
</tr>
<tr>
<td>OS</td>
<td>macOS</td>
</tr>
<tr>
<td>browser</td>
<td>N/A</td>
</tr>
</tbody>
</table>
<p dir="auto">Thanks!</p> | <p dir="auto">I am developing a nextjs app that runs on google cloud functions. Cloud functions requires node v.6.14.0 and the local function emulator needs v.6.14.0 as well. Since I upgraded to next 6, I am getting the following error when running the next dev server:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/project/node_modules/update-check/index.js:18
const getFile = async (details, distTag) => {
^
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Server._callee$ (/project/node_modules/next/dist/server/index.js:194:34)
...
"><pre class="notranslate"><code class="notranslate">/project/node_modules/update-check/index.js:18
const getFile = async (details, distTag) => {
^
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Server._callee$ (/project/node_modules/next/dist/server/index.js:194:34)
...
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<p dir="auto">This is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="319796448" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/4258" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/4258/hovercard" href="https://github.com/vercel/next.js/issues/4258">#4258</a>, but this has been closed because they could resolve the issue by updating the node version. However, I would like to keep the node version at v6.14 because I would like to keep my dev environment as close as possible to google cloud functions.</p>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Should work as expected, like in next v5.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Throws the error described above and does not start up the dev server.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Use Node v.6.14.0</li>
<li>Install Dependencies</li>
<li>run next</li>
</ol>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>6.0.0</td>
</tr>
<tr>
<td>node</td>
<td>6.14.0</td>
</tr>
<tr>
<td>OS</td>
<td>Arch Linux</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto">Hi,</p>
<p dir="auto"><strong>Version</strong>: VS 2015 / TS 1.5.4</p>
<p dir="auto">To reproduce:</p>
<ul dir="auto">
<li>
<p dir="auto">Set <code class="notranslate">"Redirect JavaScript output to directory"</code> to say <code class="notranslate">bin</code>.</p>
</li>
<li>
<p dir="auto">Set <code class="notranslate">"Generate declarations files"</code>.</p>
</li>
<li>
<p dir="auto">Set <code class="notranslate">"Compile on save"</code>.</p>
</li>
<li>
<p dir="auto">Add file <code class="notranslate">_references.ts</code> to the project, with content</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// <reference path='../../foo/bar1/bin/bar1.d.ts' />
/// <reference path='../../foo/bar2/bin/bar2.d.ts' />"><pre class="notranslate">/// <<span class="pl-ent">reference</span> <span class="pl-e">path</span>=<span class="pl-s"><span class="pl-pds">'</span>../../foo/bar1/bin/bar1.d.ts<span class="pl-pds">'</span></span> />
/// <<span class="pl-ent">reference</span> <span class="pl-e">path</span>=<span class="pl-s"><span class="pl-pds">'</span>../../foo/bar2/bin/bar2.d.ts<span class="pl-pds">'</span></span> /></pre></div>
</li>
<li>
<p dir="auto">Build the project and check the output directory. The content of <code class="notranslate">_references.d.ts</code> should be</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// <reference path="../../../foo/bar1/bin/bar1.d.ts' />
/// <reference path="../../../foo/bar1/bin/bar2.d.ts' />"><pre class="notranslate">/// <<span class="pl-ent">reference</span> <span class="pl-e">path</span>=<span class="pl-s"><span class="pl-pds">"</span>../../../foo/bar1/bin/bar1.d.ts' /></span>
<span class="pl-s">/// <reference path=<span class="pl-pds">"</span></span>../../../foo/bar1/bin/bar2.d.ts<span class="pl-s"><span class="pl-pds">'</span> /></span></pre></div>
</li>
<li>
<p dir="auto">Now modify one file in the project and trigger <code class="notranslate">compile-on-save</code> by saving the file. Now the content of the same file should have changed to</p>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/// <reference path="d:/x/y/z/foo/bar1/bin/bar1.d.ts' />
/// <reference path="d:/x/y/z/foo/bar1/bin/bar2.d.ts' />"><pre class="notranslate">/// <<span class="pl-ent">reference</span> <span class="pl-e">path</span>=<span class="pl-s"><span class="pl-pds">"</span>d:/x/y/z/foo/bar1/bin/bar1.d.ts' /></span>
<span class="pl-s">/// <reference path=<span class="pl-pds">"</span></span>d:/x/y/z/foo/bar1/bin/bar2.d.ts<span class="pl-s"><span class="pl-pds">'</span> /></span></pre></div>
</li>
</ul>
<p dir="auto">This together with <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="99927238" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/4245" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/4245/hovercard" href="https://github.com/microsoft/TypeScript/issues/4245">#4245</a> appears to be a regression introduced in the fix for <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="96181777" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/3939" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/3939/hovercard" href="https://github.com/microsoft/TypeScript/issues/3939">#3939</a>.</p>
<p dir="auto">This is interfering with some systems we have in place.</p> | <p dir="auto">As reported by @licinioamendes in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="59102033" data-permission-text="Title is private" data-url="https://github.com/microsoft/TypeScript/issues/2152" data-hovercard-type="issue" data-hovercard-url="/microsoft/TypeScript/issues/2152/hovercard?comment_id=126757495&comment_type=issue_comment" href="https://github.com/microsoft/TypeScript/issues/2152#issuecomment-126757495">#2152 (comment)</a>:</p>
<blockquote>
<p dir="auto">Would be nice allow <a href="https://msdn.microsoft.com/en-us/library/c02as0cs.aspx" rel="nofollow">VS macros for build commands</a>.</p>
<p dir="auto">The result would be something like <code class="notranslate">$(ProjectDir)outputDirectoryPath</code> on textbox.</p>
</blockquote>
<p dir="auto">Also note that this is working in VS2013 but not in VS2015.</p> | 1 |
<p dir="auto">I have a login page, after login web route to page index with <code class="notranslate">Router.push('/')</code>. In index page I have dynamic import some component depend on <code class="notranslate">query.page</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import * as React from 'react'
import * as withRedux from 'next-redux-wrapper'
import dynamic from 'next/dynamic'
import Layout from '../src/components/share/Layout'
import configStore from '../src/store/configStore.dev'
export interface Props {
page: string
pageProps: any
}
export interface State {}
interface DynamicBundleProps {
page: string
pageProps: any
}
const DynamicBundle = dynamic<DynamicBundleProps, {}>({
modules: props => {
const components: any = {}
console.log(props.page)
switch (props.page) {
case '/lists/create': {
components.Page = import('./lists/create')
break
}
case '/lists/manage': {
components.Page = import('./lists/manage')
break
}
case '/templates/create': {
components.Page = import('./templates/create')
break
}
case '/templates/manage': {
components.Page = import('./templates/manage')
break
}
case '/campaigns/create': {
components.Page = import('./campaigns/create')
break
}
case '/campaigns/manage': {
components.Page = import('./campaigns/manage')
break
}
case '/settings': {
components.Page = import('./settings')
break
}
case '/': {
components.Page = import('../src/components/Dashboard')
}
default: {
components.Page = import('../src/components/Dashboard')
}
}
console.log(components)
return components
},
render: (props, { Page }) => {
console.log(Page)
return (
<React.Fragment>
<Page {...props.pageProps} />
</React.Fragment>
)
},
} as any)
class IndexPage extends React.Component<Props, State> {
constructor(props) {
super(props)
}
static async getInitialProps(context) {
const { page, ...pageProps } = context.query
return { page, pageProps }
}
render() {
let { page, pageProps } = this.props
return (
<Layout>
<DynamicBundle page={page} pageProps={pageProps} />
</Layout>
)
}
}
export default withRedux(configStore)(IndexPage)
"><pre class="notranslate"><code class="notranslate">import * as React from 'react'
import * as withRedux from 'next-redux-wrapper'
import dynamic from 'next/dynamic'
import Layout from '../src/components/share/Layout'
import configStore from '../src/store/configStore.dev'
export interface Props {
page: string
pageProps: any
}
export interface State {}
interface DynamicBundleProps {
page: string
pageProps: any
}
const DynamicBundle = dynamic<DynamicBundleProps, {}>({
modules: props => {
const components: any = {}
console.log(props.page)
switch (props.page) {
case '/lists/create': {
components.Page = import('./lists/create')
break
}
case '/lists/manage': {
components.Page = import('./lists/manage')
break
}
case '/templates/create': {
components.Page = import('./templates/create')
break
}
case '/templates/manage': {
components.Page = import('./templates/manage')
break
}
case '/campaigns/create': {
components.Page = import('./campaigns/create')
break
}
case '/campaigns/manage': {
components.Page = import('./campaigns/manage')
break
}
case '/settings': {
components.Page = import('./settings')
break
}
case '/': {
components.Page = import('../src/components/Dashboard')
}
default: {
components.Page = import('../src/components/Dashboard')
}
}
console.log(components)
return components
},
render: (props, { Page }) => {
console.log(Page)
return (
<React.Fragment>
<Page {...props.pageProps} />
</React.Fragment>
)
},
} as any)
class IndexPage extends React.Component<Props, State> {
constructor(props) {
super(props)
}
static async getInitialProps(context) {
const { page, ...pageProps } = context.query
return { page, pageProps }
}
render() {
let { page, pageProps } = this.props
return (
<Layout>
<DynamicBundle page={page} pageProps={pageProps} />
</Layout>
)
}
}
export default withRedux(configStore)(IndexPage)
</code></pre></div>
<p dir="auto">But when I route to page index the first time after login, it build the page and then throw error before this even run, so no page is show</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" render: (props, { Page }) => {
console.log(Page)
return (
<React.Fragment>
<Page {...props.pageProps} />
</React.Fragment>
)
}"><pre class="notranslate"><code class="notranslate"> render: (props, { Page }) => {
console.log(Page)
return (
<React.Fragment>
<Page {...props.pageProps} />
</React.Fragment>
)
}
</code></pre></div>
<p dir="auto">This is the error<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/12032550/38983462-9a2c9b72-43ee-11e8-85f6-38fb5a5771c0.png"><img src="https://user-images.githubusercontent.com/12032550/38983462-9a2c9b72-43ee-11e8-85f6-38fb5a5771c0.png" alt="nextjs_error" style="max-width: 100%;"></a></p>
<p dir="auto">This error only happen on the first page build and not happen when build out production code</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">No error and page show normal</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Throw error before render dynamic component</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<h2 dir="auto">Context</h2>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>^6.0.0-canary.3</td>
</tr>
<tr>
<td>node</td>
<td>9.1.0</td>
</tr>
<tr>
<td>OS</td>
<td>manjaro-linux</td>
</tr>
<tr>
<td>browser</td>
<td>chromium</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | <p dir="auto">When I use <code class="notranslate">injectGlobal</code> to inject global styles using styled-components in e.g. the <code class="notranslate">_documents.js</code> the resulting <code class="notranslate"><style></code> tag for global styles will be generated <em>below</em> the component's <code class="notranslate"><style></code> tag. Therefore global styles will override component styles. This should be turned around since global styles like e.g. normalize.css shouldn't override component styles.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">The <code class="notranslate"><style></code> tag for global styles should be generated before the <code class="notranslate"><style></code> tag of component styles</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">It's generated in the wrong order.</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto">Download this zip: <a href="https://github.com/zeit/next.js/files/1685672/example.zip">example.zip</a><br>
This example is based on the example with styled-components.<br>
Run <code class="notranslate">$ npm install</code> and open <code class="notranslate">localhost:3000</code>, then view the HTML source code.</p>
<p dir="auto">This proofes that non-local CSS isn't generated at the top:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8310677/35680830-ba11c6a8-075b-11e8-8649-1e8532c28d11.png"><img src="https://user-images.githubusercontent.com/8310677/35680830-ba11c6a8-075b-11e8-8649-1e8532c28d11.png" alt="topic" style="max-width: 100%;"></a></p>
<h2 dir="auto">Context</h2>
<p dir="auto">I'm trying to add normalize.css at the very top of the HTML file.</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.2.3</td>
</tr>
<tr>
<td>node</td>
<td>6.11.3</td>
</tr>
<tr>
<td>OS</td>
<td>Win 10</td>
</tr>
<tr>
<td>browser</td>
<td>FF 58</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto"><strong>Migrated issue, originally created by Ye Wang (<a href="https://github.com/ye">@ye</a>)</strong></p>
<p dir="auto">I am running into two issues with Union today using SQLAlchemy with MySQL.</p>
<p dir="auto">Here is the iPython session output.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [1]: from models.schedules import *
In [2]: from models.products import *
In [3]: from models.users import *
In [4]: query = db.session.query(Appointment)
In [5]: q_member = query.join(Schedule).join(User).filter(
User.last_name == 'Smith')
In [6]: q_practitioner = query.join(Product).join(User).filter(
User.last_name == 'Smith')
In [7]: q_member.count()
Out[7]: 135
In [8]: q_practitioner.count()
Out[8]: 277
In [9]: q_member.union(q_practitioner)
Out[9]: <sqlalchemy.orm.query.Query at 0x7f72307845f8>
In [10]: q_member.union(q_practitioner).count()
Out[10]: 388
In [11]: q_member.union(q_practitioner).scalar()
---------------------------------------------------------------------------
MultipleResultsFound Traceback (most recent call last)
<ipython-input-11-0456717d8d59> in <module>()
----> 1 q_member.union(q_practitioner).scalar()
/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/query.py in scalar(self)
2622 try:
-> 2623 ret = self.one()
2624 if not isinstance(ret, tuple):
2625 return ret
/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/query.py in one(self)
2599 else:
2600 raise orm_exc.MultipleResultsFound(
-> 2601 "Multiple rows were found for one()")
2602
2603 def scalar(self):
MultipleResultsFound: Multiple rows were found for one()
In [12]: sqlalchemy.__version__
Out[12]: '0.9.11'"><pre class="notranslate"><code class="notranslate">In [1]: from models.schedules import *
In [2]: from models.products import *
In [3]: from models.users import *
In [4]: query = db.session.query(Appointment)
In [5]: q_member = query.join(Schedule).join(User).filter(
User.last_name == 'Smith')
In [6]: q_practitioner = query.join(Product).join(User).filter(
User.last_name == 'Smith')
In [7]: q_member.count()
Out[7]: 135
In [8]: q_practitioner.count()
Out[8]: 277
In [9]: q_member.union(q_practitioner)
Out[9]: <sqlalchemy.orm.query.Query at 0x7f72307845f8>
In [10]: q_member.union(q_practitioner).count()
Out[10]: 388
In [11]: q_member.union(q_practitioner).scalar()
---------------------------------------------------------------------------
MultipleResultsFound Traceback (most recent call last)
<ipython-input-11-0456717d8d59> in <module>()
----> 1 q_member.union(q_practitioner).scalar()
/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/query.py in scalar(self)
2622 try:
-> 2623 ret = self.one()
2624 if not isinstance(ret, tuple):
2625 return ret
/usr/local/lib/python3.4/site-packages/sqlalchemy/orm/query.py in one(self)
2599 else:
2600 raise orm_exc.MultipleResultsFound(
-> 2601 "Multiple rows were found for one()")
2602
2603 def scalar(self):
MultipleResultsFound: Multiple rows were found for one()
In [12]: sqlalchemy.__version__
Out[12]: '0.9.11'
</code></pre></div>
<ol dir="auto">
<li>
<p dir="auto">The .union() call returns duplicated rows, as you can see above 135+277 > 388. This is violating MySQL's SELECT UNION statement syntax in that UNION DISTINCT is the default. (only UNION ALL allows duplicate rows) <a href="http://dev.mysql.com/doc/refman/5.6/en/union.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.6/en/union.html</a></p>
</li>
<li>
<p dir="auto">Calling .scalar() on a union'd query object gets MultipleResultsFound exception</p>
</li>
</ol> | <p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">The problem doesn't occurs using pymsqldb, but, pymssqldb has many problems with unicode :(<br>
When Lazy=True the problem doesn't occurs too !</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/495/mssql-orderby.patch">mssql-orderby.patch</a> | <a href="../wiki/imported_issue_attachments/495/test_orderby.py">test_orderby.py</a> | <a href="../wiki/imported_issue_attachments/495/monkeypatch_orderby.py">monkeypatch_orderby.py</a></p> | 0 |
<p dir="auto">Hi</p>
<p dir="auto">I am having the following issue when applying the variable set below:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ec2_security_groups_test:
- sg_name: test-grup
sg_description: test-group
vpc_id: "vpc-XXXXXX"
region: "{{ region }}"
sg_rules:
- proto: 50
from_port: -1
to_port: -1
cidr_ip: 12.12.12.12/32
- proto: 50
from_port: -1
to_port: -1
cidr_ip: 13.13.13.13/32
- proto: 50
from_port: -1
to_port: -1
group_name: test-group
"><pre class="notranslate"><code class="notranslate">ec2_security_groups_test:
- sg_name: test-grup
sg_description: test-group
vpc_id: "vpc-XXXXXX"
region: "{{ region }}"
sg_rules:
- proto: 50
from_port: -1
to_port: -1
cidr_ip: 12.12.12.12/32
- proto: 50
from_port: -1
to_port: -1
cidr_ip: 13.13.13.13/32
- proto: 50
from_port: -1
to_port: -1
group_name: test-group
</code></pre></div>
<p dir="auto">it will work on the 1st run, but on the second I will have:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="<Response><Errors><Error><Code>InvalidPermission.Duplicate</Code><Message>the specified rule "peer: 12.12.12.12/32, protocol: 50, ALLOW" already exists</Message></Error></Errors><RequestID>e890595b-9609-4c31-a611-87da7b5de7ae</RequestID></Response>
"><pre class="notranslate"><code class="notranslate"><Response><Errors><Error><Code>InvalidPermission.Duplicate</Code><Message>the specified rule "peer: 12.12.12.12/32, protocol: 50, ALLOW" already exists</Message></Error></Errors><RequestID>e890595b-9609-4c31-a611-87da7b5de7ae</RequestID></Response>
</code></pre></div>
<p dir="auto">I have tried specifying Ports, also "-1".. Nothing seems to work.<br>
If I say TCP or UDP it works fine, but when I specify a numeric port as above I got the issue:</p>
<p dir="auto">Any possible workaround?</p> | <h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.1.0
config file =
configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.1.0
config file =
configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Amazon Linux 4.4.11-23.53.amzn1.x86_64</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">In v2.1.1.0, the add_host module will no longer pick up group_vars if the group name includes a forward slash. This worked in v2.1.0.0 and v2.0.0.1.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Create a simple playbook structure as follows:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="group_vars/dir1/foo.yml
play.yml"><pre class="notranslate"><code class="notranslate">group_vars/dir1/foo.yml
play.yml
</code></pre></div>
<p dir="auto">Run <code class="notranslate">ansible-playbook play.yml</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#######
# play.yml
#######
- hosts: localhost
gather_facts: no
tasks:
- add_host:
name: '{{inventory_hostname}}'
groups: 'dir1/foo'
- debug: var=bar"><pre class="notranslate"><code class="notranslate">#######
# play.yml
#######
- hosts: localhost
gather_facts: no
tasks:
- add_host:
name: '{{inventory_hostname}}'
groups: 'dir1/foo'
- debug: var=bar
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#######
# foo.yml
#######
bar: 'abc'"><pre class="notranslate"><code class="notranslate">#######
# foo.yml
#######
bar: 'abc'
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">With this playbook, we would expect to see the value of bar printed.<br>
These are the results when running Ansible v2.1.0.0:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook play.yml -vvvv
No config file found; using defaults
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
Loaded callback default of type stdout, v2.0
PLAYBOOK: play.yml *************************************************************
1 plays in play.yml
PLAY [localhost] ***************************************************************
TASK [add_host] ****************************************************************
task path: /tmp/test/play.yml:4
creating host via 'add_host': hostname=localhost
changed: [localhost] => {"add_host": {"groups": ["dir1/foo"], "host_name": "localhost", "host_vars": {}}, "changed": true, "invocation": {"module_args": {"groups": "dir1/foo", "name": "localhost"}, "module_name": "add_host"}}
TASK [debug] *******************************************************************
task path: /tmp/test/play.yml:7
ok: [localhost] => {
"bar": "abc"
}
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0"><pre class="notranslate"><code class="notranslate">ansible-playbook play.yml -vvvv
No config file found; using defaults
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
Loaded callback default of type stdout, v2.0
PLAYBOOK: play.yml *************************************************************
1 plays in play.yml
PLAY [localhost] ***************************************************************
TASK [add_host] ****************************************************************
task path: /tmp/test/play.yml:4
creating host via 'add_host': hostname=localhost
changed: [localhost] => {"add_host": {"groups": ["dir1/foo"], "host_name": "localhost", "host_vars": {}}, "changed": true, "invocation": {"module_args": {"groups": "dir1/foo", "name": "localhost"}, "module_name": "add_host"}}
TASK [debug] *******************************************************************
task path: /tmp/test/play.yml:7
ok: [localhost] => {
"bar": "abc"
}
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">In v2.1.1.0, bar is undefined, implying the group_vars/dir1/foo.yml is not being included.<br>
This is what happens when running the same playbook using v2.1.1.0</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible-playbook play.yml -vvvv
No config file found; using defaults
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
Loaded callback default of type stdout, v2.0
PLAYBOOK: play.yml *************************************************************
1 plays in play.yml
PLAY [localhost] ***************************************************************
TASK [add_host] ****************************************************************
task path: /tmp/test/play.yml:4
creating host via 'add_host': hostname=localhost
changed: [localhost] => {"add_host": {"groups": ["dir1/foo"], "host_name": "localhost", "host_vars": {}}, "changed": true, "invocation": {"module_args": {"groups": "dir1/foo", "name": "localhost"}, "module_name": "add_host"}}
TASK [debug] *******************************************************************
task path: /tmp/test/play.yml:7
ok: [localhost] => {
"bar": "VARIABLE IS NOT DEFINED!"
}
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0"><pre class="notranslate"><code class="notranslate">ansible-playbook play.yml -vvvv
No config file found; using defaults
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
Loaded callback default of type stdout, v2.0
PLAYBOOK: play.yml *************************************************************
1 plays in play.yml
PLAY [localhost] ***************************************************************
TASK [add_host] ****************************************************************
task path: /tmp/test/play.yml:4
creating host via 'add_host': hostname=localhost
changed: [localhost] => {"add_host": {"groups": ["dir1/foo"], "host_name": "localhost", "host_vars": {}}, "changed": true, "invocation": {"module_args": {"groups": "dir1/foo", "name": "localhost"}, "module_name": "add_host"}}
TASK [debug] *******************************************************************
task path: /tmp/test/play.yml:7
ok: [localhost] => {
"bar": "VARIABLE IS NOT DEFINED!"
}
PLAY RECAP *********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0
</code></pre></div> | 0 |
<p dir="auto"><strong>Describe the bug</strong></p>
<p dir="auto">In version 131, fbx files are loaded without textures.</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>extract attached file</li>
<li>run index.html</li>
</ol>
<p dir="auto">reproduce file is below</p>
<p dir="auto"><em><strong>Code</strong></em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let character = await new Promise((res,rej)=>{
new FBXLoader().load('ArcherRi01.FBX', newChar=>res(newChar));
});"><pre class="notranslate"><code class="notranslate">let character = await new Promise((res,rej)=>{
new FBXLoader().load('ArcherRi01.FBX', newChar=>res(newChar));
});
</code></pre></div>
<p dir="auto"><em><strong>Live example</strong></em></p>
<p dir="auto">nothing</p>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">loaded without texture</p>
<p dir="auto"><strong>Screenshots</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/88191844/129261856-90dced3a-4de0-4170-a704-db57ea679e13.png"><img src="https://user-images.githubusercontent.com/88191844/129261856-90dced3a-4de0-4170-a704-db57ea679e13.png" alt="qqqq11212" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Platform:</strong></p>
<ul dir="auto">
<li>Device: [Desktop, Mobile]</li>
<li>OS: [Windows, MacOS, Linux, Android, iOS]</li>
<li>Browser: [Chrome, Firefox, Safari, Edge]</li>
<li>Three.js version: [dev, r131]</li>
</ul> | <p dir="auto">FBXLoader doesn't load textures,<br>
I tried swapping out the threejs lib in the node modules to an older one (a month old) and it works,<br>
so some update happened which either broke it or changed the way it works?</p>
<p dir="auto">Import:<br>
<code class="notranslate">import { FBXLoader } from "three/examples/jsm/loaders/FBXLoader";</code></p>
<p dir="auto">Code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" loadFBXModel(path, modelFile, pos = [0, 0, 0], size = 0.1) {
const loader = new FBXLoader();
loader.setPath(path);
loader.load(modelFile, (fbx) => {
fbx.scale.setScalar(size);
fbx.traverse((c) => {
c.castShadow = true;
});
fbx.position.copy(new THREE.Vector3(...pos));
this._scene.add(fbx);
});
}"><pre class="notranslate"><code class="notranslate"> loadFBXModel(path, modelFile, pos = [0, 0, 0], size = 0.1) {
const loader = new FBXLoader();
loader.setPath(path);
loader.load(modelFile, (fbx) => {
fbx.scale.setScalar(size);
fbx.traverse((c) => {
c.castShadow = true;
});
fbx.position.copy(new THREE.Vector3(...pos));
this._scene.add(fbx);
});
}
</code></pre></div>
<p dir="auto">how it is with older version:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/54670936/128532439-b4fb84f5-c87a-445b-8d34-d33086cbc46e.png"><img width="136" alt="image" src="https://user-images.githubusercontent.com/54670936/128532439-b4fb84f5-c87a-445b-8d34-d33086cbc46e.png" style="max-width: 100%;"></a></p>
<p dir="auto">how it is in the current version:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/54670936/128532623-39c0a5d0-a785-4dec-a204-7f5f788dabe3.png"><img width="125" alt="image" src="https://user-images.githubusercontent.com/54670936/128532623-39c0a5d0-a785-4dec-a204-7f5f788dabe3.png" style="max-width: 100%;"></a></p> | 1 |
<h2 dir="auto">Problem</h2>
<p dir="auto">My team is maintaining a large front end application with the same file hierarchy as:-</p>
<ul dir="auto">
<li>component</li>
<li>pages</li>
</ul>
<p dir="auto">but we don't like it. We usually have multiple component that is only used by a single page resulting whenever we found bugs or wanted to modify a page, we have to navigate though component to find the components related to the page. Its a pain in developing. So, we prefer the approach of:-</p>
<ul dir="auto">
<li>pages
<ul dir="auto">
<li>page<br>
index.js
<ul dir="auto">
<li>component<br>
and we are looking for a new framework to use</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 dir="auto">Ideal case</h2>
<p dir="auto">We would name our pages and components differently</p>
<ul dir="auto">
<li>pages
<ul dir="auto">
<li>page<br>
index.page.js
<ul dir="auto">
<li>component<br>
component.component.js</li>
</ul>
</li>
</ul>
</li>
</ul>
<p dir="auto">We would use pagesGlobPattern to only render files ending with .page.js ignoring .component.js<br>
But then we would need another option to ask next to treat index.page.js as index.js</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul> | <p dir="auto">Hey Zeit / team! First of all, thanks for all of the hard work on NextJS / Now it's a match made and heaven and I'm insanely excited to be able to migrate a large production app over to the platform.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Builds should always be deployable via now and should pass remotely as long as they're passing locally. (considering we're not using any global modules, etc) .. I'm not sure if this is an issue with Next or with Now, but building my app locally works 100% of the time via <code class="notranslate">NODE_ENV=production next build</code> .. which is the step that I believe is failing remotely.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Sometimes when deploying our app, it will fail intermittently. Upon retrying, it will sometimes work, and other times not .. I'm not sure whether or not it's timing out, or what is actually causing these failures. I just get the obscure "Build Error"</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>latest</td>
</tr>
<tr>
<td>node</td>
<td>9.0.0</td>
</tr>
<tr>
<td>OS</td>
<td>OS X High Seirra</td>
</tr>
<tr>
<td>browser</td>
<td>N/A</td>
</tr>
</tbody>
</table>
<p dir="auto">This could be related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="208595332" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/1195" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/1195/hovercard" href="https://github.com/vercel/next.js/issues/1195">#1195</a> .. as I've had to add my own uglifyjs set up to my <code class="notranslate">next.config.js</code></p>
<p dir="auto">My <code class="notranslate">next.config.js</code> looks like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const variables = require('./components/style-helpers/global-variables.js')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
webpack: function (config, { dev }) {
console.log(`Environment: ${process.env.NODE_ENV}`)
if (!dev) {
console.log('Uglifying JS')
// remove this once this is resolved: https://github.com/zeit/next.js/issues/1195
config.plugins = config.plugins.filter(p => p.constructor.name !== 'UglifyJsPlugin')
config.plugins.push(
new UglifyJSPlugin({
parallel: true
})
)
} else {
// https://webpack.js.org/configuration/devtool/
config.devtool = 'source-map'
}
config.module.rules.push(
{
test: /\.(jpg|svg|png|woff)$/,
loader: 'url-loader?limit=25000'
},
{
test: /\.css$/,
use: [
{
loader: 'emit-file-loader',
options: {
name: 'dist/[path][name].[ext]'
}
},
'babel-loader',
'styled-modules/loader',
'css-loader?modules',
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: (loader) => [
require('postcss-custom-properties')({ variables, warnings: false, strict: false }),
require('postcss-easy-import')({prefix: '_'}),
require('postcss-cssnext')(),
require('postcss-nested')()
]
}
}
]
}
)
return config
}
}"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">variables</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./components/style-helpers/global-variables.js'</span><span class="pl-kos">)</span>
<span class="pl-k">const</span> <span class="pl-v">UglifyJSPlugin</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'uglifyjs-webpack-plugin'</span><span class="pl-kos">)</span>
<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
<span class="pl-en">webpack</span>: <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">config</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> dev <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`Environment: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">NODE_ENV</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">dev</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Uglifying JS'</span><span class="pl-kos">)</span>
<span class="pl-c">// remove this once this is resolved: https://github.com/zeit/next.js/issues/1195</span>
<span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">plugins</span> <span class="pl-c1">=</span> <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">plugins</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-s1">p</span> <span class="pl-c1">=></span> <span class="pl-s1">p</span><span class="pl-kos">.</span><span class="pl-c1">constructor</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">!==</span> <span class="pl-s">'UglifyJsPlugin'</span><span class="pl-kos">)</span>
<span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">plugins</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span>
<span class="pl-k">new</span> <span class="pl-v">UglifyJSPlugin</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">parallel</span>: <span class="pl-c1">true</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">)</span>
<span class="pl-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
<span class="pl-c">// https://webpack.js.org/configuration/devtool/</span>
<span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">devtool</span> <span class="pl-c1">=</span> <span class="pl-s">'source-map'</span>
<span class="pl-kos">}</span>
<span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">module</span><span class="pl-kos">.</span><span class="pl-c1">rules</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span>
<span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span><span class="pl-kos">(</span>jpg<span class="pl-c1">|</span>svg<span class="pl-c1">|</span>png<span class="pl-c1">|</span>woff<span class="pl-kos">)</span><span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'url-loader?limit=25000'</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>css<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span>
<span class="pl-c1">use</span>: <span class="pl-kos">[</span>
<span class="pl-kos">{</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'emit-file-loader'</span><span class="pl-kos">,</span>
<span class="pl-c1">options</span>: <span class="pl-kos">{</span>
<span class="pl-c1">name</span>: <span class="pl-s">'dist/[path][name].[ext]'</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-s">'babel-loader'</span><span class="pl-kos">,</span>
<span class="pl-s">'styled-modules/loader'</span><span class="pl-kos">,</span>
<span class="pl-s">'css-loader?modules'</span><span class="pl-kos">,</span>
<span class="pl-kos">{</span>
<span class="pl-c1">loader</span>: <span class="pl-s">'postcss-loader'</span><span class="pl-kos">,</span>
<span class="pl-c1">options</span>: <span class="pl-kos">{</span>
<span class="pl-c1">ident</span>: <span class="pl-s">'postcss'</span><span class="pl-kos">,</span>
<span class="pl-en">plugins</span>: <span class="pl-kos">(</span><span class="pl-s1">loader</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">[</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'postcss-custom-properties'</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">{</span> variables<span class="pl-kos">,</span> <span class="pl-c1">warnings</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">strict</span>: <span class="pl-c1">false</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'postcss-easy-import'</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">prefix</span>: <span class="pl-s">'_'</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'postcss-cssnext'</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
<span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'postcss-nested'</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span>
<span class="pl-kos">]</span>
<span class="pl-kos">}</span>
<span class="pl-kos">)</span>
<span class="pl-k">return</span> <span class="pl-s1">config</span>
<span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">And this has been the intermitten experience I've been having:<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/9a6487740b796375737b352901542532149e1341e68dff9164feffaf809d262e/687474703a2f2f642e70722f692f5651356339422b"><img src="https://camo.githubusercontent.com/9a6487740b796375737b352901542532149e1341e68dff9164feffaf809d262e/687474703a2f2f642e70722f692f5651356339422b" alt="" data-canonical-src="http://d.pr/i/VQ5c9B+" style="max-width: 100%;"></a></p>
<p dir="auto">I can provide any additional information if I left anything out, but this has been kicking my butt so I'd really love if I could get some other eyes on this!</p> | 0 |
<p dir="auto"><strong>Migrated issue, originally created by Alex Rothberg</strong></p>
<p dir="auto">Right now <code class="notranslate">startswith</code> uses <code class="notranslate">LIKE</code>. It would be good if there were a flag it took that would use <code class="notranslate">ILIKE</code>. The same would be good of the <code class="notranslate">contains</code> operator.</p> | <p dir="auto"><strong>Migrated issue, originally created by jvanasco (<a href="https://github.com/jvanasco">@jvanasco</a>)</strong></p>
<p dir="auto">discussed previously in</p>
<ul dir="auto">
<li><a href="https://groups.google.com/forum/#!searchin/sqlalchemy/icontains/sqlalchemy/MUyt8zYaP0c/ht4fGR9q9w8J" rel="nofollow">https://groups.google.com/forum/#!searchin/sqlalchemy/icontains/sqlalchemy/MUyt8zYaP0c/ht4fGR9q9w8J</a></li>
<li><a href="https://groups.google.com/forum/#!searchin/sqlalchemy/icontains/sqlalchemy/331XoToT4lk/RPjIYNTkSEIJ" rel="nofollow">https://groups.google.com/forum/#!searchin/sqlalchemy/icontains/sqlalchemy/331XoToT4lk/RPjIYNTkSEIJ</a></li>
</ul>
<p dir="auto">I tried doing this myself, but don't know enough of the internals to get this done on my own.</p>
<p dir="auto">it looks like these need to be modified</p>
<ul dir="auto">
<li>sqlalchemy/sql/default_comparator.py</li>
<li>sqlalchemy/sql/operators.py</li>
</ul>
<p dir="auto">but not sure about</p>
<ul dir="auto">
<li>sqlalchemy/sql/compiler.py</li>
</ul>
<p dir="auto">there are probably more files.</p>
<p dir="auto">if someone can get one working, I can do the rest and build out tests.</p> | 1 |
<p dir="auto">I know this is out of spec, but it would be very nice to add support for Elvis operator in playground.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="object?.property // object && object.property
foo?() // foo && foo() "><pre class="notranslate"><span class="pl-s1">object</span><span class="pl-kos">?.</span><span class="pl-c1">property</span> <span class="pl-c">// object && object.property</span>
<span class="pl-s1">foo</span>?<span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c">// foo && foo() </span></pre></div> | <p dir="auto">Making an issue here to track the work that needs to be done for the new @babel/eslint-* packages for the v8 release.</p>
<h4 dir="auto"><code class="notranslate">@babel/eslint-parser</code> (taken from <a href="https://github.com/babel/babel-eslint/milestone/1">https://github.com/babel/babel-eslint/milestone/1</a>):</h4>
<ul dir="auto">
<li><del><a href="https://github.com/babel/babel-eslint/pull/784" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel-eslint/pull/784/hovercard">add support for preset & plugins in babelOptions</a></del> We can add this in a later minor version if need be.</li>
<li><del><a href="https://github.com/babel/babel-eslint/issues/746" data-hovercard-type="issue" data-hovercard-url="/babel/babel-eslint/issues/746/hovercard">11.0.0-beta.0 - Private class methods no-undef error</a></del> This is not an issue specific to <code class="notranslate">babel-eslint</code> since the error is being thrown by <code class="notranslate">@babel-core</code> and the example code doesn't compile either.</li>
<li><del><a href="https://github.com/babel/babel-eslint/issues/749" data-hovercard-type="issue" data-hovercard-url="/babel/babel-eslint/issues/749/hovercard">11.0.0-beta.0 - Private Instance Methods - Parsing error: params is not iterable</a> - Dupe of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="409878258" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/9506" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/9506/hovercard" href="https://github.com/babel/babel/issues/9506">#9506</a></del> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="541857419" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10914" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/10914/hovercard" href="https://github.com/babel/babel/pull/10914">#10914</a></li>
<li><del><a href="https://github.com/babel/babel-eslint/issues/760" data-hovercard-type="issue" data-hovercard-url="/babel/babel-eslint/issues/760/hovercard">11.0.0-beta.0 - Typescript interface/type no-undef error</a></del> I don't think we should consider this a blocker for v8, since TS support is currently fairly limited. I think it makes sense to focus on making TS support more robust in the future, though I'm still of the mind that folks should just use <code class="notranslate">typescript-eslint</code>.</li>
<li><del><a href="https://github.com/babel/babel-eslint/issues/786" data-hovercard-type="issue" data-hovercard-url="/babel/babel-eslint/issues/786/hovercard">Doesn't work with custom parser through <code class="notranslate">parserOverride</code></a></del> I don't think we should consider this a blocker for v8.</li>
</ul>
<h4 dir="auto"><code class="notranslate">@babel/eslint-plugin</code></h4>
<ul dir="auto">
<li><del><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="541313842" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10904" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/10904/hovercard" href="https://github.com/babel/babel/issues/10904">#10904</a></del></li>
<li><del>Ensure <code class="notranslate">ClassPrivateProperty</code> works correctly with <code class="notranslate">no-unused-vars</code> and <code class="notranslate">no-undef</code>.</del> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="541821763" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10913" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/10913/hovercard" href="https://github.com/babel/babel/pull/10913">#10913</a></li>
<li><del>Can we create a shared config that enables the parser and corresponding rules automatically?</del> I no longer think this is a good idea because ESLint doesn't provide any runtime hooks to see what the user has configured. Turning off incompatible rules works, but we can't enable the corresponding rule in our plugin.</li>
<li><del>Audit current rules to see if they need to exist.</del> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="547789583" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10975" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/10975/hovercard" href="https://github.com/babel/babel/pull/10975">#10975</a> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="547846435" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10977" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/10977/hovercard" href="https://github.com/babel/babel/pull/10977">#10977</a></li>
<li><del>Remove deprecated rules?</del> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="547789583" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/10975" data-hovercard-type="pull_request" data-hovercard-url="/babel/babel/pull/10975/hovercard" href="https://github.com/babel/babel/pull/10975">#10975</a></li>
<li>Figure out how we can be more proactive rather than reactive. Run core rules over fixtures that contain new experimental syntax? Fuzzer?</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="548404881" data-permission-text="Title is private" data-url="https://github.com/babel/babel-eslint/issues/814" data-hovercard-type="issue" data-hovercard-url="/babel/babel-eslint/issues/814/hovercard" href="https://github.com/babel/babel-eslint/issues/814">babel/babel-eslint#814</a></li>
</ul>
<h4 dir="auto"><code class="notranslate">@babel/parser</code></h4>
<ul dir="auto">
<li><a href="https://github.com/babel/babel/issues/11711" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/11711/hovercard">Update ESTree plugin to output spec-compliant AST</a></li>
<li><a href="https://github.com/babel/babel-eslint/issues/838" data-hovercard-type="issue" data-hovercard-url="/babel/babel-eslint/issues/838/hovercard"><code class="notranslate">RegExpLiteral</code> is not converted to <code class="notranslate">Literal</code> in an edge case</a></li>
</ul>
<p dir="auto">Please feel free to edit this comment or discuss below.</p> | 0 |
<p dir="auto">I create a table like <a href="https://material-ui-next.com/demos/tables/" rel="nofollow">Table</a> wich contains<br>
<code class="notranslate">CheckBox Name LastName</code>.<br>
When I translate from one page to another I find that the headers <code class="notranslate">Name</code> and <code class="notranslate">LastName</code> translate from one page to another due to the length of their strings.<br>
I added a style for TableCell :</p>
<div class="highlight highlight-source-css notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="width: 40%"><pre class="notranslate"><span class="pl-c1">width</span><span class="pl-kos">:</span> <span class="pl-c1">40<span class="pl-smi">%</span></span></pre></div>
<p dir="auto">But this doesn't solve the problem. How can I fix the headers columns to not translate from one page to another due the length of strings?</p>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Material-UI</td>
<td>1.0.0-beta.16</td>
</tr>
<tr>
<td>React</td>
<td>15.6.2</td>
</tr>
<tr>
<td>browser</td>
<td>Chrome</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table> | <h3 dir="auto">For Fixing table Head in material 1.0.0 11 alpha</h3>
<p dir="auto">I have a table with scrolling rows but I am not able to fix the header.<br>
Is there a property to do so as fixedHeader was in material 0.15 and up but there doesnt seem to be something similar in 1.0.0 version</p>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>Material-UI: 1.0.0-alpha 11</li>
<li>React: 15.4.2</li>
</ul> | 1 |
<ul dir="auto">
<li>[ x] I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Clarify the section in the docs explaining the static folder convention and how it is handled by next. The docs should emphasize that static assets <em>must</em> be put in the static dir.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">I only discovered that static assets <em>had</em> to come from the static dir after running into problems and then poring over many GH issues.</p> | <ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Following the <code class="notranslate">custom-server-hapi</code> example with hapi's latest release should work.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">I came across two issues when trying to implement a custom hapi 17 server.</p>
<ol dir="auto">
<li>The <code class="notranslate">server.connection</code> method was removed in favor of passing the connection props to the server's constructor I fixed it like this:</li>
</ol>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
//BEFORE
app.prepare()
.then(() => {
server.connection({ port })
server.register(pluginOptions)
.then(() => {
server.route({
method: 'GET',
path: '/{p*}', /* catch all route */
handler: defaultHandlerWrapper(app)
})
server.start().catch(error => {
console.log('Error starting server')
console.log(error)
}).then(() => {
console.log(`> Ready on http://localhost:${port}`)
})
})
})
//AFTER
app.prepare().then(() => {
const server = new Hapi.Server({ host, port });
server.route({
method: 'GET',
path: '/{p*}' /* catch all route */,
handler: defaultHandlerWrapper(app)
});
server.start(err => {
if (err) throw err;
console.log(`> Ready on http://${host}:${port}`);
});
});"><pre class="notranslate"><span class="pl-c">//BEFORE</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">prepare</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">connection</span><span class="pl-kos">(</span><span class="pl-kos">{</span> port <span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">register</span><span class="pl-kos">(</span><span class="pl-s1">pluginOptions</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">route</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">method</span>: <span class="pl-s">'GET'</span><span class="pl-kos">,</span>
<span class="pl-c1">path</span>: <span class="pl-s">'/{p*}'</span><span class="pl-kos">,</span> <span class="pl-c">/* catch all route */</span>
<span class="pl-c1">handler</span>: <span class="pl-en">defaultHandlerWrapper</span><span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">start</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">catch</span><span class="pl-kos">(</span><span class="pl-s1">error</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'Error starting server'</span><span class="pl-kos">)</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`> Ready on http://localhost:<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">port</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-c">//AFTER</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">prepare</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">server</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Hapi</span><span class="pl-kos">.</span><span class="pl-c1">Server</span><span class="pl-kos">(</span><span class="pl-kos">{</span> host<span class="pl-kos">,</span> port <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">route</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
<span class="pl-c1">method</span>: <span class="pl-s">'GET'</span><span class="pl-kos">,</span>
<span class="pl-c1">path</span>: <span class="pl-s">'/{p*}'</span> <span class="pl-c">/* catch all route */</span><span class="pl-kos">,</span>
<span class="pl-c1">handler</span>: <span class="pl-en">defaultHandlerWrapper</span><span class="pl-kos">(</span><span class="pl-s1">app</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">server</span><span class="pl-kos">.</span><span class="pl-en">start</span><span class="pl-kos">(</span><span class="pl-s1">err</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-k">throw</span> <span class="pl-s1">err</span><span class="pl-kos">;</span>
<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`> Ready on http://<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">host</span><span class="pl-kos">}</span></span>:<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">port</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ol start="2" dir="auto">
<li>The defaultHandlerWrapper was throwing this error <code class="notranslate">UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: x): Cannot set headers after they are sent to the client</code>. I fixed it like this:</li>
</ol>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
//BEFORE
const defaultHandlerWrapper = app => {
const handler = app.getRequestHandler()
return ({ raw, url }, hapiReply) =>
handler(raw.req, raw.res, url)
.then(() => {
hapiReply.close(false)
})
}
//AFTER
const { parse } = require('url');
const defaultHandlerWrapper = app => (
{ raw: { req, res }, url },
hapiReply
) => {
const parsedUrl = parse(url, true);
const { pathname, query } = parsedUrl;
return app.renderToHTML(req, res, pathname, query).then(hapiReply);
};"><pre class="notranslate"><span class="pl-c">//BEFORE</span>
<span class="pl-k">const</span> <span class="pl-en">defaultHandlerWrapper</span> <span class="pl-c1">=</span> <span class="pl-s1">app</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">handler</span> <span class="pl-c1">=</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">getRequestHandler</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
<span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> raw<span class="pl-kos">,</span> url <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">hapiReply</span><span class="pl-kos">)</span> <span class="pl-c1">=></span>
<span class="pl-s1">handler</span><span class="pl-kos">(</span><span class="pl-s1">raw</span><span class="pl-kos">.</span><span class="pl-c1">req</span><span class="pl-kos">,</span> <span class="pl-s1">raw</span><span class="pl-kos">.</span><span class="pl-c1">res</span><span class="pl-kos">,</span> <span class="pl-s1">url</span><span class="pl-kos">)</span>
<span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-s1">hapiReply</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-c1">false</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span>
<span class="pl-c">//AFTER</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> parse <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'url'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-en">defaultHandlerWrapper</span> <span class="pl-c1">=</span> <span class="pl-s1">app</span> <span class="pl-c1">=></span> <span class="pl-kos">(</span>
<span class="pl-kos">{</span> <span class="pl-c1">raw</span>: <span class="pl-kos">{</span> req<span class="pl-kos">,</span> res <span class="pl-kos">}</span><span class="pl-kos">,</span> url <span class="pl-kos">}</span><span class="pl-kos">,</span>
<span class="pl-s1">hapiReply</span>
<span class="pl-kos">)</span> <span class="pl-c1">=></span> <span class="pl-kos">{</span>
<span class="pl-k">const</span> <span class="pl-s1">parsedUrl</span> <span class="pl-c1">=</span> <span class="pl-en">parse</span><span class="pl-kos">(</span><span class="pl-s1">url</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> pathname<span class="pl-kos">,</span> query <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">parsedUrl</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">renderToHTML</span><span class="pl-kos">(</span><span class="pl-s1">req</span><span class="pl-kos">,</span> <span class="pl-s1">res</span><span class="pl-kos">,</span> <span class="pl-s1">pathname</span><span class="pl-kos">,</span> <span class="pl-s1">query</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-s1">hapiReply</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<h2 dir="auto">Context</h2>
<p dir="auto">While following the <code class="notranslate">custom-server-hapi</code> example using the latest release of Hapi, I came across the issues described above. I managed to have it working by applying the fixes I attached to this issue. If this all makes sense I'm hapi (pun intended) to send a PR.</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>4.1.4</td>
</tr>
<tr>
<td>node</td>
<td>9.2.0</td>
</tr>
<tr>
<td>OS</td>
<td>Linux hal9000 4.13.12-1-ARCH 1 SMP PREEMPT Wed Nov 8 11:54:06 CET 2017 x86_64 GNU/Linux</td>
</tr>
<tr>
<td>hapi</td>
<td>17.0.2</td>
</tr>
</tbody>
</table> | 0 |
<p dir="auto">My apologies if this is the wrong venue. It wasn't clear from the contributors guidelines whether issues are a suitable place for questions/feature-requests, and when I asked via <a href="https://discordapp.com/channels/684898665143206084/689420767620104201/725083870164287540" rel="nofollow">the community chat room</a> and the <a href="https://stackoverflow.com/questions/62544235/does-deno-have-a-way-to-track-async-contexts" rel="nofollow">usual places</a> I didn't get much engagement.</p>
<p dir="auto">Does Deno have a supported-or-experimental way to track the creation of asynchronous contexts? I <a href="https://github.com/denoland/deno/issues/945" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/945/hovercard">see async_hooks</a> isn't something you'll be implementing -- at least until <a href="https://github.com/denoland/deno/blob/d16337cc9c59732fe81655482e08b72d844472e6/std/node/README.md">Node lands a non-experimental version of it</a>.</p>
<p dir="auto">The specific use-case I have in mind is <a href="https://www.npmjs.com/package/@opentelemetry/context-async-hooks" rel="nofollow">an OpenTelementry context manager</a>, but I'm also thinking of other Application Performance Monitoring use-cases where we're trying to tie multiple asynchronous actions to a single scope (scope meaning a single HTTP request, or a single GRPC method invocation, etc.)</p>
<p dir="auto">Also, FWIW, the usual cowboy way APM vendors would handle this doesn't look like it's possible in Deno -- redefining the global <code class="notranslate">Promise</code> doesn't carry over when you <code class="notranslate">import</code> other modules. Probably "the right" behavior, but it does seem to make our usual monkey patching not possible.</p>
<p dir="auto">Is this something that's on the roadmap and/or people's minds? "No" is a perfectly acceptable answer, I'm just trying to get the lay of the land before I go down one particular road or the other.</p> | <p dir="auto">Hey,</p>
<p dir="auto">One of the features Node uses from V8 is promise hooks and in particular Node's <a href="https://nodejs.org/api/async_hooks.html" rel="nofollow">async_hooks</a> lets users keep context enabling a lot of use cases (like APMs).</p>
<p dir="auto">I saw <a href="https://github.com/denoland/deno/issues/945" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/945/hovercard">the last issue</a> but it doesn't look like there was a lot of discussion there. As far as I'm aware there is no analogy in the DOM/browser world for this. When I talked to some tooling people in browser vendors they said they were not aware of a direct analogy.</p>
<p dir="auto">I would recommend (barring actual discussions with APM vendors or telling users to use a user promise library and instrumenting its scheduler):</p>
<ul dir="auto">
<li>Exposing SetPromiseHook pretty directly and letting users and vendors deal with it.</li>
<li>Exposing an async_hooks like API - possibly based on Zones (or hopefully another web proposal).</li>
<li>Exposing <em>only</em> the node async hooks API under std/node.</li>
<li>Wait for vendors and complain and not solve it until APM vendors or users complain (then use their feedback to pick an API).</li>
<li>Something else entirely.</li>
</ul>
<p dir="auto">It's true async_hooks are experimental and domains are deprecated but without neither - it is pretty impossible to build an APM for Node. You have to instrument methods to know "where you came from" in an async context and APMs are pretty valuable tools.</p> | 1 |
<p dir="auto">A video decoder would make it much easier to work with video. For instance, something like tf.image.decode_jpeg, but for mp4 videos (or some other format perhaps).</p> | <p dir="auto">Currently, there is support for audio decoding using FFMmpeg through <a href="https://www.tensorflow.org/versions/master/api_docs/python/contrib.ffmpeg.html" rel="nofollow">tf.contrib.ffmpeg.decode_audio()</a>. Would it be possible to add something similar for decoding video files?</p>
<p dir="auto">Thanks!</p> | 1 |
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jack_kerouac" rel="nofollow">Florian Rampp</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7288?redirect=false" rel="nofollow">SPR-7288</a></strong> and commented</p>
<p dir="auto">In the given forum entry, I outline a use case for splitting the handling of a REST resource between several controllers. While, e.g. the methods PUT and DELETE on a resource describe the setup and teardown of some kind of bucket, the POST to the same URL creates new content in the bucket. These two kinds of functionality are very different and thus may have two different business service interfaces. Therefore a split in the controller to reflect this distinction would be reasonable.</p>
<p dir="auto">I would propose to consider, whether the rule that one resource can only handled by a single controller should be extended to include the HTTP method, so that different HTTP methods of the same resource can be handled in different controllers.</p>
<hr>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?t=90822" rel="nofollow">http://forum.springsource.org/showthread.php?t=90822</a></p> | <p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=markhopkins" rel="nofollow">Mark Hopkins</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6822?redirect=false" rel="nofollow">SPR-6822</a></strong> and commented</p>
<p dir="auto">Given the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Controller
public class Controller1 {
@RequestMapping(value="/someurl", method=GET)
public String doGet() {
return "view";
}
}"><pre class="notranslate"><code class="notranslate">@Controller
public class Controller1 {
@RequestMapping(value="/someurl", method=GET)
public String doGet() {
return "view";
}
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Controller
public class Controller2 {
@RequestMapping(value="/someurl", method=POST)
public String doPost() {
// do something different for posts
return "view";
}
}"><pre class="notranslate"><code class="notranslate">@Controller
public class Controller2 {
@RequestMapping(value="/someurl", method=POST)
public String doPost() {
// do something different for posts
return "view";
}
}
</code></pre></div>
<div class="highlight highlight-text-xml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="....
<context:spring-configured/>
<context:annotation-config/>
<context:component-scan base-package="..."/>
<context:component-scan base-package="..."/>
...."><pre class="notranslate">....
<<span class="pl-ent">context</span><span class="pl-ent">:</span><span class="pl-ent">spring-configured</span>/>
<<span class="pl-ent">context</span><span class="pl-ent">:</span><span class="pl-ent">annotation-config</span>/>
<<span class="pl-ent">context</span><span class="pl-ent">:</span><span class="pl-ent">component-scan</span> <span class="pl-e">base-package</span>=<span class="pl-s"><span class="pl-pds">"</span>...<span class="pl-pds">"</span></span>/>
<<span class="pl-ent">context</span><span class="pl-ent">:</span><span class="pl-ent">component-scan</span> <span class="pl-e">base-package</span>=<span class="pl-s"><span class="pl-pds">"</span>...<span class="pl-pds">"</span></span>/>
....</pre></div>
<p dir="auto">you get the following exception:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in ServletContext resource [/WEB-INF/web-application-config.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler [controller2] to URL path [/someurl]: There is already handler [Controller1@1830ec7] mapped.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
..."><pre class="notranslate"><code class="notranslate">org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0' defined in ServletContext resource [/WEB-INF/web-application-config.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot map handler [controller2] to URL path [/someurl]: There is already handler [Controller1@1830ec7] mapped.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
...
</code></pre></div>
<p dir="auto">In our specific domain it makes most sense to have the GET and POST for the same URL split over two different classes.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 GA</p>
<p dir="auto">2 votes, 3 watchers</p> | 1 |
<h2 dir="auto"><strong>System information</strong></h2>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04, <a href="https://docs.nvidia.com/deeplearning/sdk/tensorrt-container-release-notes/rel_19-02.html#rel_19-02" rel="nofollow">nvcr.io/nvidia/tensorrt:19.02-py3</a></li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: NA</li>
<li>TensorFlow installed from (source or binary): binary</li>
<li>TensorFlow version (use command below): v1.12.1-7024-g24b3e6cf73 1.15.0-dev20190725</li>
<li>Python version: 3.5.2</li>
<li>Bazel version (if compiling from source): NA</li>
<li>GCC/Compiler version (if compiling from source): NA</li>
<li>CUDA/cuDNN version: 10.0.130 / 7.4.2 as per the above linked container</li>
<li>GPU model and memory: Tesla V100 32GB</li>
</ul>
<p dir="auto">Relevant output from <code class="notranslate">pip freeze</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tf-estimator-nightly==1.14.0.dev2019072201
tf-nightly-gpu==1.15.0.dev20190725"><pre class="notranslate"><code class="notranslate">tf-estimator-nightly==1.14.0.dev2019072201
tf-nightly-gpu==1.15.0.dev20190725
</code></pre></div>
<h2 dir="auto"><strong>Describe the current behavior</strong></h2>
<p dir="auto"><strong>Inference Speed (frames per second)</strong></p>
<table role="table">
<thead>
<tr>
<th>Model</th>
<th>Native</th>
<th>FP32</th>
<th>FP16</th>
<th>INT8</th>
</tr>
</thead>
<tbody>
<tr>
<td>tiny-yolo</td>
<td>348</td>
<td>333</td>
<td>402</td>
<td>415</td>
</tr>
<tr>
<td>big-yolo</td>
<td>125</td>
<td>140</td>
<td>243</td>
<td>208</td>
</tr>
</tbody>
</table>
<p dir="auto"><strong>1. Why is there a slowdown for tiny native->FP32?</strong> (<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pooyadavoodi/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pooyadavoodi">@pooyadavoodi</a> same as <a href="https://github.com/tensorflow/tensorflow/issues/30717#issuecomment-513938562" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/30717/hovercard">here</a>)<br>
<strong>2. Why is this slowdown not consistent for big?</strong><br>
<strong>3. Why is there a slowdown for big FP16->INT8?</strong></p>
<p dir="auto"><strong>Model Size (megabytes)</strong></p>
<table role="table">
<thead>
<tr>
<th>Model</th>
<th>Native</th>
<th>FP32</th>
<th>FP16</th>
<th>INT8</th>
</tr>
</thead>
<tbody>
<tr>
<td>tiny-yolo</td>
<td>35</td>
<td>67</td>
<td>44</td>
<td>51</td>
</tr>
<tr>
<td>big-yolo</td>
<td>238</td>
<td>439</td>
<td>288</td>
<td>332</td>
</tr>
</tbody>
</table>
<p dir="auto">I understand that there is currently an issue where new graph weights are saved twice to the .pb file (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="468258845" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/30717" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/30717/hovercard" href="https://github.com/tensorflow/tensorflow/issues/30717">#30717</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="468975806" data-permission-text="Title is private" data-url="https://github.com/tensorflow/tensorflow/issues/30789" data-hovercard-type="pull_request" data-hovercard-url="/tensorflow/tensorflow/pull/30789/hovercard" href="https://github.com/tensorflow/tensorflow/pull/30789">#30789</a>). Once the weights in the table are adjusted for this double weight saving, the resulting sizes for fp32 and fp16 seem reasonable.</p>
<p dir="auto"><strong>1. Why is there an increase in size for fp16->int8?</strong></p>
<h2 dir="auto"><strong>Describe the expected behavior</strong></h2>
<p dir="auto">I am trying to quantize two different YOLO models (one tiny, one normal) with TensorRT. The goals of this quantization are:</p>
<ol dir="auto">
<li>speed up inference</li>
<li>decrease model size</li>
</ol>
<p dir="auto">As quantization and conversion proceeds from native->fp32->fp16->int8, I expect inference time to decrease (FPS to increase), and model size to decrease.</p>
<h2 dir="auto"><strong>Code to reproduce the issue</strong></h2>
<p dir="auto">I am using <a href="https://github.com/tensorflow/models/blob/master/research/tensorrt/tensorrt.py">this</a> script and a few helper functions from <a href="https://github.com/tensorflow/tensorrt/blob/master/tftrt/examples/object_detection/graph_utils.py">here</a>. The two exact scripts that I use are <a href="https://github.com/tensorflow/tensorflow/files/3432597/do.py.txt">do.py</a> and <a href="https://github.com/tensorflow/tensorflow/files/3432598/utilities.py.txt">utilities.py</a>. Here are the <a href="https://drive.google.com/open?id=1Bgj9h6TJLwedtrhnritRs9eYm_iczG4v" rel="nofollow">tiny model</a> and the <a href="https://drive.google.com/open?id=19BzNDCHpDnxj9wU26BsGM4ewS9bKNmpO" rel="nofollow">big model</a>.</p>
<p dir="auto">My command for running the experiments:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="python do.py \
--frozen_graph=big-yolov3_frozen.pb \ # or tiny-yolov3_frozen.pb
--native --fp32 --fp16 --int8 \
--batch_size=32 \ # or 128 for tiny
--output_dir=/workspace \
--input_node=inputs --output_node=output_boxes"><pre class="notranslate">python do.py \
--frozen_graph=big-yolov3_frozen.pb <span class="pl-cce">\ </span><span class="pl-c"><span class="pl-c">#</span> or tiny-yolov3_frozen.pb</span>
--native --fp32 --fp16 --int8 \
--batch_size=32 <span class="pl-cce">\ </span><span class="pl-c"><span class="pl-c">#</span> or 128 for tiny</span>
--output_dir=/workspace \
--input_node=inputs --output_node=output_boxes</pre></div>
<h2 dir="auto"><strong>Other info / logs</strong></h2>
<p dir="auto">I ran a couple of experiments just to make sure that the results were consistent.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="==========================
network: native_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 350.2, mean: 348.0, uncertainty: 1.4, jitter: 5.1
latency median: 0.36551, mean: 0.36846, 99th_p: 0.42946, 99th_uncertainty: 0.01453
==========================
network: tftrt_fp32_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 340.9, mean: 333.4, uncertainty: 1.5, jitter: 4.4
latency median: 0.37546, mean: 0.38470, 99th_p: 0.47469, 99th_uncertainty: 0.06110
==========================
network: tftrt_fp16_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 403.3, mean: 402.3, uncertainty: 0.6, jitter: 3.6
latency median: 0.31740, mean: 0.31824, 99th_p: 0.34266, 99th_uncertainty: 0.00263
==========================
network: tftrt_int8_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 417.7, mean: 414.9, uncertainty: 1.1, jitter: 4.4
latency median: 0.30641, mean: 0.30873, 99th_p: 0.35451, 99th_uncertainty: 0.01511
==========================
network: native_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 125.2, mean: 124.7, uncertainty: 0.3, jitter: 1.4
latency median: 0.25553, mean: 0.25677, 99th_p: 0.28257, 99th_uncertainty: 0.00308
==========================
network: tftrt_fp32_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 140.3, mean: 140.2, uncertainty: 0.4, jitter: 1.9
latency median: 0.22802, mean: 0.22839, 99th_p: 0.25419, 99th_uncertainty: 0.00890
==========================
network: tftrt_fp16_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 237.6, mean: 242.5, uncertainty: 1.4, jitter: 5.4
latency median: 0.13469, mean: 0.13245, 99th_p: 0.17733, 99th_uncertainty: 0.04387
==========================
network: tftrt_int8_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 210.1, mean: 207.5, uncertainty: 1.5, jitter: 2.7
latency median: 0.15231, mean: 0.15657, 99th_p: 0.16928, 99th_uncertainty: 0.16613"><pre class="notranslate"><code class="notranslate">==========================
network: native_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 350.2, mean: 348.0, uncertainty: 1.4, jitter: 5.1
latency median: 0.36551, mean: 0.36846, 99th_p: 0.42946, 99th_uncertainty: 0.01453
==========================
network: tftrt_fp32_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 340.9, mean: 333.4, uncertainty: 1.5, jitter: 4.4
latency median: 0.37546, mean: 0.38470, 99th_p: 0.47469, 99th_uncertainty: 0.06110
==========================
network: tftrt_fp16_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 403.3, mean: 402.3, uncertainty: 0.6, jitter: 3.6
latency median: 0.31740, mean: 0.31824, 99th_p: 0.34266, 99th_uncertainty: 0.00263
==========================
network: tftrt_int8_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 417.7, mean: 414.9, uncertainty: 1.1, jitter: 4.4
latency median: 0.30641, mean: 0.30873, 99th_p: 0.35451, 99th_uncertainty: 0.01511
==========================
network: native_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 125.2, mean: 124.7, uncertainty: 0.3, jitter: 1.4
latency median: 0.25553, mean: 0.25677, 99th_p: 0.28257, 99th_uncertainty: 0.00308
==========================
network: tftrt_fp32_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 140.3, mean: 140.2, uncertainty: 0.4, jitter: 1.9
latency median: 0.22802, mean: 0.22839, 99th_p: 0.25419, 99th_uncertainty: 0.00890
==========================
network: tftrt_fp16_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 237.6, mean: 242.5, uncertainty: 1.4, jitter: 5.4
latency median: 0.13469, mean: 0.13245, 99th_p: 0.17733, 99th_uncertainty: 0.04387
==========================
network: tftrt_int8_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 210.1, mean: 207.5, uncertainty: 1.5, jitter: 2.7
latency median: 0.15231, mean: 0.15657, 99th_p: 0.16928, 99th_uncertainty: 0.16613
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="==========================
network: native_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 357.4, mean: 354.3, uncertainty: 1.7, jitter: 14.5
latency median: 0.35814, mean: 0.36215, 99th_p: 0.44575, 99th_uncertainty: 0.00629
==========================
network: tftrt_fp32_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 324.9, mean: 319.4, uncertainty: 1.4, jitter: 2.5
latency median: 0.39401, mean: 0.40173, 99th_p: 0.49218, 99th_uncertainty: 0.06484
==========================
network: tftrt_fp16_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 376.1, mean: 372.8, uncertainty: 1.1, jitter: 1.7
latency median: 0.34036, mean: 0.34363, 99th_p: 0.38601, 99th_uncertainty: 0.02051
==========================
network: tftrt_int8_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 392.1, mean: 391.3, uncertainty: 0.5, jitter: 1.8
latency median: 0.32645, mean: 0.32717, 99th_p: 0.33765, 99th_uncertainty: 0.01967
==========================
network: native_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 124.3, mean: 124.0, uncertainty: 0.4, jitter: 1.7
latency median: 0.25737, mean: 0.25842, 99th_p: 0.31292, 99th_uncertainty: 0.00355
==========================
network: tftrt_fp32_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 141.0, mean: 140.7, uncertainty: 0.3, jitter: 0.3
latency median: 0.22690, mean: 0.22761, 99th_p: 0.24239, 99th_uncertainty: 0.00581
==========================
network: tftrt_fp16_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 247.4, mean: 245.9, uncertainty: 1.0, jitter: 4.4
latency median: 0.12934, mean: 0.13044, 99th_p: 0.16018, 99th_uncertainty: 0.02011
==========================
network: tftrt_int8_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 206.0, mean: 204.5, uncertainty: 1.4, jitter: 1.0
latency median: 0.15536, mean: 0.15885, 99th_p: 0.16454, 99th_uncertainty: 0.17423"><pre class="notranslate"><code class="notranslate">==========================
network: native_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 357.4, mean: 354.3, uncertainty: 1.7, jitter: 14.5
latency median: 0.35814, mean: 0.36215, 99th_p: 0.44575, 99th_uncertainty: 0.00629
==========================
network: tftrt_fp32_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 324.9, mean: 319.4, uncertainty: 1.4, jitter: 2.5
latency median: 0.39401, mean: 0.40173, 99th_p: 0.49218, 99th_uncertainty: 0.06484
==========================
network: tftrt_fp16_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 376.1, mean: 372.8, uncertainty: 1.1, jitter: 1.7
latency median: 0.34036, mean: 0.34363, 99th_p: 0.38601, 99th_uncertainty: 0.02051
==========================
network: tftrt_int8_tiny-yolov3_frozen.pb, batchsize 128, steps 100
fps median: 392.1, mean: 391.3, uncertainty: 0.5, jitter: 1.8
latency median: 0.32645, mean: 0.32717, 99th_p: 0.33765, 99th_uncertainty: 0.01967
==========================
network: native_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 124.3, mean: 124.0, uncertainty: 0.4, jitter: 1.7
latency median: 0.25737, mean: 0.25842, 99th_p: 0.31292, 99th_uncertainty: 0.00355
==========================
network: tftrt_fp32_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 141.0, mean: 140.7, uncertainty: 0.3, jitter: 0.3
latency median: 0.22690, mean: 0.22761, 99th_p: 0.24239, 99th_uncertainty: 0.00581
==========================
network: tftrt_fp16_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 247.4, mean: 245.9, uncertainty: 1.0, jitter: 4.4
latency median: 0.12934, mean: 0.13044, 99th_p: 0.16018, 99th_uncertainty: 0.02011
==========================
network: tftrt_int8_big-yolov3_frozen.pb, batchsize 32, steps 100
fps median: 206.0, mean: 204.5, uncertainty: 1.4, jitter: 1.0
latency median: 0.15536, mean: 0.15885, 99th_p: 0.16454, 99th_uncertainty: 0.17423
</code></pre></div> | <p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): <a href="https://docs.nvidia.com/deeplearning/sdk/tensorrt-container-release-notes/rel_19-02.html#rel_19-02" rel="nofollow">nvidia-docker <code class="notranslate">tensor:19.02-py3</code> (Ubuntu 16.04)</a></li>
<li>TensorFlow installed from (source or binary): Source</li>
<li>TensorFlow version (use command below): v1.14.0-rc1-22-gaf24dc91b5 1.14.0</li>
<li>Python version: Python 3.5.2</li>
<li>Bazel version (if compiling from source): NA</li>
<li>GCC/Compiler version (if compiling from source): NA</li>
<li>CUDA/cuDNN version: 10.0.130 / 7.4.2</li>
<li>GPU model and memory: Tesla V100 32GB</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
I am trying to optimize (decrease) the inference time and model size of my Tiny Yolov3 model. I currently have it as a frozen graph. When I run the timing and evaluation script from <a href="https://github.com/tensorflow/models/blob/master/research/tensorrt/tensorrt.py">here</a>, fps actually decreases as the optimizations are tried, and file sizes stay constant.</p>
<p dir="auto"><strong>Describe the expected behavior</strong><br>
I expect file sizes and inference time to decrease.</p>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
I used <a href="https://docs.nvidia.com/deeplearning/sdk/tensorrt-container-release-notes/rel_19-02.html#rel_19-02" rel="nofollow">this</a> nvidia-docker image.</p>
<p dir="auto"><a href="https://github.com/tensorflow/models/blob/master/research/tensorrt/tensorrt.py">This</a> script with a small preprocessing change:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def resize_image(image, target_height, target_width):
image = image.resize((target_width, target_height), Image.BICUBIC).convert('RGB')
return np.array(image)
def preprocess_image(file_name, output_height=416, output_width=416,
num_channels=3):
return resize_image(Image.open(file_name), output_height, output_width).astype('float32')"><pre class="notranslate"><code class="notranslate">def resize_image(image, target_height, target_width):
image = image.resize((target_width, target_height), Image.BICUBIC).convert('RGB')
return np.array(image)
def preprocess_image(file_name, output_height=416, output_width=416,
num_channels=3):
return resize_image(Image.open(file_name), output_height, output_width).astype('float32')
</code></pre></div>
<p dir="auto">I also removed the printing of predictions, as the script is built for a classifier rather than a detector.</p>
<p dir="auto"><strong>Other info / logs</strong><br>
Command executed (image file is attached; model is <a href="https://drive.google.com/file/d/1Bgj9h6TJLwedtrhnritRs9eYm_iczG4v/view" rel="nofollow">here</a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="python timed.py --frozen_graph=tiny-yolov3_frozen.pb \
--image_file=11075842.jpg \
--native --fp32 --fp16 --int8 \
--output_dir=/workspace \
--input_node=inputs --output_node=output_boxes"><pre class="notranslate"><code class="notranslate">python timed.py --frozen_graph=tiny-yolov3_frozen.pb \
--image_file=11075842.jpg \
--native --fp32 --fp16 --int8 \
--output_dir=/workspace \
--input_node=inputs --output_node=output_boxes
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="==========================
network: native_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 993.1, mean: 959.8, uncertainty: 8.9, jitter: 7.7
latency median: 0.25778, mean: 0.26986, 99th_p: 0.43523, 99th_uncertainty: 0.05783
==========================
network: tftrt_fp32_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 912.7, mean: 896.3, uncertainty: 8.2, jitter: 4.6
latency median: 0.28048, mean: 0.29338, 99th_p: 0.42830, 99th_uncertainty: 0.43877
==========================
network: tftrt_fp16_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 823.5, mean: 831.9, uncertainty: 8.4, jitter: 96.2
latency median: 0.31087, mean: 0.31129, 99th_p: 0.43070, 99th_uncertainty: 0.07565
==========================
network: tftrt_int8_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 803.3, mean: 820.6, uncertainty: 9.9, jitter: 19.9
latency median: 0.31867, mean: 0.31814, 99th_p: 0.60985, 99th_uncertainty: 0.01011"><pre class="notranslate"><code class="notranslate">==========================
network: native_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 993.1, mean: 959.8, uncertainty: 8.9, jitter: 7.7
latency median: 0.25778, mean: 0.26986, 99th_p: 0.43523, 99th_uncertainty: 0.05783
==========================
network: tftrt_fp32_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 912.7, mean: 896.3, uncertainty: 8.2, jitter: 4.6
latency median: 0.28048, mean: 0.29338, 99th_p: 0.42830, 99th_uncertainty: 0.43877
==========================
network: tftrt_fp16_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 823.5, mean: 831.9, uncertainty: 8.4, jitter: 96.2
latency median: 0.31087, mean: 0.31129, 99th_p: 0.43070, 99th_uncertainty: 0.07565
==========================
network: tftrt_int8_tiny-yolov3_frozen.pb, batchsize 256, steps 100
fps median: 803.3, mean: 820.6, uncertainty: 9.9, jitter: 19.9
latency median: 0.31867, mean: 0.31814, 99th_p: 0.60985, 99th_uncertainty: 0.01011
</code></pre></div> | 1 |
<p dir="auto">Example use case: I allocate a buffer, and put multiple things using <code class="notranslate">out=</code> into the buffer (with views). Naturally I don't want any one of them to resize storage. But currently it's hard to make sure.</p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/colesbury/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/colesbury">@colesbury</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ezyang/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ezyang">@ezyang</a></p> | <p dir="auto">I want to implement linear regression in Pytorch with sparse connections. To build such a network I cannot use nn.Linear because it is a densely connected layer. I have first tried to make a binary matrix with 0 and 1 to indicate the presence and absence of connections. But it won't work in my case because it is not computationally efficient. I am looking for a sparse weight matrix or sparse linear layer type solutions. I would be really grateful if someone would help me in this regard. I have attached a screenshot also to explain what I'm trying to do.<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/58566628/93038137-9dea7080-f65d-11ea-8672-0861457df928.png"><img src="https://user-images.githubusercontent.com/58566628/93038137-9dea7080-f65d-11ea-8672-0861457df928.png" alt="image" style="max-width: 100%;"></a></p> | 0 |
<p dir="auto">This commit implements a fully-automated development setup using Gitpod.io, an<br>
online IDE for GitLab, GitHub, and Bitbucket that enables Dev-Environments-As-Code.<br>
This makes it easy for anyone to get a ready-to-code workspace for any branch,<br>
issue or pull request almost instantly with a single click.</p>
<p dir="auto">Thanks for the help and efforts, please remove all api's and reset my accounts and balance to zero (0). Since, I was bugged or hacked.</p>
<p dir="auto"><strong>Originally posted by @F0o0De in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="946440686" data-permission-text="Title is private" data-url="https://github.com/SocketCluster/socketcluster/issues/545" data-hovercard-type="pull_request" data-hovercard-url="/SocketCluster/socketcluster/pull/545/hovercard" href="https://github.com/SocketCluster/socketcluster/pull/545">SocketCluster/socketcluster#545</a></strong></p> | <p dir="auto">Remove all my api’s and reset all my accounts and balance to zero. Since, I was bugged and hacked.</p>
<p dir="auto">Thank you I really appreciate all the hard work and effort.</p> | 1 |
<p dir="auto">Hi guys,<br>
Thank you very much for all your work on babel, I believe front-end development wouldn't be where it is today without it.<br>
So, currently babel transpiles es2015 default parameters by making use of the <code class="notranslate"> arguments</code> variable, which has performance drawbacks.</p>
<h3 dir="auto">Input Code</h3>
<p dir="auto"><a href="https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Ces2015-loose&targets=&browsers=&builtIns=false&debug=false&code_lz=GYVwdgxgLglg9mABAQwCaoBTMQXkQBgBpEAjXRARgEpEBvAKEUQCcBTKEZpbAalIG56AX3pA" rel="nofollow">REPL</a> link available :)</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function add(a = 0, b = 1) {
return a + b;
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">+</span> <span class="pl-s1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Babel Configuration (.babelrc, package.json, cli command)</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
presets: [
["es2015", {"loose": true}],
],
}"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-c1">presets</span>: <span class="pl-kos">[</span>
<span class="pl-kos">[</span><span class="pl-s">"es2015"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">"loose"</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
function add(aArg, bArg) {
var a = aArg || 0;
var b = bArg || 1;
return a + b;
}"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-s1">aArg</span><span class="pl-kos">,</span> <span class="pl-s1">bArg</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">aArg</span> <span class="pl-c1">||</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">bArg</span> <span class="pl-c1">||</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">+</span> <span class="pl-s1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Current Behavior</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
function add() {
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
return a + b;
}"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">1</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> : <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">+</span> <span class="pl-s1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">Default parameters have historically been managed like in the "Expected behaviour" section, which is fast, I don't know much about ASTs in general so I'm not sure how trivial this is to change.<br>
I think there might be solutions that still make use of arguments, depending on what's easier to implement, but I'd avoid it if possible.<br>
<a href="https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments">This</a> is one, but I'm not sure of its perf impacts, so we'll have to test it.</p>
<h3 dir="auto">Context</h3>
<p dir="auto">I had been using babel's default parameters blindly and one of our functions ended up in "hot" code, which made me discover the perf problem and opening this issue.<br>
I know that <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/GoodBoyDigital/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/GoodBoyDigital">@GoodBoyDigital</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bigtimebuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bigtimebuddy">@bigtimebuddy</a> had to stop using them in some parts of PixiJs due to this problem, happy to hear your thoughts guys if you have anything to add from your perf tests.</p>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.25.0</td>
</tr>
<tr>
<td>node</td>
<td>v8.0.0</td>
</tr>
<tr>
<td>npm</td>
<td>5.0.4</td>
</tr>
<tr>
<td>Operating System</td>
<td>MacOSX 10.11.6</td>
</tr>
</tbody>
</table>
<p dir="auto">Thank you,<br>
Alvin</p> | <p dir="auto">Hi guys,<br>
Thank you very much for all your work on babel, I believe front-end development wouldn't be where it is today without it.<br>
So, currently babel transpiles es2015 default parameters by making use of the <code class="notranslate"> arguments</code> variable, which has performance drawbacks.</p>
<h3 dir="auto">Input Code</h3>
<p dir="auto"><a href="https://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015%2Ces2015-loose&targets=&browsers=&builtIns=false&debug=false&code_lz=GYVwdgxgLglg9mABAQwCaoBTMQXkQBgBpEAjXRARgEpEBvAKEUQCcBTKEZpbAalIG56AX3pA" rel="nofollow">REPL</a> link available :)</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function add(a = 0, b = 1) {
return a + b;
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">+</span> <span class="pl-s1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Babel Configuration (.babelrc, package.json, cli command)</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
presets: [
["es2015", {"loose": true}],
],
}"><pre class="notranslate"><span class="pl-kos">{</span>
<span class="pl-c1">presets</span>: <span class="pl-kos">[</span>
<span class="pl-kos">[</span><span class="pl-s">"es2015"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span><span class="pl-s">"loose"</span>: <span class="pl-c1">true</span><span class="pl-kos">}</span><span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
function add(aArg, bArg) {
var a = aArg || 0;
var b = bArg || 1;
return a + b;
}"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-s1">aArg</span><span class="pl-kos">,</span> <span class="pl-s1">bArg</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">aArg</span> <span class="pl-c1">||</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">bArg</span> <span class="pl-c1">||</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">+</span> <span class="pl-s1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Current Behavior</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""use strict";
function add() {
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
return a + b;
}"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>
<span class="pl-k">function</span> <span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">0</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> : <span class="pl-c1">0</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">></span> <span class="pl-c1">1</span> <span class="pl-c1">&&</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">!==</span> <span class="pl-c1">undefined</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> : <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">+</span> <span class="pl-s1">b</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">Default parameters have historically been managed like in the "Expected behaviour" section, which is fast, I don't know much about ASTs in general so I'm not sure how trivial this is to change.<br>
I think there might be solutions that still make use of arguments, depending on what's easier to implement, but I'd avoid it if possible.<br>
<a href="https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments">This</a> is one, but I'm not sure of its perf impacts, so we'll have to test it.</p>
<h3 dir="auto">Context</h3>
<p dir="auto">I had been using babel's default parameters blindly and one of our functions ended up in "hot" code, which made me discover the perf problem and opening this issue.<br>
I know that <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/GoodBoyDigital/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/GoodBoyDigital">@GoodBoyDigital</a> and <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bigtimebuddy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bigtimebuddy">@bigtimebuddy</a> had to stop using them in some parts of PixiJs due to this problem, happy to hear your thoughts guys if you have anything to add from your perf tests.</p>
<h3 dir="auto">Your Environment</h3>
<table role="table">
<thead>
<tr>
<th>software</th>
<th>version(s)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Babel</td>
<td>6.25.0</td>
</tr>
<tr>
<td>node</td>
<td>v8.0.0</td>
</tr>
<tr>
<td>npm</td>
<td>5.0.4</td>
</tr>
<tr>
<td>Operating System</td>
<td>MacOSX 10.11.6</td>
</tr>
</tbody>
</table>
<p dir="auto">Thank you,<br>
Alvin</p> | 1 |
<p dir="auto">If you know how to fix the issue, make a pull request instead.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/pino</code> package and had problems.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>. (Please ask any appropriate questions there).</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> <a href="https://github.com/blog/821-mention-somebody-they-re-notified">Mention</a> the authors (see <code class="notranslate">Definitions by:</code> in <code class="notranslate">index.d.ts</code>) so they can respond.
<ul dir="auto">
<li>Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/psnider/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/psnider">@psnider</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/BendingBender/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/BendingBender">@BendingBender</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/screendriver/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/screendriver">@screendriver</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/paambaati/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/paambaati">@paambaati</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alferpal/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alferpal">@alferpal</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/mortiy/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mortiy">@mortiy</a></li>
</ul>
</li>
</ul>
<p dir="auto">There seems to be an issue with the versioning of the @types/pino package. The latest is listed as <code class="notranslate">5.8.5</code>, however there was a release of <code class="notranslate">5.20.0</code> about 6 months ago which takes precedence versioning wise, so if users are using <code class="notranslate">"@types/pino": "*"</code> they're getting the <code class="notranslate">5.20.0</code> version. Anyway that the latest can just be bumped to something higher. Thanks.</p>
<p dir="auto">Richard</p> | <ul dir="auto">
<li>Using the <code class="notranslate">@types/react</code> package and had problems.</li>
<li>Using the latest stable version of <code class="notranslate">[email protected]</code>.</li>
</ul>
<p dir="auto">After patch upgrade from <code class="notranslate">16.7.18</code> to <code class="notranslate">16.7.19</code>, <code class="notranslate">tsc</code> command in my project is failing with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="node_modules/@types/react-dom/node_modules/@types/react/index.d.ts(2667,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
node_modules/@types/react/index.d.ts(2682,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
error Command failed with exit code 1."><pre class="notranslate"><code class="notranslate">node_modules/@types/react-dom/node_modules/@types/react/index.d.ts(2667,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
node_modules/@types/react/index.d.ts(2682,14): error TS2300: Duplicate identifier 'LibraryManagedAttributes'.
error Command failed with exit code 1.
</code></pre></div>
<p dir="auto">I am not sure whether the issue lies as I am not explicitly using <code class="notranslate">LibraryManagedAttributes</code> in my project, hence logging this ticket.<br>
Thanks.</p> | 0 |
<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug</h2>
<p dir="auto">Failed to run 'bash ../tools/build_pytorch_libs.sh --use-nnpack --use-qnnpack caffe2'</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Get Pytorch 1.0.1 from the official GIT repository</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sudo git clone --recursive https://github.com/pytorch/pytorch --branch=v1.0.1"><pre class="notranslate"><code class="notranslate">sudo git clone --recursive https://github.com/pytorch/pytorch --branch=v1.0.1
</code></pre></div>
<ol start="2" dir="auto">
<li>Set up environment variables for compiling Pytorch</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export NO_CUDA=1
export NO_DISTRIBUTED=1
export NO_MKLDNN=1
export NO_NNPACK=1
export NO_QNNPACK=1"><pre class="notranslate"><code class="notranslate">export NO_CUDA=1
export NO_DISTRIBUTED=1
export NO_MKLDNN=1
export NO_NNPACK=1
export NO_QNNPACK=1
</code></pre></div>
<ol start="3" dir="auto">
<li>Compile Pytorch</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sudo USE_MKLDNN=0 USE_QNNPACK=0 USE_NNPACK=0 USE_DISTRIBUTED=0 python3 setup.py build"><pre class="notranslate"><code class="notranslate">sudo USE_MKLDNN=0 USE_QNNPACK=0 USE_NNPACK=0 USE_DISTRIBUTED=0 python3 setup.py build
</code></pre></div>
<p dir="auto">full error message</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="CK=0 USE_DISTRIBUTED=0 python3 setup.py build
Building wheel torch-1.0.0a0+8322165
running build
running build_deps
setup.py::build_deps::run()
+ SYNC_COMMAND=cp
++ command -v rsync
+ '[' -x /usr/bin/rsync ']'
+ SYNC_COMMAND='rsync -lptgoD'
+ CMAKE_COMMAND=cmake
++ command -v cmake3
+ [[ -x '' ]]
+ USE_CUDA=0
+ USE_FBGEMM=0
+ USE_ROCM=0
+ USE_NNPACK=0
+ USE_MKLDNN=0
+ USE_QNNPACK=0
+ USE_GLOO_IBVERBS=0
+ CAFFE2_STATIC_LINK_CUDA=0
+ RERUN_CMAKE=1
+ [[ 3 -gt 0 ]]
+ case "$1" in
+ USE_NNPACK=1
+ shift
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ USE_QNNPACK=1
+ shift
+ [[ 1 -gt 0 ]]
+ case "$1" in
+ break
+ CMAKE_INSTALL='make install'
+ BUILD_SHARED_LIBS=ON
+ USER_CFLAGS=
+ USER_LDFLAGS=
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
++ uname
+ '[' Linux == Darwin ']'
+++ dirname ../tools/build_pytorch_libs.sh
++ cd ../tools/..
+++ pwd
++ printf '%q\n' /home/pi/Downloads/pytorch_install/pytorch
+ BASE_DIR=/home/pi/Downloads/pytorch_install/pytorch
+ TORCH_LIB_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib
+ INSTALL_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ THIRD_PARTY_DIR=/home/pi/Downloads/pytorch_install/pytorch/third_party
+ C_FLAGS=
+ C_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ LDFLAGS=
+ LD_POSTFIX=.so
++ uname
+ [[ Linux == \D\a\r\w\i\n ]]
+ [[ 0 -eq 1 ]]
+ LDFLAGS=' -Wl,-rpath,$ORIGIN'
+ CPP_FLAGS=' -std=c++11 '
+ THD_FLAGS=
+ [[ 0 -eq 1 ]]
+ CUDA_NVCC_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ [[ -z '' ]]
+ CUDA_DEVICE_DEBUG=0
+ '[' -z '' ']'
++ getconf _NPROCESSORS_ONLN
+ MAX_JOBS=4
+ BUILD_TYPE=Release
+ [[ -n '' ]]
+ [[ -n '' ]]
+ echo 'Building in Release mode'
Building in Release mode
+ mkdir -p /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ for arg in "$@"
+ [[ caffe2 == \c\a\f\f\e\2 ]]
+ build_caffe2
+ [[ -z '' ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS=()
+ [[ -n '' ]]
+ [[ -n /usr/lib/python3/dist-packages ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS+=("-DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH")
+ [[ 1 -eq 1 ]]
+ cmake /home/pi/Downloads/pytorch_install/pytorch -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib/libpython3.7m.so.1.0 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DBUILDING_WITH_TORCH_LIBS=ON -DTORCH_BUILD_VERSION=1.0.0a0+8322165 -DCMAKE_BUILD_TYPE=Release -DBUILD_TORCH=ON -DBUILD_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DBUILD_BINARY=OFF -DBUILD_TEST=ON -DINSTALL_TEST=ON -DBUILD_CAFFE2_OPS=ON -DONNX_NAMESPACE=onnx_torch -DUSE_CUDA=0 -DUSE_DISTRIBUTED=OFF -DUSE_FBGEMM=0 -DUSE_NUMPY= -DNUMPY_INCLUDE_DIR=/usr/lib/python3/dist-packages/numpy/core/include -DUSE_SYSTEM_NCCL=OFF -DNCCL_INCLUDE_DIR= -DNCCL_ROOT_DIR= -DNCCL_SYSTEM_LIB= -DCAFFE2_STATIC_LINK_CUDA=0 -DUSE_ROCM=0 -DUSE_NNPACK=1 -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF -DUSE_OPENCV=OFF -DUSE_QNNPACK=1 -DUSE_FFMPEG=OFF -DUSE_GLOG=OFF -DUSE_GFLAGS=OFF -DUSE_SYSTEM_EIGEN_INSTALL=OFF -DCUDNN_INCLUDE_DIR= -DCUDNN_LIB_DIR= -DCUDNN_LIBRARY= -DUSE_MKLDNN=0 -DNCCL_EXTERNAL=0 -DCMAKE_INSTALL_PREFIX=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install -DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= '-DCMAKE_EXE_LINKER_FLAGS= -Wl,-rpath,$ORIGIN ' '-DCMAKE_SHARED_LINKER_FLAGS= -Wl,-rpath,$ORIGIN ' -DTHD_SO_VERSION=1 -DCMAKE_PREFIX_PATH=/usr/lib/python3/dist-packages
-- std::exception_ptr is supported.
-- NUMA is disabled
-- Turning off deprecation warning due to glog.
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- Caffe2 protobuf include directory: $<BUILD_INTERFACE:/home/pi/Downloads/pytorch_install/pytorch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
-- The BLAS backend of choice:MKL
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
CMake Warning at cmake/Dependencies.cmake:77 (message):
MKL could not be found. Defaulting to Eigen
Call Stack (most recent call first):
CMakeLists.txt:201 (include)
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [Accelerate]
-- Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
-- Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [openblas]
-- Library openblas: /usr/lib/arm-linux-gnueabihf/libopenblas.so
-- Found a library with BLAS API (open).
-- Brace yourself, we are building NNPACK
-- NNPACK backend is neon
-- Found PythonInterp: /usr/bin/python3 (found version "3.7.3")
-- git Version: v1.4.0-505be96a
-- Version: 1.4.0
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Using third party subdirectory Eigen.
Python 3.7.3
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "2.7")
-- Could NOT find pybind11 (missing: pybind11_DIR)
-- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)
-- Using third_party/pybind11.
--
-- ******** Summary ********
-- CMake version : 3.13.4
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 8.3.0
-- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH : /usr/lib/python3/dist-packages
-- CMAKE_INSTALL_PREFIX : /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
-- CMAKE_MODULE_PATH : /home/pi/Downloads/pytorch_install/pytorch/cmake/Modules
--
-- ONNX version : 1.5.0
-- ONNX NAMESPACE : onnx_torch
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF
-- ONNXIFI_ENABLE_EXT : OFF
--
-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_ONNX_PYTHON : OFF
-- Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- Compiling with OpenMP support
-- MAGMA not found. Compiling without MAGMA support
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Neon found with compiler flag : -mfpu=neon -D__NEON__
-- Atomics: using C11 intrinsics
-- Found a library with LAPACK API. (open)
disabling CUDA because NOT USE_CUDA is set
-- CuDNN not found. Compiling without CuDNN support
disabling ROCM because NOT USE_ROCM is set
-- MIOpen not found. Compiling without MIOpen support
disabling MKLDNN because USE_MKLDNN is not set
-- GCC 8.3.0: Adding gcc and gcc_s libs to link line
-- Using python found in /usr/bin/python3
disabling CUDA because USE_CUDA is set false
-- Configuring build for SLEEF-v3.2
Target system: Linux-4.19.57-v7+
Target processor: armv7l
Host system: Linux-4.19.57-v7+
Host processor: armv7l
Detected C compiler: GNU @ /usr/bin/cc
-- Using option `-Wall -Wno-unused -Wno-attributes -Wno-unused-result -Wno-psabi -ffp-contract=off -fno-math-errno -fno-trapping-math` to compile libsleef
-- Building shared libs : OFF
-- MPFR : LIB_MPFR-NOTFOUND
-- GMP : LIBGMP-NOTFOUND
-- RUNNING_ON_TRAVIS : 0
-- COMPILER_SUPPORTS_OPENMP : 1
-- Using python found in /usr/bin/python3
-- /usr/bin/c++ /home/pi/Downloads/pytorch_install/pytorch/torch/abi-check.cpp -o /home/pi/Downloads/pytorch_install/pytorch/build/abi-check
-- Determined _GLIBCXX_USE_CXX11_ABI=1
-- NCCL operators skipped due to no CUDA support
-- Excluding ideep operators as we are not using ideep
-- Excluding image processing operators due to no opencv
-- Excluding video processing operators due to no opencv
-- MPI operators skipped due to no MPI support
-- Include Observer library
-- Using lib/python3/dist-packages as python relative installation path
-- Automatically generating missing __init__.py files.
-- A previous caffe2 cmake run already created the __init__.py files.
CMake Warning at CMakeLists.txt:389 (message):
Generated cmake files are only fully tested if one builds with system glog,
gflags, and protobuf. Other settings may generate files that are not well
tested.
--
-- ******** Summary ********
-- General:
-- CMake version : 3.13.4
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 8.3.0
-- BLAS : MKL
-- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -D_FORCE_INLINES -D_MWAITXINTRIN_H_INCLUDED -D__STRICT_ANSI__ -fopenmp -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-stringop-overflow
-- Build type : Release
-- Compile definitions : ONNX_NAMESPACE=onnx_torch;USE_C11_ATOMICS=1;HAVE_MMAP=1;_FILE_OFFSET_BITS=64;HAVE_SHM_OPEN=1;HAVE_SHM_UNLINK=1;HAVE_MALLOC_USABLE_SIZE=1
-- CMAKE_PREFIX_PATH : /usr/lib/python3/dist-packages
-- CMAKE_INSTALL_PREFIX : /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
--
-- TORCH_VERSION : 1.0.0
-- CAFFE2_VERSION : 1.0.0
-- BUILD_ATEN_MOBILE : OFF
-- BUILD_ATEN_ONLY : OFF
-- BUILD_BINARY : OFF
-- BUILD_CUSTOM_PROTOBUF : ON
-- Link local protobuf : ON
-- BUILD_DOCS : OFF
-- BUILD_PYTHON : ON
-- Python version : 3.7.3
-- Python executable : /usr/bin/python3
-- Pythonlibs version : 3.7.3
-- Python library : /usr/lib/libpython3.7m.so.1.0
-- Python includes : /usr/include/python3.7m
-- Python site-packages: lib/python3/dist-packages
-- BUILD_CAFFE2_OPS : ON
-- BUILD_SHARED_LIBS : ON
-- BUILD_TEST : ON
-- USE_ASAN : OFF
-- USE_CUDA : 0
-- USE_ROCM : 0
-- USE_EIGEN_FOR_BLAS : ON
-- USE_FBGEMM : 0
-- USE_FFMPEG : OFF
-- USE_GFLAGS : OFF
-- USE_GLOG : OFF
-- USE_LEVELDB : OFF
-- USE_LITE_PROTO : OFF
-- USE_LMDB : OFF
-- USE_METAL : OFF
-- USE_MKL : OFF
-- USE_MKLDNN : OFF
-- USE_MOBILE_OPENGL : OFF
-- USE_NCCL : OFF
-- USE_NNPACK : 1
-- USE_NUMPY : ON
-- USE_OBSERVERS : ON
-- USE_OPENCL : OFF
-- USE_OPENCV : OFF
-- USE_OPENMP : OFF
-- USE_PROF : OFF
-- USE_QNNPACK : 1
-- USE_REDIS : OFF
-- USE_ROCKSDB : OFF
-- USE_ZMQ : OFF
-- USE_DISTRIBUTED : OFF
-- Public Dependencies : Threads::Threads
-- Private Dependencies : qnnpack;nnpack;cpuinfo;fp16;aten_op_header_gen;onnxifi_loader;rt;gcc_s;gcc;dl
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/Downloads/pytorch_install/pytorch/build
+ make install -j4
[ 0%] Built target clog
[ 0%] Built target pthreadpool
[ 2%] Built target libprotobuf-lite
[ 2%] Built target gtest
[ 3%] Built target benchmark
[ 3%] Built target onnxifi_loader
[ 8%] Built target libprotobuf
[ 8%] Built target onnxifi_dummy
[ 8%] Built target common
[ 11%] Built target c10
[ 11%] Built target mkalias
[ 11%] Built target mkrename
[ 11%] Built target ATEN_CPU_FILES_GEN_TARGET
[ 11%] Built target mkmasked_gnuabi
[ 12%] Built target mkrename_gnuabi
[ 12%] Built target mkdisp
[ 12%] Built target arraymap
[ 13%] Built target torch_shm_manager
[ 13%] Built target c10_utils_gpu
[ 13%] Built target c10_utils_cpu
[ 13%] Built target c10_utils_hip
[ 15%] Built target cpuinfo
[ 16%] Built target cpuinfo_internals
[ 16%] Built target nnpack_reference_layers
[ 16%] Built target gtest_main
[ 16%] Built target benchmark_main
[ 22%] Built target libprotoc
[ 22%] Built target onnxifi_wrapper
[ 22%] Built target c10_TypeList_test
[ 22%] Built target c10_InlineDeviceGuard_test
[ 22%] Built target c10_TensorTypeId_test
[ 22%] Built target c10_DeviceGuard_test
[ 22%] Built target c10_TypeTraits_test
[ 22%] Built target c10_OpSchema_test
[ 22%] Built target c10_StreamGuard_test
[ 22%] Built target c10_logging_test
[ 23%] Built target c10_InlineStreamGuard_test
[ 23%] Built target c10_registry_test
[ 23%] Built target c10_Half_test
[ 23%] Built target c10_Array_test
[ 23%] Built target c10_Metaprogramming_test
[ 24%] Built target c10_intrusive_ptr_test
[ 24%] Built target c10_flags_test
[ 24%] Built target c10_typeid_test
[ 24%] Built target alias_neon32.h_generated
[ 24%] Built target renameNEON32.h_generated
[ 24%] Built target __aten_op_header_gen
[ 24%] Built target headers
[ 24%] Built target c10_utils_cpu_test
[ 25%] Built target c10_utils_hip_test
[ 25%] Built target c10_utils_gpu_test
[ 25%] Linking CXX executable ../../../bin/protoc
[ 28%] Built target nnpack
[ 32%] Built target qnnpack
[ 32%] Built target sleefneon32
[ 32%] Built target sleef
/usr/bin/ld: ../../../lib/libprotobuf.a(arena.cc.o): in function `google::protobuf::internal::ArenaImpl::Init()':
arena.cc:(.text+0x24): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[2]: *** [third_party/protobuf/cmake/CMakeFiles/protoc.dir/build.make:87: bin/protoc] Error 1
make[1]: *** [CMakeFiles/Makefile2:241: third_party/protobuf/cmake/CMakeFiles/protoc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 32%] Built target python_copy_files
make: *** [Makefile:141: all] Error 2
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-nnpack --use-qnnpack caffe2'
"><pre class="notranslate"><code class="notranslate">CK=0 USE_DISTRIBUTED=0 python3 setup.py build
Building wheel torch-1.0.0a0+8322165
running build
running build_deps
setup.py::build_deps::run()
+ SYNC_COMMAND=cp
++ command -v rsync
+ '[' -x /usr/bin/rsync ']'
+ SYNC_COMMAND='rsync -lptgoD'
+ CMAKE_COMMAND=cmake
++ command -v cmake3
+ [[ -x '' ]]
+ USE_CUDA=0
+ USE_FBGEMM=0
+ USE_ROCM=0
+ USE_NNPACK=0
+ USE_MKLDNN=0
+ USE_QNNPACK=0
+ USE_GLOO_IBVERBS=0
+ CAFFE2_STATIC_LINK_CUDA=0
+ RERUN_CMAKE=1
+ [[ 3 -gt 0 ]]
+ case "$1" in
+ USE_NNPACK=1
+ shift
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ USE_QNNPACK=1
+ shift
+ [[ 1 -gt 0 ]]
+ case "$1" in
+ break
+ CMAKE_INSTALL='make install'
+ BUILD_SHARED_LIBS=ON
+ USER_CFLAGS=
+ USER_LDFLAGS=
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
++ uname
+ '[' Linux == Darwin ']'
+++ dirname ../tools/build_pytorch_libs.sh
++ cd ../tools/..
+++ pwd
++ printf '%q\n' /home/pi/Downloads/pytorch_install/pytorch
+ BASE_DIR=/home/pi/Downloads/pytorch_install/pytorch
+ TORCH_LIB_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib
+ INSTALL_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ THIRD_PARTY_DIR=/home/pi/Downloads/pytorch_install/pytorch/third_party
+ C_FLAGS=
+ C_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ LDFLAGS=
+ LD_POSTFIX=.so
++ uname
+ [[ Linux == \D\a\r\w\i\n ]]
+ [[ 0 -eq 1 ]]
+ LDFLAGS=' -Wl,-rpath,$ORIGIN'
+ CPP_FLAGS=' -std=c++11 '
+ THD_FLAGS=
+ [[ 0 -eq 1 ]]
+ CUDA_NVCC_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ [[ -z '' ]]
+ CUDA_DEVICE_DEBUG=0
+ '[' -z '' ']'
++ getconf _NPROCESSORS_ONLN
+ MAX_JOBS=4
+ BUILD_TYPE=Release
+ [[ -n '' ]]
+ [[ -n '' ]]
+ echo 'Building in Release mode'
Building in Release mode
+ mkdir -p /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ for arg in "$@"
+ [[ caffe2 == \c\a\f\f\e\2 ]]
+ build_caffe2
+ [[ -z '' ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS=()
+ [[ -n '' ]]
+ [[ -n /usr/lib/python3/dist-packages ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS+=("-DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH")
+ [[ 1 -eq 1 ]]
+ cmake /home/pi/Downloads/pytorch_install/pytorch -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_LIBRARY=/usr/lib/libpython3.7m.so.1.0 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DBUILDING_WITH_TORCH_LIBS=ON -DTORCH_BUILD_VERSION=1.0.0a0+8322165 -DCMAKE_BUILD_TYPE=Release -DBUILD_TORCH=ON -DBUILD_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DBUILD_BINARY=OFF -DBUILD_TEST=ON -DINSTALL_TEST=ON -DBUILD_CAFFE2_OPS=ON -DONNX_NAMESPACE=onnx_torch -DUSE_CUDA=0 -DUSE_DISTRIBUTED=OFF -DUSE_FBGEMM=0 -DUSE_NUMPY= -DNUMPY_INCLUDE_DIR=/usr/lib/python3/dist-packages/numpy/core/include -DUSE_SYSTEM_NCCL=OFF -DNCCL_INCLUDE_DIR= -DNCCL_ROOT_DIR= -DNCCL_SYSTEM_LIB= -DCAFFE2_STATIC_LINK_CUDA=0 -DUSE_ROCM=0 -DUSE_NNPACK=1 -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF -DUSE_OPENCV=OFF -DUSE_QNNPACK=1 -DUSE_FFMPEG=OFF -DUSE_GLOG=OFF -DUSE_GFLAGS=OFF -DUSE_SYSTEM_EIGEN_INSTALL=OFF -DCUDNN_INCLUDE_DIR= -DCUDNN_LIB_DIR= -DCUDNN_LIBRARY= -DUSE_MKLDNN=0 -DNCCL_EXTERNAL=0 -DCMAKE_INSTALL_PREFIX=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install -DCMAKE_C_FLAGS= -DCMAKE_CXX_FLAGS= '-DCMAKE_EXE_LINKER_FLAGS= -Wl,-rpath,$ORIGIN ' '-DCMAKE_SHARED_LINKER_FLAGS= -Wl,-rpath,$ORIGIN ' -DTHD_SO_VERSION=1 -DCMAKE_PREFIX_PATH=/usr/lib/python3/dist-packages
-- std::exception_ptr is supported.
-- NUMA is disabled
-- Turning off deprecation warning due to glog.
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- Caffe2 protobuf include directory: $<BUILD_INTERFACE:/home/pi/Downloads/pytorch_install/pytorch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
-- The BLAS backend of choice:MKL
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
CMake Warning at cmake/Dependencies.cmake:77 (message):
MKL could not be found. Defaulting to Eigen
Call Stack (most recent call first):
CMakeLists.txt:201 (include)
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [Accelerate]
-- Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
-- Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [openblas]
-- Library openblas: /usr/lib/arm-linux-gnueabihf/libopenblas.so
-- Found a library with BLAS API (open).
-- Brace yourself, we are building NNPACK
-- NNPACK backend is neon
-- Found PythonInterp: /usr/bin/python3 (found version "3.7.3")
-- git Version: v1.4.0-505be96a
-- Version: 1.4.0
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Using third party subdirectory Eigen.
Python 3.7.3
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is "2.7")
-- Could NOT find pybind11 (missing: pybind11_DIR)
-- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)
-- Using third_party/pybind11.
--
-- ******** Summary ********
-- CMake version : 3.13.4
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 8.3.0
-- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH : /usr/lib/python3/dist-packages
-- CMAKE_INSTALL_PREFIX : /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
-- CMAKE_MODULE_PATH : /home/pi/Downloads/pytorch_install/pytorch/cmake/Modules
--
-- ONNX version : 1.5.0
-- ONNX NAMESPACE : onnx_torch
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF
-- ONNXIFI_ENABLE_EXT : OFF
--
-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_ONNX_PYTHON : OFF
-- Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- Compiling with OpenMP support
-- MAGMA not found. Compiling without MAGMA support
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Neon found with compiler flag : -mfpu=neon -D__NEON__
-- Atomics: using C11 intrinsics
-- Found a library with LAPACK API. (open)
disabling CUDA because NOT USE_CUDA is set
-- CuDNN not found. Compiling without CuDNN support
disabling ROCM because NOT USE_ROCM is set
-- MIOpen not found. Compiling without MIOpen support
disabling MKLDNN because USE_MKLDNN is not set
-- GCC 8.3.0: Adding gcc and gcc_s libs to link line
-- Using python found in /usr/bin/python3
disabling CUDA because USE_CUDA is set false
-- Configuring build for SLEEF-v3.2
Target system: Linux-4.19.57-v7+
Target processor: armv7l
Host system: Linux-4.19.57-v7+
Host processor: armv7l
Detected C compiler: GNU @ /usr/bin/cc
-- Using option `-Wall -Wno-unused -Wno-attributes -Wno-unused-result -Wno-psabi -ffp-contract=off -fno-math-errno -fno-trapping-math` to compile libsleef
-- Building shared libs : OFF
-- MPFR : LIB_MPFR-NOTFOUND
-- GMP : LIBGMP-NOTFOUND
-- RUNNING_ON_TRAVIS : 0
-- COMPILER_SUPPORTS_OPENMP : 1
-- Using python found in /usr/bin/python3
-- /usr/bin/c++ /home/pi/Downloads/pytorch_install/pytorch/torch/abi-check.cpp -o /home/pi/Downloads/pytorch_install/pytorch/build/abi-check
-- Determined _GLIBCXX_USE_CXX11_ABI=1
-- NCCL operators skipped due to no CUDA support
-- Excluding ideep operators as we are not using ideep
-- Excluding image processing operators due to no opencv
-- Excluding video processing operators due to no opencv
-- MPI operators skipped due to no MPI support
-- Include Observer library
-- Using lib/python3/dist-packages as python relative installation path
-- Automatically generating missing __init__.py files.
-- A previous caffe2 cmake run already created the __init__.py files.
CMake Warning at CMakeLists.txt:389 (message):
Generated cmake files are only fully tested if one builds with system glog,
gflags, and protobuf. Other settings may generate files that are not well
tested.
--
-- ******** Summary ********
-- General:
-- CMake version : 3.13.4
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 8.3.0
-- BLAS : MKL
-- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -D_FORCE_INLINES -D_MWAITXINTRIN_H_INCLUDED -D__STRICT_ANSI__ -fopenmp -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-stringop-overflow
-- Build type : Release
-- Compile definitions : ONNX_NAMESPACE=onnx_torch;USE_C11_ATOMICS=1;HAVE_MMAP=1;_FILE_OFFSET_BITS=64;HAVE_SHM_OPEN=1;HAVE_SHM_UNLINK=1;HAVE_MALLOC_USABLE_SIZE=1
-- CMAKE_PREFIX_PATH : /usr/lib/python3/dist-packages
-- CMAKE_INSTALL_PREFIX : /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
--
-- TORCH_VERSION : 1.0.0
-- CAFFE2_VERSION : 1.0.0
-- BUILD_ATEN_MOBILE : OFF
-- BUILD_ATEN_ONLY : OFF
-- BUILD_BINARY : OFF
-- BUILD_CUSTOM_PROTOBUF : ON
-- Link local protobuf : ON
-- BUILD_DOCS : OFF
-- BUILD_PYTHON : ON
-- Python version : 3.7.3
-- Python executable : /usr/bin/python3
-- Pythonlibs version : 3.7.3
-- Python library : /usr/lib/libpython3.7m.so.1.0
-- Python includes : /usr/include/python3.7m
-- Python site-packages: lib/python3/dist-packages
-- BUILD_CAFFE2_OPS : ON
-- BUILD_SHARED_LIBS : ON
-- BUILD_TEST : ON
-- USE_ASAN : OFF
-- USE_CUDA : 0
-- USE_ROCM : 0
-- USE_EIGEN_FOR_BLAS : ON
-- USE_FBGEMM : 0
-- USE_FFMPEG : OFF
-- USE_GFLAGS : OFF
-- USE_GLOG : OFF
-- USE_LEVELDB : OFF
-- USE_LITE_PROTO : OFF
-- USE_LMDB : OFF
-- USE_METAL : OFF
-- USE_MKL : OFF
-- USE_MKLDNN : OFF
-- USE_MOBILE_OPENGL : OFF
-- USE_NCCL : OFF
-- USE_NNPACK : 1
-- USE_NUMPY : ON
-- USE_OBSERVERS : ON
-- USE_OPENCL : OFF
-- USE_OPENCV : OFF
-- USE_OPENMP : OFF
-- USE_PROF : OFF
-- USE_QNNPACK : 1
-- USE_REDIS : OFF
-- USE_ROCKSDB : OFF
-- USE_ZMQ : OFF
-- USE_DISTRIBUTED : OFF
-- Public Dependencies : Threads::Threads
-- Private Dependencies : qnnpack;nnpack;cpuinfo;fp16;aten_op_header_gen;onnxifi_loader;rt;gcc_s;gcc;dl
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/Downloads/pytorch_install/pytorch/build
+ make install -j4
[ 0%] Built target clog
[ 0%] Built target pthreadpool
[ 2%] Built target libprotobuf-lite
[ 2%] Built target gtest
[ 3%] Built target benchmark
[ 3%] Built target onnxifi_loader
[ 8%] Built target libprotobuf
[ 8%] Built target onnxifi_dummy
[ 8%] Built target common
[ 11%] Built target c10
[ 11%] Built target mkalias
[ 11%] Built target mkrename
[ 11%] Built target ATEN_CPU_FILES_GEN_TARGET
[ 11%] Built target mkmasked_gnuabi
[ 12%] Built target mkrename_gnuabi
[ 12%] Built target mkdisp
[ 12%] Built target arraymap
[ 13%] Built target torch_shm_manager
[ 13%] Built target c10_utils_gpu
[ 13%] Built target c10_utils_cpu
[ 13%] Built target c10_utils_hip
[ 15%] Built target cpuinfo
[ 16%] Built target cpuinfo_internals
[ 16%] Built target nnpack_reference_layers
[ 16%] Built target gtest_main
[ 16%] Built target benchmark_main
[ 22%] Built target libprotoc
[ 22%] Built target onnxifi_wrapper
[ 22%] Built target c10_TypeList_test
[ 22%] Built target c10_InlineDeviceGuard_test
[ 22%] Built target c10_TensorTypeId_test
[ 22%] Built target c10_DeviceGuard_test
[ 22%] Built target c10_TypeTraits_test
[ 22%] Built target c10_OpSchema_test
[ 22%] Built target c10_StreamGuard_test
[ 22%] Built target c10_logging_test
[ 23%] Built target c10_InlineStreamGuard_test
[ 23%] Built target c10_registry_test
[ 23%] Built target c10_Half_test
[ 23%] Built target c10_Array_test
[ 23%] Built target c10_Metaprogramming_test
[ 24%] Built target c10_intrusive_ptr_test
[ 24%] Built target c10_flags_test
[ 24%] Built target c10_typeid_test
[ 24%] Built target alias_neon32.h_generated
[ 24%] Built target renameNEON32.h_generated
[ 24%] Built target __aten_op_header_gen
[ 24%] Built target headers
[ 24%] Built target c10_utils_cpu_test
[ 25%] Built target c10_utils_hip_test
[ 25%] Built target c10_utils_gpu_test
[ 25%] Linking CXX executable ../../../bin/protoc
[ 28%] Built target nnpack
[ 32%] Built target qnnpack
[ 32%] Built target sleefneon32
[ 32%] Built target sleef
/usr/bin/ld: ../../../lib/libprotobuf.a(arena.cc.o): in function `google::protobuf::internal::ArenaImpl::Init()':
arena.cc:(.text+0x24): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[2]: *** [third_party/protobuf/cmake/CMakeFiles/protoc.dir/build.make:87: bin/protoc] Error 1
make[1]: *** [CMakeFiles/Makefile2:241: third_party/protobuf/cmake/CMakeFiles/protoc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 32%] Built target python_copy_files
make: *** [Makefile:141: all] Error 2
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-nnpack --use-qnnpack caffe2'
</code></pre></div>
<p dir="auto">3.1. if I compile Pytorch like this, error message was changed</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sudo python3 setup.py build"><pre class="notranslate"><code class="notranslate">sudo python3 setup.py build
</code></pre></div>
<p dir="auto">full error message</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Building wheel torch-1.0.0a0+8322165
running build
running build_deps
setup.py::build_deps::run()
+ SYNC_COMMAND=cp
++ command -v rsync
+ '[' -x /usr/bin/rsync ']'
+ SYNC_COMMAND='rsync -lptgoD'
+ CMAKE_COMMAND=cmake
++ command -v cmake3
+ [[ -x '' ]]
+ USE_CUDA=0
+ USE_FBGEMM=0
+ USE_ROCM=0
+ USE_NNPACK=0
+ USE_MKLDNN=0
+ USE_QNNPACK=0
+ USE_GLOO_IBVERBS=0
+ CAFFE2_STATIC_LINK_CUDA=0
+ RERUN_CMAKE=1
+ [[ 4 -gt 0 ]]
+ case "$1" in
+ USE_NNPACK=1
+ shift
+ [[ 3 -gt 0 ]]
+ case "$1" in
+ USE_MKLDNN=1
+ shift
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ USE_QNNPACK=1
+ shift
+ [[ 1 -gt 0 ]]
+ case "$1" in
+ break
+ CMAKE_INSTALL='make install'
+ BUILD_SHARED_LIBS=ON
+ USER_CFLAGS=
+ USER_LDFLAGS=
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
++ uname
+ '[' Linux == Darwin ']'
+++ dirname ../tools/build_pytorch_libs.sh
++ cd ../tools/..
+++ pwd
++ printf '%q\n' /home/pi/Downloads/pytorch_install/pytorch
+ BASE_DIR=/home/pi/Downloads/pytorch_install/pytorch
+ TORCH_LIB_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib
+ INSTALL_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ THIRD_PARTY_DIR=/home/pi/Downloads/pytorch_install/pytorch/third_party
+ C_FLAGS=
+ C_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ LDFLAGS=
+ LD_POSTFIX=.so
++ uname
+ [[ Linux == \D\a\r\w\i\n ]]
+ [[ 0 -eq 1 ]]
+ LDFLAGS=' -Wl,-rpath,$ORIGIN'
+ CPP_FLAGS=' -std=c++11 '
+ THD_FLAGS=
+ [[ 0 -eq 1 ]]
+ CUDA_NVCC_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ [[ -z '' ]]
+ CUDA_DEVICE_DEBUG=0
+ '[' -z '' ']'
++ getconf _NPROCESSORS_ONLN
+ MAX_JOBS=4
+ BUILD_TYPE=Release
+ [[ -n '' ]]
+ [[ -n '' ]]
+ echo 'Building in Release mode'
Building in Release mode
+ mkdir -p /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ for arg in "$@"
+ [[ caffe2 == \c\a\f\f\e\2 ]]
+ build_caffe2
+ [[ -z '' ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS=()
+ [[ -n '' ]]
+ [[ -n /usr/lib/python3/dist-packages ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS+=("-DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH")
+ [[ 1 -eq 1 ]]
+ cmake /home/pi/Downloads/pytorch_install/pytorch -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTH ON_LIBRARY=/usr/lib/libpython3.7m.so.1.0 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DBUILDI NG_WITH_TORCH_LIBS=ON -DTORCH_BUILD_VERSION=1.0.0a0+8322165 -DCMAKE_BUILD_TYPE=Release -DBUILD _TORCH=ON -DBUILD_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DBUILD_BINARY=OFF -DBUILD_TEST=ON -DINSTAL L_TEST=ON -DBUILD_CAFFE2_OPS=ON -DONNX_NAMESPACE=onnx_torch -DUSE_CUDA=0 -DUSE_DISTRIBUTED=ON -DUSE_FBGEMM=0 -DUSE_NUMPY= -DNUMPY_INCLUDE_DIR=/usr/lib/python3/dist-packages/numpy/core/incl ude -DUSE_SYSTEM_NCCL=OFF -DNCCL_INCLUDE_DIR= -DNCCL_ROOT_DIR= -DNCCL_SYSTEM_LIB= -DCAFFE2_STA TIC_LINK_CUDA=0 -DUSE_ROCM=0 -DUSE_NNPACK=1 -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF -DUSE_OPENCV=OFF -DUSE_QNNPACK=1 -DUSE_FFMPEG=OFF -DUSE_GLOG=OFF -DUSE_GFLAGS=OFF -DUSE_SYSTEM_EIGEN_INSTALL=OF F -DCUDNN_INCLUDE_DIR= -DCUDNN_LIB_DIR= -DCUDNN_LIBRARY= -DUSE_MKLDNN=1 -DNCCL_EXTERNAL=0 -DCM AKE_INSTALL_PREFIX=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install -DCMAKE_C_ FLAGS= -DCMAKE_CXX_FLAGS= '-DCMAKE_EXE_LINKER_FLAGS= -Wl,-rpath,$ORIGIN ' '-DCMAKE_SHARED_LINK ER_FLAGS= -Wl,-rpath,$ORIGIN ' -DTHD_SO_VERSION=1 -DCMAKE_PREFIX_PATH=/usr/lib/python3/dist-pa ckages
-- std::exception_ptr is supported.
-- NUMA is disabled
-- Turning off deprecation warning due to glog.
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- Caffe2 protobuf include directory: $<BUILD_INTERFACE:/home/pi/Downloads/pytorch_install/pyt orch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
-- The BLAS backend of choice:MKL
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
CMake Warning at cmake/Dependencies.cmake:77 (message):
MKL could not be found. Defaulting to Eigen
Call Stack (most recent call first):
CMakeLists.txt:201 (include)
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [Accelerate]
-- Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
-- Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [openblas]
-- Library openblas: /usr/lib/arm-linux-gnueabihf/libopenblas.so
-- Found a library with BLAS API (open).
-- Brace yourself, we are building NNPACK
-- NNPACK backend is neon
-- Found PythonInterp: /usr/bin/python3 (found version "3.7.3")
-- git Version: v1.4.0-505be96a
-- Version: 1.4.0
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Using third party subdirectory Eigen.
Python 3.7.3
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is " 2.7")
-- Could NOT find pybind11 (missing: pybind11_DIR)
-- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)
-- Using third_party/pybind11.
--
-- ******** Summary ********
-- CMake version : 3.13.4
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 8.3.0
-- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH : /usr/lib/python3/dist-packages
-- CMAKE_INSTALL_PREFIX : /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
-- CMAKE_MODULE_PATH : /home/pi/Downloads/pytorch_install/pytorch/cmake/Modules
--
-- ONNX version : 1.5.0
-- ONNX NAMESPACE : onnx_torch
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF
-- ONNXIFI_ENABLE_EXT : OFF
--
-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_ONNX_PYTHON : OFF
-- Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- Compiling with OpenMP support
-- MAGMA not found. Compiling without MAGMA support
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Neon found with compiler flag : -mfpu=neon -D__NEON__
-- Atomics: using C11 intrinsics
-- Found a library with LAPACK API. (open)
disabling CUDA because NOT USE_CUDA is set
-- CuDNN not found. Compiling without CuDNN support
disabling ROCM because NOT USE_ROCM is set
-- MIOpen not found. Compiling without MIOpen support
CMake Error at third_party/ideep/mkl-dnn/CMakeLists.txt:59 (message):
Intel(R) MKL-DNN supports 64 bit platforms only
-- Configuring incomplete, errors occurred!
See also "/home/pi/Downloads/pytorch_install/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/Downloads/pytorch_install/pytorch/build/CMakeFiles/CMakeError.log".
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-nnpack --use-mkldnn --use-qnnpack caffe2'
"><pre class="notranslate"><code class="notranslate">Building wheel torch-1.0.0a0+8322165
running build
running build_deps
setup.py::build_deps::run()
+ SYNC_COMMAND=cp
++ command -v rsync
+ '[' -x /usr/bin/rsync ']'
+ SYNC_COMMAND='rsync -lptgoD'
+ CMAKE_COMMAND=cmake
++ command -v cmake3
+ [[ -x '' ]]
+ USE_CUDA=0
+ USE_FBGEMM=0
+ USE_ROCM=0
+ USE_NNPACK=0
+ USE_MKLDNN=0
+ USE_QNNPACK=0
+ USE_GLOO_IBVERBS=0
+ CAFFE2_STATIC_LINK_CUDA=0
+ RERUN_CMAKE=1
+ [[ 4 -gt 0 ]]
+ case "$1" in
+ USE_NNPACK=1
+ shift
+ [[ 3 -gt 0 ]]
+ case "$1" in
+ USE_MKLDNN=1
+ shift
+ [[ 2 -gt 0 ]]
+ case "$1" in
+ USE_QNNPACK=1
+ shift
+ [[ 1 -gt 0 ]]
+ case "$1" in
+ break
+ CMAKE_INSTALL='make install'
+ BUILD_SHARED_LIBS=ON
+ USER_CFLAGS=
+ USER_LDFLAGS=
+ [[ -n '' ]]
+ [[ -n '' ]]
+ [[ -n '' ]]
++ uname
+ '[' Linux == Darwin ']'
+++ dirname ../tools/build_pytorch_libs.sh
++ cd ../tools/..
+++ pwd
++ printf '%q\n' /home/pi/Downloads/pytorch_install/pytorch
+ BASE_DIR=/home/pi/Downloads/pytorch_install/pytorch
+ TORCH_LIB_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib
+ INSTALL_DIR=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ THIRD_PARTY_DIR=/home/pi/Downloads/pytorch_install/pytorch/third_party
+ C_FLAGS=
+ C_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ LDFLAGS=
+ LD_POSTFIX=.so
++ uname
+ [[ Linux == \D\a\r\w\i\n ]]
+ [[ 0 -eq 1 ]]
+ LDFLAGS=' -Wl,-rpath,$ORIGIN'
+ CPP_FLAGS=' -std=c++11 '
+ THD_FLAGS=
+ [[ 0 -eq 1 ]]
+ CUDA_NVCC_FLAGS=' -DOMPI_SKIP_MPICXX=1'
+ [[ -z '' ]]
+ CUDA_DEVICE_DEBUG=0
+ '[' -z '' ']'
++ getconf _NPROCESSORS_ONLN
+ MAX_JOBS=4
+ BUILD_TYPE=Release
+ [[ -n '' ]]
+ [[ -n '' ]]
+ echo 'Building in Release mode'
Building in Release mode
+ mkdir -p /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
+ for arg in "$@"
+ [[ caffe2 == \c\a\f\f\e\2 ]]
+ build_caffe2
+ [[ -z '' ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS=()
+ [[ -n '' ]]
+ [[ -n /usr/lib/python3/dist-packages ]]
+ EXTRA_CAFFE2_CMAKE_FLAGS+=("-DCMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH")
+ [[ 1 -eq 1 ]]
+ cmake /home/pi/Downloads/pytorch_install/pytorch -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTH ON_LIBRARY=/usr/lib/libpython3.7m.so.1.0 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m -DBUILDI NG_WITH_TORCH_LIBS=ON -DTORCH_BUILD_VERSION=1.0.0a0+8322165 -DCMAKE_BUILD_TYPE=Release -DBUILD _TORCH=ON -DBUILD_PYTHON=ON -DBUILD_SHARED_LIBS=ON -DBUILD_BINARY=OFF -DBUILD_TEST=ON -DINSTAL L_TEST=ON -DBUILD_CAFFE2_OPS=ON -DONNX_NAMESPACE=onnx_torch -DUSE_CUDA=0 -DUSE_DISTRIBUTED=ON -DUSE_FBGEMM=0 -DUSE_NUMPY= -DNUMPY_INCLUDE_DIR=/usr/lib/python3/dist-packages/numpy/core/incl ude -DUSE_SYSTEM_NCCL=OFF -DNCCL_INCLUDE_DIR= -DNCCL_ROOT_DIR= -DNCCL_SYSTEM_LIB= -DCAFFE2_STA TIC_LINK_CUDA=0 -DUSE_ROCM=0 -DUSE_NNPACK=1 -DUSE_LEVELDB=OFF -DUSE_LMDB=OFF -DUSE_OPENCV=OFF -DUSE_QNNPACK=1 -DUSE_FFMPEG=OFF -DUSE_GLOG=OFF -DUSE_GFLAGS=OFF -DUSE_SYSTEM_EIGEN_INSTALL=OF F -DCUDNN_INCLUDE_DIR= -DCUDNN_LIB_DIR= -DCUDNN_LIBRARY= -DUSE_MKLDNN=1 -DNCCL_EXTERNAL=0 -DCM AKE_INSTALL_PREFIX=/home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install -DCMAKE_C_ FLAGS= -DCMAKE_CXX_FLAGS= '-DCMAKE_EXE_LINKER_FLAGS= -Wl,-rpath,$ORIGIN ' '-DCMAKE_SHARED_LINK ER_FLAGS= -Wl,-rpath,$ORIGIN ' -DTHD_SO_VERSION=1 -DCMAKE_PREFIX_PATH=/usr/lib/python3/dist-pa ckages
-- std::exception_ptr is supported.
-- NUMA is disabled
-- Turning off deprecation warning due to glog.
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- Caffe2 protobuf include directory: $<BUILD_INTERFACE:/home/pi/Downloads/pytorch_install/pyt orch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
-- The BLAS backend of choice:MKL
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
CMake Warning at cmake/Dependencies.cmake:77 (message):
MKL could not be found. Defaulting to Eigen
Call Stack (most recent call first):
CMakeLists.txt:201 (include)
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
-- Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [Accelerate]
-- Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
-- Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [openblas]
-- Library openblas: /usr/lib/arm-linux-gnueabihf/libopenblas.so
-- Found a library with BLAS API (open).
-- Brace yourself, we are building NNPACK
-- NNPACK backend is neon
-- Found PythonInterp: /usr/bin/python3 (found version "3.7.3")
-- git Version: v1.4.0-505be96a
-- Version: 1.4.0
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Using third party subdirectory Eigen.
Python 3.7.3
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.7.3", minimum required is " 2.7")
-- Could NOT find pybind11 (missing: pybind11_DIR)
-- Could NOT find pybind11 (missing: pybind11_INCLUDE_DIR)
-- Using third_party/pybind11.
--
-- ******** Summary ********
-- CMake version : 3.13.4
-- CMake command : /usr/bin/cmake
-- System : Linux
-- C++ compiler : /usr/bin/c++
-- C++ compiler version : 8.3.0
-- CXX flags : -Wno-deprecated -fvisibility-inlines-hidden -Wnon-virtual-dtor
-- Build type : Release
-- Compile definitions :
-- CMAKE_PREFIX_PATH : /usr/lib/python3/dist-packages
-- CMAKE_INSTALL_PREFIX : /home/pi/Downloads/pytorch_install/pytorch/torch/lib/tmp_install
-- CMAKE_MODULE_PATH : /home/pi/Downloads/pytorch_install/pytorch/cmake/Modules
--
-- ONNX version : 1.5.0
-- ONNX NAMESPACE : onnx_torch
-- ONNX_BUILD_TESTS : OFF
-- ONNX_BUILD_BENCHMARKS : OFF
-- ONNX_USE_LITE_PROTO : OFF
-- ONNXIFI_DUMMY_BACKEND : OFF
-- ONNXIFI_ENABLE_EXT : OFF
--
-- Protobuf compiler :
-- Protobuf includes :
-- Protobuf libraries :
-- BUILD_ONNX_PYTHON : OFF
-- Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- Compiling with OpenMP support
-- MAGMA not found. Compiling without MAGMA support
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Neon found with compiler flag : -mfpu=neon -D__NEON__
-- Atomics: using C11 intrinsics
-- Found a library with LAPACK API. (open)
disabling CUDA because NOT USE_CUDA is set
-- CuDNN not found. Compiling without CuDNN support
disabling ROCM because NOT USE_ROCM is set
-- MIOpen not found. Compiling without MIOpen support
CMake Error at third_party/ideep/mkl-dnn/CMakeLists.txt:59 (message):
Intel(R) MKL-DNN supports 64 bit platforms only
-- Configuring incomplete, errors occurred!
See also "/home/pi/Downloads/pytorch_install/pytorch/build/CMakeFiles/CMakeOutput.log".
See also "/home/pi/Downloads/pytorch_install/pytorch/build/CMakeFiles/CMakeError.log".
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-nnpack --use-mkldnn --use-qnnpack caffe2'
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">build this setup.py please</p>
<h2 dir="auto">Environment</h2>
<p dir="auto">model: Raspberry Pi 3 Model B V1.2<br>
PyTorch version: N/A<br>
Is debug build: N/A<br>
CUDA used to build PyTorch: N/A</p>
<p dir="auto">OS: Raspbian GNU/Linux 10 (buster)<br>
GCC version: (Raspbian 8.3.0-6+rpi1) 8.3.0<br>
CMake version: version 3.13.4</p>
<p dir="auto">Python version: 3.7<br>
Is CUDA available: N/A<br>
CUDA runtime version: Could not collect<br>
GPU models and configuration: Could not collect<br>
Nvidia driver version: Could not collect<br>
cuDNN version: Could not collect</p>
<p dir="auto">Versions of relevant libraries:<br>
[pip3] numpy==1.16.2<br>
[conda] Could not collect</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">When you see the front of full error message, You can see USE_NNPACK, USE__QNNPACK, USE_MKLDNN change 0 to 1.<br>
I don't know why it is changed.<br>
Also, when I run</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sudo USE_MKLDNN=0 USE_QNNPACK=0 USE_NNPACK=0 USE_DISTRIBUTED=0 python3 setup.py build"><pre class="notranslate"><code class="notranslate">sudo USE_MKLDNN=0 USE_QNNPACK=0 USE_NNPACK=0 USE_DISTRIBUTED=0 python3 setup.py build
</code></pre></div>
<p dir="auto">why only USE_MKLDNN is OFF, when others are still 1<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/37619253/65217916-4f5cd180-daf0-11e9-8db2-3a0f642681c6.PNG"><img src="https://user-images.githubusercontent.com/37619253/65217916-4f5cd180-daf0-11e9-8db2-3a0f642681c6.PNG" alt="ee3" style="max-width: 100%;"></a></p>
<p dir="auto">cc <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gujinghui/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gujinghui">@gujinghui</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/PenghuiCheng/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/PenghuiCheng">@PenghuiCheng</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/XiaobingSuper/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/XiaobingSuper">@XiaobingSuper</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jianyuh/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jianyuh">@jianyuh</a></p> | <div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=">>> torch.norm_except_dim
<built-in method norm_except_dim of type object at 0x115b20ad0>"><pre class="notranslate"><code class="notranslate">>>> torch.norm_except_dim
<built-in method norm_except_dim of type object at 0x115b20ad0>
</code></pre></div> | 0 |
<p dir="auto">when i pin windows terminal to taskbar, i would like to have access to adminstrator mode.<br>
please add run as aminstrator in right click on icon in taskbar<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/20259070/66647956-29ca7000-ec37-11e9-841f-9e604c2d98ee.png"><img src="https://user-images.githubusercontent.com/20259070/66647956-29ca7000-ec37-11e9-841f-9e604c2d98ee.png" alt="Annotation 2019-10-11 145506" style="max-width: 100%;"></a></p> | <h1 dir="auto">Environment</h1>
<p dir="auto">Hi, Recently I installed to PL/1 compiler from Iron-Spring <a href="http://www.iron-spring.com/index.html" rel="nofollow">http://www.iron-spring.com/index.html</a> for Linux in the New Windows Terminal under WSL(Windows Subsystem for Linux), But I heard from certain online forums that the WSL of Windows will support only 64-bit executables and no 32-bit executables, Unfortunately the above-mentioned PL/1 compiler is a 32-bit compiler, so I tried to many times to get that working, but unable to do so, and I kept on getting the below error,</p>
<p dir="auto">-bash: ./plic: cannot execute binary file: Exec format error</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/49483717/67143141-e8b10c00-f285-11e9-8c31-497835c9c80d.png"><img src="https://user-images.githubusercontent.com/49483717/67143141-e8b10c00-f285-11e9-8c31-497835c9c80d.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">To you have any plans to implement the feature to support 32-bit executables in WSL and also in the final version of Windows New Terminal 1.0? If so when?</p>
<p dir="auto">Also technically we cannot execute a 64-bit executable on a 32-bit operating system, but the other way round should be possible with certain minor changes in the system,</p>
<p dir="auto">At last, I achieved the above action using some additional installation given in the below link,</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="254810432" data-permission-text="Title is private" data-url="https://github.com/microsoft/WSL/issues/2468" data-hovercard-type="issue" data-hovercard-url="/microsoft/WSL/issues/2468/hovercard?comment_id=374904520&comment_type=issue_comment" href="https://github.com/microsoft/WSL/issues/2468#issuecomment-374904520">microsoft/WSL#2468 (comment)</a></p>
<h1 dir="auto">Steps to reproduce</h1>
<p dir="auto">Try to execute a 32-bit executable you will get this error.</p>
<h1 dir="auto">Expected behavior</h1>
<p dir="auto">The windows terminal should execute 32-bit executables without throwing any error</p>
<h1 dir="auto">Actual behavior</h1>
<p dir="auto">The windows terminal throws a blank error without proper error descritption when a 32-bit executable is tried</p> | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.