Managing quotes for attachment filename + optional blob checking

Hello,
if some controller sends an email with an attachment, that attachment may have spaces or non-ASCII characters (for any reasons..)...
The MimeType header for that attachment may be something like:

application/octet-stream; name=filename.pdf (in place)
OR
application/octet-stream; name="filename whatever.pdf" (not tolerated by Zenstruck's mailer test)
OR possibly a variant with single quotes

So far the check relies on the filename to deduce the above header construction:
https://github.com/zenstruck/mailer-test/blob/1.x/src/TestEmail.php#L254
Could the code please tolerate body headers with or without simple or double quotes for mime-type + filename?

Sometimes the attached file binary data is flaky / variable...
Which makes that we may do want to compare filename, mimeType... but not blob data.
At best, TestEmail->assertHasFile() should provide optional parameter values...

Interesting, can you show me a code example where single quotes and double quoted would be used? I'd like to create a failing test.

Per https://blog.nodemailer.com/2017/01/27/the-mess-that-is-attachment-filenames/
Subject: This is a test message↵
MIME-Version: 1.0↵
Content-Type: multipart/mixed; boundary=abc↵
↵
--abc↵
Content-Type: text/plain↵
↵
Test content↵
↵
--abc↵
Content-Type: application/octet-stream;↵
    name="test.txt"↵
Content-Transfer-Encoding: base64↵
↵
Q2F0↵
--abc--↵

and
Content-Disposition: attachment;↵
    filename*=utf-8''%F0%9F%98%81%F0%9F%98%82.txt

Here filename= has quotes... But it seems there are not always quotes on the web...
I am using Symfony\Bridge\Twig\Mime\TemplatedEmail
        $email = (new TemplatedEmail())
            ->from($from)
            ->to($to)
            ->subject($subject)
            ->attach($invoicePdf, $this->fileHelper->getInvoicePdfFileName($invoice))
            ->htmlTemplate('email/invoice/send.html.twig')
            ->context($context);

            $this->mailer->send($email);

Excerpt from my unit test:
        // bugged assertHasFile, see https://github.com/zenstruck/mailer-test/issues/19
        //        $sentEmail->assertHasFile(
        //            sprintf('"%s"', ),
        //            'application/octet-stream',
        //            $this->pdfService->createInvoicePdf($randomUnsentContractlessInvoice)
        //        );
        $expectedFilename = $this->fileHelper->getInvoicePdfFileName($randomUnsentContractlessInvoice);
        $expectedContentType = 'application/octet-stream';

        $this->assertCount(1, $sentEmail->getAttachments());
        $attachment = $sentEmail->getAttachments()[0];
        $this->assertEquals($expectedFilename, $sentEmail->getAttachments()[0]->getPreparedHeaders()->get('content-disposition')->getParameter('filename'));
        $this->assertEquals($expectedContentType.'; name="'.$expectedFilename.'"', $attachment->getPreparedHeaders()->get('content-type')->getBodyAsString());
        // Not comparing unstable PDF output
        //$this->assertEquals($this->pdfService->createInvoicePdf($randomUnsentContractlessInvoice), $attachment->getBody());

Thank you!

@myselfhimself, can you test #20 and see if this fixes your problem?
I'd still like to add a test for this. Above, can you give an example of what $this->fileHelper->getInvoicePdfFileName($invoice) returns that causes quotes?

Hello, $this->fileHelper->getInvoicePdfFileName($invoice) returns a PHP String without quotes itself:

either invoice-17.pdf
or invoice-A Fixture generated Invoice Id 17.pdf

I will test #20 tomorrow. Thank you very much for being so reactive!

What would be nice is to have assertHasFile()'s parameters 2 (mime typing) and 3 (binary blob) to be optional.
Namely in my case, the binary blob is not generated idempotently by my PDF generator (wkhtmltopdf from a twig template), so I have no way to test with assertHasFile() because of its compulsory parameter 3.

or invoice-A Fixture generated Invoice Id 17.pdf
Ah, quotes are added when the filename has a space. Thanks, #20 now includes a test to prove it works.

What would be nice is to have assertHasFile()'s parameters 2 (mime typing) and 3 (binary blob) to be optional.

Agreed! I'm going to add this to #20.

I've merged #20 so test the latest 1.x branch. If it works for you I'll tag a release.

Hello, just git cloned branch.
        $sentEmail->assertHasFile(
            $this->fileHelper->getInvoicePdfFileName($randomUnsentContractlessInvoice), // with value like: "aah-invoice-2022-01-56 (from quote).pdf" (without quotes in string)
            'application/octet-stream',
//            $this->pdfService->createInvoicePdf($randomUnsentContractlessInvoice)
        );

is passing.
        $sentEmail->assertHasFile(
            $this->fileHelper->getInvoicePdfFileName($randomUnsentContractlessInvoice),
//            'application/octet-stream',
//            $this->pdfService->createInvoicePdf($randomUnsentContractlessInvoice)
        );

is passing.
Testing weasyprint instead of knpsnappy (wkhtmltopdf) to ensure pdf idempotency maybe..

weasyprint isn't idempotent as well... will not test more

Thanks, I've created a release.


state of "nameserver" attribute is not preserved properly

When using cloud-init to provision my VMs the nameserver attribute works and my VMs are configured with a working configuration.   But if I then do a "terraform plan", it shows the nameserver attribute as needing to be updated from empty to its correct value.   Do an "apply", and it runs successfully, but then still "plan" shows the nameserver attribute as needing to be updated, ad infinitum.
Create the VM:
[matthewm@localhost terraform]$ terraform apply

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + proxmox_vm_qemu.nodes
      id:                           <computed>
      agent:                        "0"
      clone:                        "ubuntu16tpl-ci02"
      cores:                        "1"
      disk.#:                       "1"
      disk.275044859.backup:        "false"
      disk.275044859.cache:         "none"
      disk.275044859.format:        "raw"
      disk.275044859.id:            "0"
      disk.275044859.iothread:      "false"
      disk.275044859.replicate:     "false"
      disk.275044859.size:          "40G"
      disk.275044859.storage:       "local-lvm"
      disk.275044859.storage_type:  "dir"
      disk.275044859.type:          "scsi"
      force_create:                 "false"
      ipconfig0:                    "ip=<IP_ADDRESS>/22,gw=<IP_ADDRESS>"
      memory:                       "4096"
      name:                         "nstest"
      nameserver:                   "<IP_ADDRESS>"
      network.#:                    "1"
      network.3002513143.bridge:    "vmbr0"
      network.3002513143.firewall:  "false"
      network.3002513143.id:        "0"
      network.3002513143.link_down: "false"
      network.3002513143.macaddr:   "82:B8:B1:04:8F:D6"
      network.3002513143.model:     "e1000"
      network.3002513143.queues:    "-1"
      network.3002513143.rate:      "-1"
      network.3002513143.tag:       "1109"
      onboot:                       "true"
      os_type:                      "cloud-init"
      preprovision:                 "true"
      sockets:                      "2"
      target_node:                  "prxmx-host02"
      vlan:                         "-1"

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

   Resources: 1 added, 0 changed, 0 destroyed.
[matthewm@localhost terraform]$

Nameserver has been saved to the state file:
[matthewm@localhost terraform]$ cat terraform.tfstate | jq .modules[].resources[].primary.attributes.nameserver
"<IP_ADDRESS>"
[matthewm@localhost terraform]$

But "plan" shows it as needing an update...
[matthewm@localhost terraform]$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

proxmox_vm_qemu.nodes: Refreshing state... (ID: prxmx-host02/qemu/104)

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ proxmox_vm_qemu.nodes
      nameserver: "" => "<IP_ADDRESS>"

Plan: 0 to add, 1 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

[matthewm@localhost terraform]$

Apply again:
[matthewm@localhost terraform]$ terraform apply
proxmox_vm_qemu.nodes: Refreshing state... (ID: prxmx-host02/qemu/104)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ proxmox_vm_qemu.nodes
      nameserver: "" => "<IP_ADDRESS>"

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

proxmox_vm_qemu.nodes: Modifying... (ID: prxmx-host02/qemu/104)
  nameserver: "" => "<IP_ADDRESS>"
proxmox_vm_qemu.nodes: Still modifying... (ID: prxmx-host02/qemu/104, 10s elapsed)
proxmox_vm_qemu.nodes: Still modifying... (ID: prxmx-host02/qemu/104, 20s elapsed)
proxmox_vm_qemu.nodes: Modifications complete after 23s (ID: prxmx-host02/qemu/104)

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
[matthewm@localhost terraform]$

Still shows as needing updating:
[matthewm@localhost terraform]$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

proxmox_vm_qemu.nodes: Refreshing state... (ID: prxmx-host02/qemu/104)

------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ proxmox_vm_qemu.nodes
      nameserver: "" => "<IP_ADDRESS>"

Plan: 0 to add, 1 to change, 0 to destroy.

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

[matthewm@localhost terraform]$

The config on the host has the nameserver value set.
root@nstest:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver <IP_ADDRESS>
search prxmx-lab.local
root@nstest:~# cat /etc/network/interfaces.d/50-cloud-init.cfg
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
    dns-nameservers <IP_ADDRESS>
    dns-search prxmx-lab.local

auto eth0
iface eth0 inet static
    address <IP_ADDRESS>/22
    gateway <IP_ADDRESS>
root@nstest:~#

Config on the node has the nameserver set:
root@prxmx-host02:~# cat /etc/pve/nodes/prxmx-host02/qemu-server/104.conf
agent: 0
boot: c
bootdisk: scsi0
cores: 1
ide2: local-lvm:vm-104-cloudinit,media=cdrom,size=4M
ipconfig0: ip=<IP_ADDRESS>/22,gw=<IP_ADDRESS>
memory: 4096
name: nstest
nameserver: <IP_ADDRESS>
net0: e1000=82:B8:B1:04:8F:D6,bridge=vmbr0,tag=1109
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-104-disk-0,size=40G
scsihw: virtio-scsi-pci
smbios1: uuid=029c5861-42ae-4fb8-ab5c-76785547b99f
sockets: 2
root@prxmx-host02:~#

Thanks for the fix!


disabeling options in mod

hi - please explain further how to disable certein changes you made. for example - i dont want to be limited to 1 extra mythic ability since my build doesnt really benefit from mythic feats and i dont understand which file to edit and which setting.

Hello,
You wanna go to your install folder. For me it's
D:\Steam\steamapps\common\Pathfinder Second Adventure\
Then you want to look for
\Mods\TabletopTweaks\UserSettings
there is a JSON file called "Fixes" that you can use with any text editor.
I think the ones for 1 extra ability is called "MythicFeats":
 "MythicFeats": {     "DisableAll": false,     "Enabled": {       "ExtraFeat": true,       "ExtraMythicAbility": true     }
If you wanna turn them all off, change DisableAll from false to true (make sure you still have the comma). Otherwise you can tweak them separately.

Is it possible to turn off the fix for dr x/? thanks


proofreading

FIX: add missing double-quotation
ADD: explanation of AdjusterError

Codecov Report

Merging #230 into develop will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff           @@
##           develop   #230   +/-   ##
======================================
  Coverage      100%   100%
======================================
  Files           43     43
  Lines          426    426
  Branches        76     76
======================================
  Hits           426    426

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd63522...b3ec16c. Read the comment docs.

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@bd63522). Click here to learn what that means.
The diff coverage is n/a.

@@           Coverage Diff            @@
##             develop   #230   +/-   ##
========================================
  Coverage           ?   100%
========================================
  Files              ?     43
  Lines              ?    428
  Branches           ?     76
========================================
  Hits               ?    428
  Misses             ?      0
  Partials           ?      0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bd63522...60f6cde. Read the comment docs.


Illegal base64 data error from examples/save-to-disk

Your environment.

SHA: 667941621dd8c895a5dd23b133e1913221b0cf7e
Browser: Chrome: 81.0.4044.138

What did you do?
go get github.com/pion/webrtc/v2/examples/save-to-disk does not work so I used go get github.com/pion/webrtc then go install github.com/pion/webrtc/examples/save-to-disk
Since I don't have $BROWSER_SDP set I used echo (pasted session description here) > session then save-to-disk < session
What did you expect?
I expected a session description to be outputed so I could paste it here: https://jsfiddle.net/b3d72av1/
What happened?
I got this:
pyop@mbp ~/gocode/src/webrtc-forked/examples/save-to-disk : save-to-disk < session
panic: illegal base64 data at input byte 9264
goroutine 1 [running]: github.com/pion/webrtc/v2/examples/internal/signal.Decode(0xc0001cc500, 0x2433, 0x13cbd40, 0xc0001921c0) 	/Users/pyop/gocode/src/github.com/pion/webrtc/examples/internal/signal/signal.go:65 +0xcd main.main() 	/Users/pyop/gocode/src/github.com/pion/webrtc/examples/save-to-disk/main.go:131 +0x559
On other attempts, the byte offset changes value, in other attempts, there is no error message and, although files are created, they only include the initial header information.
thank you for your time :)

Hey @somersbmatthews
For me on Chromium copying/pasting always ignores the trailing = sometimes you might have two. It might be worth switching to something that is more copy/paste resilient :)
Another thing that can happen is stdin length restrictions, 9264 doesn't seem significant but is divisible by two so seems possible :)

Resolving for now @somersbmatthews, if you are able to hit a reproducible error please re-open :)
thanks!

@Sean-Der yeah using firefox fixed the copy paste problem, but I'm still getting files with just initial headers and the jsfiddle part just says failed and the pion part just says Connection State has changed failed Done writing media files I'm going to try some more things to try to get this jsfiddle working. I am trying to get some sample bytes written by oggwriter so i can write tests for oggreader using the save-to-disk example.


put extra thought into stdlib

Right now it's entirely ad hoc. Obviously there are no guarantees pre-1.0, but it's worth taking a step back before shipping anything.

closing in favor of #45


Implement simple what-if scenarios by permitting user to input [a] instead of Identity a

Nonempty, that is, because we don't want a value with [] to short-circuit the whole calculation.


feature: Register group names without bindings

Did you check the docs?

[X] I have read all the which-key.nvim docs

Is your feature request related to a problem? Please describe.
I'm guessing like many other things this is possible, and I'm overlooking it. In neorg for example there are some default keys set for localleader using another method. Their key descriptions are picked up correctly by which key, but there are no labels.
Describe the solution you'd like
What I'd like to do is simply:
                local wk = require("which-key")
                wk.register({
                  ["<localleader>"] = {
                    i = { name = "+insert", },
                    l = { name = "+list", },
                    m = { name = "+mode", },
                    n = { name = "+note", },
                    t = { name = "+mark", },
                  },
                })

But this doesn't seem to work without any other bindings contained. If I add even one, it does work and the remaining defaults are intact, but that is a bit redundant.
Describe alternatives you've considered
The alternative I use, is simply setting all the mappings again:
                local wk = require("which-key")
                wk.register({
                  ["<localleader>"] = {
                    i = {
                      name = "+insert",
                    },
                    l = {
                      name = "+list",
                    },
                    m = {
                      name = "+mode",
                    },
                    n = {
                      name = "+note",
                    },
                    t = {
                      name = "+mark",
                      a = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_ambiguous<cr>", "ambiguous" },
                      c = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_cancelled<cr>", "cancelled" },
                      d = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_done<cr>", "done" },
                      h = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_on_hold<cr>", "hold" },
                      i = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_important<cr>", "important" },
                      p = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_pending<cr>", "pending" },
                      r = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_recurring<cr>", "recurring" },
                      u = { "<cmd>Neorg keybind norg core.qol.todo_items.todo.task_undone<cr>", "undone" },
                    },
                  },
                })

Additional context
I've run into this elsewhere too; where a plugin provides default keys with perfect descriptions, but I don't seem to be able to register the groups containing them without resetting the bindings.

Not sure if my scenario is the same as yours, but I have some git/lsp keymaps that don't get set until I open the file and start the LSP server, etc. For those keymaps, I register them for the buffer:
Simplified example:
vim.api.nvim_create_autocmd(
    'LspAttach',
    { callback = function(ev)
        -- define your keymaps here
        vim.keymap.set(...)

        -- register the buffer local keymaps
        require('which-key').register({ ['<leader>f' = { name = '+foo' } }, { buffer = ev.buf })
    end
})

I may be misunderstanding your issue.  For me, the empty menu items wouldn't show up until I added keymaps and the the name was missing and would show '+prefix' instead.

I've come around using this workaround. When I want to register a group name, I make a dummy binding with a key that I will never press like this unicode.
wk.register({
    ["<localleader>"] = {
        s = { name = "+send", ["🚫"] = "which_key_ignore" },
        v = { name = "+view", ["🚫"] = "which_key_ignore" },
    },
})


URGENT/BLOCKER Travis CI becoming non-free

@atmurray @cpp-rakesh @ScottEllisNovatex @bjcarne
We'll need to migrate to a new solution before our complimentary build minutes evaporate (only a few builds worth), or risk not being able to release a hotfix in short order.
Github Actions sounds attractive. What else should we consider?
PS. I also read that docker is becoming less free - that's also worth investigating when we make the switch, since our CI relies heavily on docker too

Probably worth considering Jenkins.


[Bug]: "Callback handler failed" using cargo shuttle login

What happened?
After using cargo shuttle login for the first time, I clicked the button on https://www.shuttle.rs/login and granted permission via Github, then I was redirected to https://www.shuttle.rs/api/auth/callback?code=longcode and got the Message:
Callback handler failed. CAUSE: undefined
Reloading the page gives:
Callback handler failed. CAUSE: Missing state cookie from login request (check login URL, callback URL and cookie config).
Going back to https://www.shuttle.rs/login and clicking the button again worked and I can see the dashboard.
Version
v0.11.2
Which operating systems are you seeing the problem on?
Linux
Which CPU architectures are you seeing the problem on?
x86_64
Relevant log output
Browser logs:
Some cookies are misusing the recommended “SameSite“ attribute 10
Cookie “state” has been rejected because it is already expired. callback
Cookie “_state” has been rejected because it is already expired. callback
Cookie “max_age” has been rejected because it is already expired. callback
Cookie “_max_age” has been rejected because it is already expired. callback
Cookie “code_verifier” has been rejected because it is already expired. callback
Cookie “_code_verifier” has been rejected because it is already expired. callback
Cookie “nonce” has been rejected because it is already expired. callback
Cookie “_nonce” has been rejected because it is already expired. callback
Cookie “response_type” has been rejected because it is already expired. callback
Cookie “_response_type” has been rejected because it is already expired. callback

Duplicate declaration

[X] I have searched the issues and there are none like this.

Thanks for the report! I have seen this before and it seems to be some issue with cookies, but I'm not sure why it happens yet... We're doing some work on the web side of things in the coming weeks, it may become clearer then. :crossed_fingers:

Things have improved a bit on this front. Login is now done in the Shuttle Console.
@GugaGongadze is this still relevant or can it be closed?

@jonaro00 This the same exact issue described here:
https://github.com/shuttle-hq/www/issues/71
Seems like latest report was 2 weeks ago.
We can close this issue in favor of the www one as this bug has nothing to do with this repo.


Add cargo-fuzz fuzzer

From: https://github.com/toby/serde-bencode/pull/29
By: 5225225
This adds a https://github.com/rust-fuzz/cargo-fuzz fuzzer which I used to find #28

ACK a1597cc48b6c1ae5f620c4de4440fa9426e595df


fix xlsx parser can not compatible with rich text tags that are not closed

Summary
Fix xlsx parser can not compatible with rich text tags that are not closed.

Test plan
Unable to read an xlsx containing a hyperlink described in rich text. Here's the error infos:
error:  TypeError: Cannot create property 'richText' on string ''
    at SharedStringXform.parseClose (/Users/wingmrl/Code/exceljs-demo/node_modules/exceljs/lib/xlsx/xform/strings/shared-string-xform.js:81:40)
    at SharedStringsXform.parseClose (/Users/wingmrl/Code/exceljs-demo/node_modules/exceljs/lib/xlsx/xform/strings/shared-strings-xform.js:111:24)
    at SharedStringsXform.parse (/Users/wingmrl/Code/exceljs-demo/node_modules/exceljs/lib/xlsx/xform/base-xform.js:67:21)

Related to source code (for typings update)
'use strict';

/**
 * Minimum reproducible program
 */

const fs = require('fs');
const stream = require('stream');

const Excel = require('../excel');

const filename = process.argv[2];
const buffer = fs.readFileSync(filename);
const workbook = new Excel.Workbook();

const streamReadable = new stream.Readable();
streamReadable.push(buffer);
streamReadable.push(null);

workbook.xlsx
  .read(streamReadable)
  .then(allWorksheet => {
    console.log('allWorksheet: ', allWorksheet);
  })
  .catch(error => {
    console.error('something went wrong', error.stack);
  });

@WingMrL  Could you please move over here? I'd be happy to merge this feature.


fix to #1294

I'm a total noob. I don't expect these change to get merged but I had fun anyway :D

do npm run lint to check for lint issues

combining with https://github.com/odota/ui/pull/1318


Support proxies

limo network calls don't work when the system must use a proxy to get to the Internet. Example:
$ limo update
Get https://api.github.com/user/starred?page=1: dial tcp <IP_ADDRESS>:443: i/o timeout

Probably the best solution is to support the http_proxy environment variable

TIL I learned about http:ProxyFromEnvironment

It would appear that http_proxy support is already built in, after setting http_proxy (and https_proxy), I now get:
$ limo update
Get https://api.github.com/user/starred?page=1: x509: certificate signed by unknown authority

So the company-imposed MITM attack is being correctly detected. This is a separate issue, so I'll close this issue and open a new one.


Missing Bluetooth Device Classes

Before filing an issue please check that the issue is not already addressed by the following:

Github Issues
Changelog

Please ensure that you are not sharing any
Personally Identifiable Information(PII)
or sensitive account information (API keys, credentials, etc.) when reporting an issue.

Describe the bug
After testing this library out with different Bluetooth headsets, I have noticed that the AudioDeviceChangeListener is not being fired upon certain headsets connecting/disconnecting. I utilized two headphones with a deviceClass of BluetoothClass.Device.AUDIO_VIDEO_HEADPHONES and BluetoothClass.Device.Major.UNCATEGORIZED, respectively. These are both wireless headphones (Bose Soundsport and Sony WH-1000MX3) that are capable of receiving call audio. The class function isHeadsetDevice in BluetoothHeadsetReceiver is the culprit as it returns true for only three deviceClass types.
To Reproduce
Steps to reproduce the behavior:

Connect/Disconnect various Bluetooth devices with a different deviceClass outside of AUDIO_VIDEO_HANDSFREE, AUDIO_VIDEO_WEARABLE_HEADSET, AUDIO_VIDEO_CAR_AUDIO
The AudioDeviceChangeListener is not fired as expected.

Expected behavior
The AudioDeviceChangeListener should be called when a device connects/disconnects.
Screenshots
Android Device (please complete the following information):

Device: Pixel 3a
API Version: API 29

Version

Version: 0.1.0

Additional context
This might be intended behavior and my particular Bluetooth devices have a deviceClass that may be outside of the intended use case for this project.

Hi @cyodrew! Thank you for reporting this issue. This indeed is a bug and will be fixed in our upcoming sprint. I'll provide updates to this issues as soon as it is resolved.

Hi @cyodrew . We believe we have fixed this issue in PR #20 . Please let us know if this resolves your issue with the two BT headset devices that you used, so we can cut a new release and close this issue. We currently don't have snapshot artifacts setup yet in Bintray, so you'll have to build it from source in the meantime. Thanks!

Hey @Alton09, I just tested with both BT headsets and it worked like a charm. Thank you!

Glad to hear that! I'll go ahead and close this issue and cut a new release. Thanks again for reporting the bug!


cntlm failed to build on OS 10.6.8

On OS 10.6.8 with last available Xcode (4.2), cntlm fails to build. This error appears multiple times:
cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"

See https://gist.github.com/d93de192bdaa332ac7a3 for full output.
Quick uninformed research seems to indicate this option requires a newer version of GCC than you get with Xcode 4.2. I'm not sure this is actually a homebrew issue because you get the same error if you manually download and compile. If this is more properly reported to the cntlm project, please let me know.

cntlm is in the primary repository, so please report this to https://github.com/Homebrew/homebrew, thanks.

Oh duh, sorry (was thinking of rsync for some reason).


tsm: cache: ensure all statistics are initialised on cache creation.

The intent of this change is to ensure that all statistic fields of the
resulting tsm1_cache measurement are initialized on initialization of
the cache. That way, any consumer of those measurements doesn't
have to deal with the null case.
Signed-off-by: Jon Seymour<EMAIL_ADDRESS>

@mark-rushakoff Turns out this is more than a nice to have. I was expecting the snapshot related stats to start to appear after 1 hour when the cold limit kicks in, but they didn't for reasons I don't completely understand, but probably has something to do with all fields not being initialized on the first write into the tsm1_cache measurement. In any case, I think justification in the commit message is sufficient.

It appears the reason the new fields were not created as expected after 1 hour is that relatively idle _internal shards are not compacted (as expected) on an hourly cycle. I'll double check that this is intended behaviour and if not, raise an a seperate issue.

Compaction only occurs after 1 hour if there are no writes into the WAL log for 1 hour - for shards that are being written slowly but persistently, the first time a compaction trigger will be the size threshold, not the time threshold. So, my expectation about compaction timing was incorrect. I think the current behaviour is reasonable, since it will lead to better TSM compression. In any case all of this is irrelevant to the justification for this commit.

I was initially trying to avoid writing separate functions for modifying statMap, as we seem to be modifying stats "inline" everywhere else. However, given how many stats we're handling here, and given how important it is to get instrumentation correct, separate functions in this case make sense to me.
Up-front initialization of rarely-updated stats also makes sense to me. I wonder if we're approaching the point where we need a "smarter" wrapper around expvar.


helm installation support metrics-exporter-image

Now mysql-operator cannot be customized with metrics-exporter-image using helm installation
Just add args to statefulset.yaml#L65 and you're done!
If allowed, I can submit a pr

Use extraArgs to achieve your goal


add ncyBreadcrumbGetLink function to step object

add ncyBreadcrumbGetLink function to step object so that if your parent state params are not available right when the page loads, you can still have them available when the page is done loading

Hi, thanks for the PR.
I need more information to understand the problem you solve here.
Did you face a situation where the parent state params are not available when the breadcrumb is generated (in other words, when the $viewContentLoaded event is fired) ?
How do you use this function ncyBreadcrumbGetLink ? In a custom template I suppose.
A plunker demonstrating the problem fixed by this PR could be great too (you can fork this one)


Calling Post in parallel in large number of threads cause double free exception

This is the error when executing Posts in parallel.
double free or corruption (!prev): 0x00000000018ce630 ***
Aborted (core dumped)
Any suggestions to solve such an error will be very helpful.

Interesting, it might be an issue with curl itself. Linking this page here for future reference before formulating a strategy for resolving this: https://curl.haxx.se/libcurl/c/threadsafe.html.
The relevant text is probably here:

curl_global_* functions
These functions are not thread safe. If you are using libcurl with multiple threads it is especially important that before use you call curl_global_init or curl_global_init_mem to explicitly initialize the library and its dependents, rather than rely on the "lazy" fail-safe initialization that takes place the first time curl_easy_init is called. For an in-depth explanation refer to libcurl section GLOBAL CONSTANTS.

Hello @whoshuu ,
Thank you for your reply.
I feel the issue for my crash was a multithreading issue in the open ssl and thus the curl module.
Openssl recommends setting up 2 callbacks when using their code in multithreading. So I used the 2 callbacks from http://stackoverflow.com/a/27567259, and that solved my issue.


upcoming: [M3-8613] - Restrict Image Upload to regions with Object Storage

Description 📝

Adds a feature flag that allows us to only show regions with Object Storage capability on the Image Upload page 🌎

Image Service Gen2 uses Object Storage as a storage backend, so that's why we use that capability
We using a flag because we will coordinate with API and let customers know before we make this change 🎏

This is part of the Image Service Gen2 effort 💾

Preview 📷

Before
After

How to test 🧪

Use Launch Darkly to toggle the flag
Verify regions get filtered appropriately

Flag Off:  Should show all core regions
Flag On: Should only  show regions with Object Storage

As an Author I have considered 🤔

[ ] 👀 Doing a self review
[ ] ❔ Our contribution guidelines
[ ] 🤏 Splitting feature into small PRs
[ ] ➕ Adding a changeset
[ ] 🧪 Providing/Improving test coverage
[ ] 🔐 Removing all sensitive information from the code and PR description
[ ] 🚩 Using a feature flag to protect the release
[ ] 👣 Providing comprehensive reproduction steps
[ ] 📑 Providing or updating our documentation
[ ] 🕛 Scheduling a pair reviewing session
[ ] 📱 Providing mobile support
[ ] ♿  Providing accessibility support

Should we display, but disable regions without Object Storage capability instead similar to Linode Create?

I'm thinking no because products like VPC for example just filter the list rather than disable options but I will ask UX! @hana-linode

UX confirmed they want to filter out incompatible regions for the reason constancy with other parts of the app and to reduce cognitive load so the user can make a choice faster.  @hana-linode


[help wanted] pull image failed

Ⅰ. Issue Description
:new_moon_with_face: I'm trying to pull some images and:
➜  pouch git:(master) ✗ sudo ./pouch pull ubuntu:latest
registry.hub.docker.com/library/ubuntu:latest:                                    resolved       |++++++++++++++++++++++++++++++++++++++|
index-sha256:c8c275751219dadad8fa56b3ac41ca6cb22219ff117ca98fe82b42f24e1ba64e:    exists         |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:90f24abe180424046a5d53f6fc6f9fdb8f79b835cb2fd7d1a782e4c30dfb5dcc: exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:0b4aba487617ca27519745ae722b8ea1917474c495b91b3c4887728a3f2ee7db:    exists         |++++++++++++++++++++++++++++++++++++++|
config-sha256:452a96d81c30a1e426bc250428263ac9ca3f47c9bf086f876d11cb39cf57aeec:   exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1:    done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:1e1de00ff7e1fea0858b6a4b5ca208eeca970607ea9a6eb5fc972494e7a0cdde:    exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:0330ca45a200e1fcef05ae97f434366d262a1c50b3dc053e7928b58dd37211dd:    exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:471db38bcfbf0f5bac78012b9d458dfd37309d5cbb99d4e95310321a60a0cfdf:    exists         |++++++++++++++++++++++++++++++++++++++|
elapsed: 6.8 s                                                                    total:  34.3 M (5.1 MiB/s)
Error: failed to display progress: failed to pull image: failed commit on ref "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1": "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1" failed size validation: 36011345 != 30957448: unknown
➜  pouch git:(master) ✗

Ⅱ. Describe what happened
The pouchd said:
INFO[2018-05-26T23:01:51.308348732+08:00] Calling POST /v1.24/images/create?fromImage=ubuntu&tag=latest, client @
INFO[2018-05-26T23:02:00.208668526+08:00] fetch progress exited, ref: registry.hub.docker.com/library/ubuntu:latest.
ERRO[2018-05-26T23:02:00.208745401+08:00] failed to pull image ubuntu:latest:latest: failed to pull image: failed commit on ref "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1": "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1" failed size validation: 36011345 != 30957448: unknown
INFO[2018-05-26T23:02:00.208765298+08:00] End of Calling POST /v1.24/images/create, costs 8900 ms. client @

Ⅲ. Describe what you expected to happen
Pull the image.
Ⅳ. How to reproduce it (as minimally and precisely as possible)

git pull the repo
make build
start up the server with sudo -H ./pouchd
pull the image with sudo ./pouch pull ubuntu:latest

Ⅴ. Anything else we need to know?
Yep, the image pulling logs is like some debugging logs such as "index-sha256", "manifest-sha256", "config-sha256" and "layer-sha256", can we remove it or put that prefix in debug mode?
Ⅵ. Environment:

pouch version (use `pouch version)
APIVersion:      1.24
Arch:            amd64
BuildTime:       2018-05-26T22:48:50+08:00
GitCommit:       0.4.0-285-g499f3cd-dirty
GoVersion:       go1.9.2
KernelVersion:   4.13.0-42-generic
Os:              linux
Version:         0.4.0

OS (e.g. from /etc/os-release): Ubuntu

Kernel (e.g. uname -a): 4.13.0-42-generic

Install tools: -

Others: -

Hi @wrfly , I cannot reproduce what you say. Git-Commit 0.4.0-285-g499f3cd-dirty means you have change the code. Could you mind to run the case in the pure branch again? Thanks

➜  pouch git:(7e6d612) sudo ./pouch pull ubuntu
registry.hub.docker.com/library/ubuntu:latest:                                    resolved       |++++++++++++++++++++++++++++++++++++++|
index-sha256:c8c275751219dadad8fa56b3ac41ca6cb22219ff117ca98fe82b42f24e1ba64e:    exists         |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:90f24abe180424046a5d53f6fc6f9fdb8f79b835cb2fd7d1a782e4c30dfb5dcc: exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:0b4aba487617ca27519745ae722b8ea1917474c495b91b3c4887728a3f2ee7db:    exists         |++++++++++++++++++++++++++++++++++++++|
config-sha256:452a96d81c30a1e426bc250428263ac9ca3f47c9bf086f876d11cb39cf57aeec:   exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:1e1de00ff7e1fea0858b6a4b5ca208eeca970607ea9a6eb5fc972494e7a0cdde:    exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:0330ca45a200e1fcef05ae97f434366d262a1c50b3dc053e7928b58dd37211dd:    exists         |++++++++++++++++++++++++++++++++++++++|
layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1:    done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:471db38bcfbf0f5bac78012b9d458dfd37309d5cbb99d4e95310321a60a0cfdf:    exists         |++++++++++++++++++++++++++++++++++++++|
elapsed: 6.4 s                                                                    total:  34.3 M (5.4 MiB/s)
Error: failed to display progress: failed to pull image: failed commit on ref "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1": "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1" failed size validation: 36011345 != 30957448: unknown
➜  pouch git:(7e6d612) sudo ./pouch images
IMAGE ID       IMAGE NAME                                       SIZE
3fd9065eaf02   registry.hub.docker.com/library/alpine:latest    1.97 MB
8c811b4aec35   registry.hub.docker.com/library/busybox:latest   710.81 KB
➜  pouch git:(7e6d612) sudo ./pouch version
BuildTime:       unknown
GitCommit:       unknown
GoVersion:       go1.9.1
KernelVersion:   4.13.0-42-generic
Os:              linux
Version:         0.4.0
APIVersion:      1.24
Arch:            amd64
➜  pouch git:(7e6d612) git status
HEAD detached at 0.4.0
nothing to commit, working tree clean
➜  pouch git:(7e6d612)

INFO[0000] Start snapshots syncer
INFO[0000] Start streaming server
INFO[2018-05-28 22:59:48.194489331] success to create 5 containerd clients, connect to: /var/run/containerd.sock
INFO[2018-05-28 22:59:48.223331031] Firewalld running: false
INFO[2018-05-28 22:59:48.376153888] start to listen to: unix:///var/run/pouchd.sock
INFO[2018-05-28 23:00:06.431717564] Calling POST /v1.24/images/create?fromImage=ubuntu&tag=latest, client @
INFO[2018-05-28 23:00:14.932072749] fetch progress exited, ref: registry.hub.docker.com/library/ubuntu:latest.
ERRO[2018-05-28 23:00:14.932161955] failed to pull image ubuntu:latest: failed to pull image: failed commit on ref "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1": "layer-sha256:a48c500ed24e62926cb079df35f964c57d8bb08159b1d29c6a3b0a58dc365dc1" failed size validation: 36011345 != 30957448: unknown
INFO[2018-05-28 23:00:14.932210648] End of Calling POST /v1.24/images/create, costs 8500 ms. client @

@wrfly ， thank you. I will do the investigation since the error doesn't come up in my local env.

Maybe there are something wrong with the filesystem, I'll prune the files and try again later. Since there is no ubuntu image locally, I cannot remove it through the client API, perhaps we can add some flag to force remove the image manifests and download again if it is the broken files' problem. Or find out why this problem happens and add more checks before write to the disk.
In docker days, rm -rf /var/lib/docker always solve problems 🤣


Reland composite physical layers on all platforms

Description
This relands #28919, which had to be reverted because the engine side was misisng anti-aliasing bits on the paint for physical layer drawing on non-Fuchsia platforms.  That was fixed in https://github.com/flutter/engine/pull/8157 and has since rolled through to the framework.
This PR also undoes some of the golden changes from the original PR, where I mistakenly believed there were subtle acceptable differences - I completely missed that I was turning off anti-aliasing (which was caught later in the google3 roll).
As noted on the original PR, this is expected to improve frame build times, but make "rasterization" time in the engine worse (we're shifting work from the framework to the engine).
/cc @HansMuller @jason-simmons @willlarche @liyuqian @goderbauer @mklim who were involved in the original landing and/or rolling back of this.
Related Issues
Fixes #27891
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] My PR includes tests for all changed/updated/fixed behaviors (See Test Coverage).
[x] All existing and new tests are passing.
[x] I updated/added relevant documentation (doc comments with ///).
[x] The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I signed the CLA.
[x] I am willing to follow-up on review comments in a timely manner.

Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?

[x] Yes, this is a breaking change (Please read Handling breaking changes). - this was handled in the original PR
[ ] No, this is not a breaking change.

I recommend making a test case where it's harder to mistake the change for a positive change. For example, maybe a test where the test itself verifies that the antialiasing is happening (not a golden file test, but one where the image is actually examined by the code to verify that there's more than two colours on the boundary or some such).

I think our migration to Skia gold should help this - we'll have a better UI for evaluating golden changes and seeing exactly what has changed without manual steps involved in generating a new image.
Are you suggesting that matches golden shoul dhave this logic though?  It should be able to detect anti-aliasing regressions?


[bug] remove duplicated doctrine/annotations entry

Q
A

Bug fix?
yes

New feature?
no

Tickets
n/a

License
MIT

Looks like 2 different PR's added this. (https://github.com/symfony/ux/pull/111 and https://github.com/symfony/ux/pull/106)

Thanks :). I was expecting a conflict would arise that would cause us to fix this. But right now (and we should fix this at some point), or composer.json isn't alphabetic, so it's easier to have this happen. Anyways, good catch!


Extending and adding a interceptor to give an output similar to default chrome network request

I am using the okhttp interceptor provided by stetho, but I am only getting latency and download times. How do I provision okhttp to get a network timeline output like above? It would be great if a library developer would point to right direction to develop such a functionality if its not present

Unfortunately we currently don't support collecting or sending this data.  These are actually two separate problems that have to be solved separately:

NetworkEventReporter (and ...Impl.java) would have to offer an expanded API to collect this information and then relay that along the Chrome DevTools protocol.  This part should actually be pretty trivial, just some minor improvements to the API needed.
The helper modules, stetho-urlconnection and stetho-okhttp would need to be updated to take advantage of this, providing whatever telemetry is possible with this libraries.  Unfortunately, and the main reason this hasn't been done yet, I don't believe okhttp itself actually offers most of this information so it would effectively be impossible to prove for the vast majority of our users.

I have long since felt okhttp lacking in its accounting/statistics capabilities so this might be high time to put some pressure on them to open up (or maybe just document?) APIs.
I know this sounds contrived, but patches and some research legwork would be greatly appreciated here.  I too would love to see this feature.

@jasta Thanks a lot for the information though. If okhttp would need some additional exposure of their API or better documentation its better I start from there and get to modifying the NetworkEventReporter later. First step is to know all the information we need to pass to the Chrome DevTools protocol is present and can be collected.

@sybarite agreed, that approach sounds right.  To give you a sense of what the DevTools protocol lets you do, see https://github.com/facebook/stetho/blob/master/build-tools/protocol.json.  This is the "documentation" for the DevTools protocol and explains what kinds of messages we can send/receive.  In this case, the ResourceTiming object is not even sent at all by Stetho today, but obviously if we start the data would show up in the UI :)
FWIW, we can currently populate a few of these fields today we just didn't.  In particular, that's sendStart, sendEnd, and receiveHeadersEnd.

@jasta Oh nice thanks for the links! Also I have several doubts now that I am stepping into one class at a time. I understand the the NetworkEventReporter is a singleton. For domain event the request and response information is expected to be passed in the InspectorRequest and InspectorResponse objects.
And the ResourceTiming object is expected in the Response object for chrome dev tools protocol, but since in the InspectorResponse object there is no context for the Request, I am not sure how I will add all the request timings to the ResourceTiming object.
Basically I need these timing data to persist between these calls and finally attach it to Response object expected in the chrome dev tools protocol. Or maybe I am not understanding the current architecture correctly, it would be fantastic if you could give me an overview of the architecture on collecting the Network domain information.
Also I am trying to get all the timing information for the stetho-urlconnection library first just to understand how I will go about collecting the timing. I will start grokking okhttp later for the same functionality.

It is possible to share information across request and response in the current design by keying off the request id.  We do this currently actually because the protocol decouples the response headers and response body.  The latter we store in a file as it may be very large and will not necessarily be accessed by the DevTools (only when you click on it is it requested).
For your purposes, I suspect the easiest thing to do would be to simply use a SparseArray to track the timing information, keyed by requestId which is common to both InspectorRequest and InspectorResponse.  The data structure would be added to in requestWillBeSent and removed from in responseHeadersReceived.
I recommend associating this data structure with NetworkPeerManager so that that onLastPeerUnregistered method can be used to empty the data structure to prevent leaks.  This might be a good place even to print a debug statement for each entry remaining in the list, indicating some kind of programmer error in failing to call responseHeadersReceived.

This is released in okhttp 3.9  Eventlistener.
While I am able to get all the timing such as DNS, SSL (no proxy callback), I don't know how to access response. I think an experimental StethoEventListener can co-exist with the interceptor (it can be used for all the callbacks/or just resource timing). Some of the callbacks in listener are called multiple times for redirect so we may need to filter 3xx.
Also, updated ResourceTiming has new fields on service workers and push start (I believe these things can be set to 0 as can be in this  link).
I can send a quick PR (although hacky by this weekend).

Hello, I am trying to add Network.ResourceTiming into Network.Reponse, to support displaying detail request information on chrome. But I meet a problem. Every time I set any data to ResourceTiming, the request shown on chrome will not 'end' any more(it seems like the latter event 'Network.dataReceived' and 'Network.loadingFinished' is not handled anymore.


fix RangeError: Maximum call stack size exceeded

fixes #49 and #17
Fix suggested by @sirioz

thanks @reidmweber


Add in-app download support

In my forked version (https://github.com/joelekstrom/fastmate/issues/14) I previously integrated in-app download support (not having to go to the default browser). Would you consider including download support in the main version? I've done a probably crude version so open to any suggestions what would be the best way to try and include this

Hi! I'd be happy to include this!
So I haven't explicitly tried your fork - but the reason I haven't given it a go myself is that I would personally like some kind of progress bar during a download, and I haven't figured out a good place for that in Fastmate. Does it work like Safari where you can see a progress bar in the downloads folder? In that case, I'm happy to accept a PR with even a crude version of this. If you would like a PR, then make a clean clone of this repo and copy over the changes related only to the downloads and make a PR for those.

@joelekstrom would you consider adding download functionality to a future version?

Absolutely, it's on the TODO-list 😄 if you want to package your implementation up in a PR with only that I'm happy to merge it too

I'm ready to repackage my download implementation and start porting from Obj-C to Swift. But when thinking I thought about what would be the most permanent approach. Possibly it would mimic something like the download progress / overview in Safari. One example I found is: https://github.com/n3d1117/dl-buddy
The other way to could go simply do what I did now: specific a folder (probably specificy it in preferences) and simply download any file to there without a progress indicator.
Any suggestions on a preferred approach (before I start porting code that won't be used)?

Yeah I think the nicest approach would be if it would simply download to ~/Downloads. I know when downloading from Safari there's a progress bar built in in the downloads folder so no custom UI would be needed. Do you know if that's possible?

Okay - sounds like a plan. I think using something like NSProgress would be a possibility: https://stackoverflow.com/questions/15018052/how-to-show-a-progress-bar-on-files-icon

What are your thoughts as a user of this? Would you rather have a built-in download manager as your examples there or would a progress on icons be enough? Feel free to take whatever approach solves the problem best/is most inspiring to you. The icon progress thing is just what I would've done to avoid making custom UI 😅

As a user I'm more than happy with a download to just a pre-specified folder. It also makes it much easier to implement as that's the code I already have (in Obj-C). I'll take a look at NSProgress, but I'll probably make a PR without that first. It indeed also prevents from having to create a separate UI I agree :-)

Check out this PR https://github.com/joelekstrom/fastmate/pull/82

Merged in v1.9.0


Feature request: Remove unnecessary CLEAR after variable definition

Hi Jörg-Michael, I'd like to request an action to remove unnecessary CLEAR statements after a variable has been defined. There is no reason why you should clear a variable you just defined if you're not in some kind of loop.
Example:
METHOD example.
  DATA lv_string type string.
  CLEAR lv_string.
  " [...]
ENDMETHOD.

Expected result:
METHOD example.
  DATA lv_string type string.
  " [...]
ENDMETHOD.

Hi ConjuringCoffee,
that makes sense, although I think I haven't seen too many of those, at least with CLEAR being right after the declarations.
And I assume you don't mean CLEAR further down the method? That's also unnecessary sometimes, but could be intended as a form of safeguarding in the sense of "from here we need to start with an initial value, whatever we may do with this variable in the above blocks (possibly at a later point in time)".
However, what might be included (optionally) in such a rule is removing CLEAR rv_result if ABAP cleaner can "see" the method signature RETURNING VALUE(rv_result) TYPE ....
Kind regards,
Jörg-Michael

although I think I haven't seen too many of those, at least with CLEAR being right after the declarations.

I unfortunately see this quite often in legacy code. 😅
It also happens accidentally when encapsulating the logic from inside a LOOP: If the variables were cleared at the start of the loop before, then they are cleared at the start of the method afterwards. This has to be removed manually then.

And I assume you don't mean CLEAR further down the method?

I agree, it would be better to only apply the action to CLEARs that come directly after the declarations.

I unfortunately see this quite often in legacy code. 😅

I see this a lot too. I think people just want to feel safe, or don't know that local variables are always empty at the beginning even if the method/form is called multiple times.
I also see if sy-subrc = 0. as the first statement inside a select-endselect loop, so don't underestimate the power of feeling safe 😃

Hi ConjuringCoffee and Mehmet,
as mentioned in more detail in #111, this new cleanup rule "Remove needless CLEAR" is now available with version 1.9.0! In my sample code, I indeed found quite a number of places with such CLEAR statements esp. at method start. In one case, there were approx. 20 DATA lines, followed by approx. 10 CLEARs of the variables that were just declared!
And yes, with respect to method start, the rule only deletes (or adds a TODO comment for) CLEAR of local variables that is found before any other executable statement, except for ASSERT (actually I forgot BREAK-POINT and LOG-POINT statements, those are acceptable before a to-be-removed CLEAR as well – will add that with the next release).
Kind regards,
Jörg-Michael


[BUG] SuspensionHost extensions broke when nullability was added

Describe the bug
There seem to be 2 issues in the SuspensionHostExtensions class which appeared after upgrading to version 11.5.1. I'll describe them both here since they are quite small. I believe this is because of changes introduced in this commit.

SetupDefaultSuspendResume always throws NullReferenceException. I think this is because this code was added to the method:

if (item.AppState == null)
{
    throw new NullReferenceException(nameof(item.AppState));
}

As far as I understand, item.AppState is always going to be null at this point, because we're just setting up the suspension host and the app state didn't have a chance to be initialized yet.

ObserveAppState always throws InvalidCastException. This is becuase this line:

return item.WhenAny(x => x.AppState, x => (T)x.Value)

was changed to this:
return item.WhenAny(x => x.AppState, x => (T)x)

So now instead of casting x.Value, it tries to cast x which is of type ObservedChange.
Steps To Reproduce

Try to set up the suspension driver as described in ReactiveUI's docs or in Avalonia's docs.

Expected behavior
Well, I would expect it not to throw any exceptions :)
Environment

OS: Windows 10
Version: 11.5.1

I'm having the same problem after updating to 11.5.1.
SetupDefaultSuspendResume throws NullReferenceException on start, and attempting to initialize the AppState to a non-null value before calling SetupDefaultSuspendResume will "workaround" the first bug, but it then throws InvalidCastException, exactly as described by @TolikPylypchuk.

Thanks for confirming. We will have a fix out in a day or so


fix #95 broadcast forward_shape and add test

fixes #95

Looks good to me.
Travis is down for the moment, I'll merge it when it's up and the build on OSX has completed.


Wrong size and alignment of struct

Input C/C++ Header
Generated by C-Smith:

/*
 * This is a RANDOMLY GENERATED PROGRAM.
 *
 * Generator: csmith 2.2.0
 * Git version: dcef523
 * Options:   --no-checksum --nomain --max-block-size 1 --max-block-depth 1 -o /tmp/input-d4ucc247.h
 * Seed:      629758572
 */

#include "csmith.h"

volatile uint64_t csmith_sink_ = 0;

static long __undefined;

/* --- Struct/Union Declarations --- */
struct S0 {
   uint64_t  f0;
   int64_t  f1;
   const int32_t  f2;
   uint8_t  f3;
   const uint8_t  f4;
   const int32_t  f5;
   uint8_t  f6;
};

#pragma pack(push)
#pragma pack(1)
struct S2 {
   signed f0 : 18;
   unsigned f1 : 11;
};
#pragma pack(pop)

union U4 {
   volatile unsigned f0 : 31;
   int64_t  f1;
   int64_t  f2;
   uint64_t  f3;
   uint32_t  f4;
};

/* --- GLOBAL VARIABLES --- */
static int8_t g_6 = 0xD9L;
static int8_t *g_5 = &g_6;
static int8_t *g_16 = &g_6;
static int8_t **g_15 = &g_16;
static volatile struct S2 g_19 = {492,24};/* VOLATILE GLOBAL g_19 */
static int32_t g_39 = 8L;
static struct S2 g_46 = {-28,33};
static const int32_t g_54 = 0x708CDB5CL;
static const int32_t *g_53[3] = {&g_54,&g_54,&g_54};
static int32_t g_57 = (-1L);
static int16_t g_58 = 0L;
static int32_t g_61 = (-1L);
static int64_t g_62 = (-1L);
static uint8_t g_63 = 255UL;
static int32_t *g_78 = &g_39;
static int32_t **g_77 = &g_78;
static int8_t g_106 = 5L;
static int64_t g_113 = 1L;
static int64_t *g_112 = &g_113;
static const int8_t g_124 = (-9L);
static int64_t g_131 = (-1L);
static volatile int8_t g_132[6][9][4] = {{{0x38L,0x7DL,0xCDL,0x38L},{(-9L),(-1L),0x7CL,0x72L},{(-10L),0x38L,7L,0L},{0xB3L,0x72L,0xB3L,(-1L)},{0x75L,(-9L),(-9L),0x72L},{0x43L,5L,0x38L,(-9L)},{0xCDL,0x7DL,0x38L,0xB3L},{0x43L,0x75L,(-9L),(-1L)},{0x75L,0x3EL,0xB3L,(-10L)}},{{0xB3L,(-10L),7L,5L},{(-10L),0x75L,0x7CL,5L},{0xCDL,0x25L,0x25L,0xCDL},{0x96L,0x38L,0xC6L,(-1L)},{(-1L),0xCDL,0x43L,0x3EL},{5L,0L,0x49L,0x3EL},{0x7CL,0xCDL,5L,(-1L)},{0xB3L,0x38L,0x7DL,0xCDL},{(-1L),0x25L,0x96L,5L}},{{0xC6L,7L,5L,3L},{0x24L,(-1L),(-1L),(-1L)},{5L,5L,0x7CL,0x38L},{5L,7L,0xC6L,0x49L},{0xCDL,(-1L),0L,0xCDL},{0xCDL,3L,0xC6L,8L},{5L,0xCDL,0x7CL,(-9L)},{5L,0x51L,(-1L),0x3EL},{0x24L,0x96L,5L,8L}},{{0xC6L,0x38L,0x96L,0x96L},{(-1L),(-1L),0x7DL,5L},{0xB3L,0L,5L,0x38L},{0x7CL,(-1L),0x49L,5L},{5L,(-1L),0x43L,0x38L},{(-1L),0L,0xC6L,5L},{0x96L,(-1L),0x25L,0x96L},{0xCDL,0x38L,5L,8L},{(-1L),0x96L,0x7CL,0x3EL}},{{0x49L,0x51L,0x49L,(-9L)},{0x24L,0xCDL,0x72L,8L},{0xB3L,3L,0x96L,0xCDL},{0x25L,(-1L),0x96L,0x49L},{0xB3L,7L,0x72L,0x38L},{0x24L,5L,0x49L,(-1L)},{0x49L,(-1L),0x7CL,3L},{(-1L),7L,5L,5L},{0xCDL,0x25L,0x25L,0xCDL}},{{0x96L,0x38L,0xC6L,(-1L)},{(-1L),0xCDL,0x43L,0x3EL},{5L,0L,0x49L,0x3EL},{0x7CL,0xCDL,5L,(-1L)},{0xB3L,0x38L,0x7DL,0xCDL},{(-1L),0x25L,0x96L,5L},{0xC6L,7L,5L,3L},{0x24L,(-1L),(-1L),(-1L)},{5L,5L,0x7CL,0x38L}}};
static volatile uint16_t g_139 = 65535UL;/* VOLATILE GLOBAL g_139 */
static int8_t *** volatile g_148 = &g_15;/* VOLATILE GLOBAL g_148 */
static union U4 g_149 = {0UL};/* VOLATILE GLOBAL g_149 */

/* --- FORWARD DECLARATIONS --- */
static union U4  func_1(void);
static int8_t ** const  func_2(int8_t * p_3, int8_t ** p_4);
static int8_t ** func_9(int32_t  p_10, int8_t ** p_11, int32_t  p_12, int8_t  p_13, const uint64_t  p_14);
static uint8_t  func_25(uint64_t  p_26, int32_t  p_27, int32_t  p_28);
static int8_t ** const  func_30(int8_t * p_31, int32_t  p_32, int8_t * p_33, int8_t * p_34);
static int8_t * func_35(uint32_t  p_36);
static uint32_t  func_40(uint16_t  p_41, struct S2  p_42, int64_t  p_43, int8_t ** p_44);
static int8_t ** func_47(int8_t  p_48, int8_t  p_49, int8_t * p_50, int8_t * p_51);
static uint32_t  func_68(int8_t ** p_69, int16_t  p_70, int8_t * p_71, uint8_t  p_72, int64_t  p_73);
static int8_t ** func_74(int32_t ** p_75, int64_t  p_76);

/* --- FUNCTIONS --- */
/* ------------------------------------------ */
/*
 * reads : g_5 g_6 g_15 g_19 g_16 g_46 g_53 g_63 g_77 g_78 g_39 g_54 g_62 g_57 g_106 g_112 g_139 g_148 g_149
 * writes: g_5 g_39 g_53 g_63 g_57 g_78 g_106 g_62 g_139 g_15
 */
static union U4  func_1(void)
{ /* block id: 0 */
    int8_t *l_20[4] = {(void*)0,(void*)0,(void*)0,(void*)0};
    int32_t l_29[4][7] = {{0L,(-3L),(-5L),(-3L),0L,0x6930509BL,0x6930509BL},{0L,(-3L),(-5L),(-3L),0L,0x6930509BL,0x6930509BL},{0x6930509BL,0x0F30385DL,0L,0x0F30385DL,0x6930509BL,(-5L),(-5L)},{0x6930509BL,0x0F30385DL,0L,0x0F30385DL,0x6930509BL,(-5L),(-5L)}};
    const int8_t *l_123[3];
    const int8_t **l_122 = &l_123[2];
    int8_t ***l_147 = &g_15;
    int i, j;
    for (i = 0; i < 3; i++)
        l_123[i] = &g_124;
    (*g_148) = func_2((g_5 = g_5), (((((safe_div_func_uint32_t_u_u((((*l_147) = func_9(g_6, g_15, ((safe_lshift_func_uint16_t_u_u(0x711DL, 6)) != (1UL && ((g_19 , l_20[1]) != ((*l_122) = ((safe_mod_func_uint8_t_u_u((safe_rshift_func_int8_t_s_u((*g_16), func_25(l_29[0][6], g_6, g_6))), 2UL)) , (*g_15)))))), l_29[3][6], g_46.f1)) != &l_20[2]), l_29[0][6])) >= l_29[3][4]) , (*l_122)) == (void*)0) , (*l_147)));
    return g_149;
}

/* ------------------------------------------ */
/*
 * reads : g_77
 * writes: g_78
 */
static int8_t ** const  func_2(int8_t * p_3, int8_t ** p_4)
{ /* block id: 46 */
    (*g_77) = (void*)0;
    return &g_16;
}

/* ------------------------------------------ */
/*
 * reads : g_139
 * writes: g_139
 */
static int8_t ** func_9(int32_t  p_10, int8_t ** p_11, int32_t  p_12, int8_t  p_13, const uint64_t  p_14)
{ /* block id: 38 */
    const int32_t l_125 = 9L;
    int32_t l_128 = 0L;
    int32_t l_129 = 0x99A09347L;
    int32_t l_133 = 0x8B77237EL;
    int32_t l_134 = 0xC1B3EE27L;
    int32_t l_135 = 0x6E12AA01L;
    int32_t l_136 = (-7L);
    int32_t l_137 = 0L;
    int32_t l_138 = 0x6387BD1CL;
    if (l_125)
    { /* block id: 39 */
        int32_t *l_126 = &g_57;
        int32_t *l_127[8][9][3];
        int16_t l_130 = (-1L);
        int i, j, k;
        for (i = 0; i < 8; i++)
        {
            for (j = 0; j < 9; j++)
            {
                for (k = 0; k < 3; k++)
                    l_127[i][j][k] = (void*)0;
            }
        }
        ++g_139;
    }
    else
    { /* block id: 41 */
        int32_t *l_142 = &l_137;
        int32_t *l_143[10] = {&l_138,&l_138,&l_138,&l_138,&l_138,&l_138,&l_138,&l_138,&l_138,&l_138};
        uint16_t l_144[10] = {0x1A07L,1UL,0x1A07L,1UL,0x1A07L,1UL,0x1A07L,1UL,0x1A07L,1UL};
        int i;
        l_144[4]++;
    }
    return &g_16;
}

/* ------------------------------------------ */
/*
 * reads : g_15 g_16 g_6 g_46 g_53 g_63 g_77 g_78 g_39 g_54 g_62 g_57 g_106 g_112
 * writes: g_39 g_53 g_63 g_57 g_78 g_106 g_62
 */
static uint8_t  func_25(uint64_t  p_26, int32_t  p_27, int32_t  p_28)
{ /* block id: 2 */
    uint32_t l_37 =<PHONE_NUMBER>3709551615UL;
    int16_t l_45 = 0x72BEL;
    int8_t *l_52[4][6][4] = {{{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6}},{{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6}},{{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6}},{{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6},{&g_6,&g_6,&g_6,&g_6}}};
    int32_t *l_66 = &g_57;
    int8_t **l_120 = &g_16;
    int8_t ***l_119[5] = {&g_15,&g_15,&g_15,&g_15,&g_15};
    int8_t ***l_121 = &l_120;
    int i, j, k;
    (*l_121) = func_30(func_35(l_37), ((*l_66) = (g_6 >= func_40(l_45, g_46, g_46.f1, func_47(l_45, (**g_15), l_52[0][0][3], (*g_15))))), l_52[0][0][3], (*g_15));
    return g_106;
}

/* ------------------------------------------ */
/*
 * reads : g_77 g_78 g_39 g_54 g_46.f0 g_63 g_62 g_57 g_16 g_6 g_106 g_112 g_46
 * writes: g_78 g_63 g_106 g_62
 */
static int8_t ** const  func_30(int8_t * p_31, int32_t  p_32, int8_t * p_33, int8_t * p_34)
{ /* block id: 13 */
    uint32_t l_79[1][2][4] = {{{0xAC7196A4L,0x8F974433L,0xAC7196A4L,0xAC7196A4L},{0x8F974433L,0x8F974433L,18446744073709551615UL,0x8F974433L}}};
    int8_t *l_80 = &g_6;
    int64_t **l_114[9] = {(void*)0,&g_112,&g_112,(void*)0,&g_112,&g_112,(void*)0,&g_112,&g_112};
    int64_t *l_115 = &g_113;
    int i, j, k;
    if (func_40(((((!func_68(func_74(g_77, p_32), l_79[0][1][1], l_80, g_39, l_79[0][1][2])) > ((l_115 = g_112) != &g_113)) >= l_79[0][1][1]) , g_63), g_46, l_79[0][1][1], &l_80))
    { /* block id: 29 */
        int32_t * const l_116 = &g_39;
        int32_t **l_117 = &g_78;
        (*l_117) = l_116;
    }
    else
    { /* block id: 31 */
        int8_t ** const l_118 = &l_80;
        return &g_16;
    }
    return &g_16;
}

/* ------------------------------------------ */
/*
 * reads : g_15 g_16
 * writes: g_39
 */
static int8_t * func_35(uint32_t  p_36)
{ /* block id: 3 */
    int32_t *l_38 = &g_39;
    (*l_38) = p_36;
    return (*g_15);
}

/* ------------------------------------------ */
/*
 * reads : g_63
 * writes: g_63
 */
static uint32_t  func_40(uint16_t  p_41, struct S2  p_42, int64_t  p_43, int8_t ** p_44)
{ /* block id: 9 */
    int32_t *l_56[2];
    int32_t l_59[7][9] = {{0xD7B1ECBCL,0x2D8C20E5L,6L,0x624E194EL,6L,0x2D8C20E5L,0xD7B1ECBCL,(-1L),0xF9094207L},{(-1L),5L,0xD7B1ECBCL,0x624E194EL,0L,0x2E4BCB81L,(-1L),6L,(-1L)},{(-1L),0L,0x7A880E1BL,0x7A880E1BL,0L,(-1L),0xF9094207L,(-1L),0xD7B1ECBCL},{6L,1L,0x7A880E1BL,0x2E4BCB81L,(-1L),0x61EA52FAL,0L,0L,0x61EA52FAL},{0x7A880E1BL,0L,0x624E194EL,6L,0x2D8C20E5L,0xD7B1ECBCL,(-1L),0xF9094207L,(-1L)},{0x61EA52FAL,6L,0xD7B1ECBCL,(-1L),7L,0x287676E3L,0L,0x287676E3L,7L},{(-1L),7L,7L,(-1L),5L,0xD7B1ECBCL,0x624E194EL,0L,0x2E4BCB81L}};
    int16_t l_60 = 0x09D5L;
    int i, j;
    for (i = 0; i < 2; i++)
        l_56[i] = &g_57;
    g_63++;
    return p_42.f0;
}

/* ------------------------------------------ */
/*
 * reads : g_53
 * writes: g_53
 */
static int8_t ** func_47(int8_t  p_48, int8_t  p_49, int8_t * p_50, int8_t * p_51)
{ /* block id: 6 */
    const int32_t **l_55 = &g_53[0];
    (*l_55) = g_53[0];
    return &g_16;
}

/* ------------------------------------------ */
/*
 * reads : g_54 g_46.f0 g_63 g_62 g_57 g_16 g_6 g_106 g_77
 * writes: g_63 g_106 g_62 g_78
 */
static uint32_t  func_68(int8_t ** p_69, int16_t  p_70, int8_t * p_71, uint8_t  p_72, int64_t  p_73)
{ /* block id: 17 */
    uint64_t l_81[1];
    int32_t l_93 = (-1L);
    uint8_t *l_94 = &g_63;
    const struct S0 l_103 = {0UL,0x133A9B92FD598C55LL,0xA0DA2B3CL,0x8CL,1UL,5L,0UL};
    const uint32_t l_104[8][6] = {{0x3E519B98L,0UL,0UL,0x3E519B98L,18446744073709551615UL,18446744073709551615UL},{0x3E519B98L,18446744073709551615UL,18446744073709551615UL,0x706978B3L,0UL,18446744073709551615UL},{18446744073709551606UL,0xDF25B48FL,0UL,9UL,0UL,0xDF25B48FL},{0x706978B3L,18446744073709551615UL,0x09415F90L,9UL,18446744073709551615UL,0UL},{18446744073709551606UL,0UL,0x09415F90L,0x706978B3L,0xDF25B48FL,0xDF25B48FL},{0x3E519B98L,0UL,0UL,0x3E519B98L,18446744073709551615UL,18446744073709551615UL},{0x3E519B98L,18446744073709551615UL,18446744073709551615UL,0x706978B3L,0UL,18446744073709551615UL},{18446744073709551606UL,0xDF25B48FL,0UL,9UL,0UL,0xDF25B48FL}};
    int8_t *l_105[8][2] = {{(void*)0,&g_106},{(void*)0,(void*)0},{(void*)0,&g_106},{(void*)0,(void*)0},{(void*)0,&g_106},{(void*)0,(void*)0},{(void*)0,&g_106},{(void*)0,(void*)0}};
    int64_t *l_107 = (void*)0;
    int64_t *l_108 = (void*)0;
    int64_t *l_109 = &g_62;
    int i, j;
    for (i = 0; i < 1; i++)
        l_81[i] = 0UL;
    if ((l_81[0] > (safe_lshift_func_int16_t_s_u((p_70 |= (g_54 && l_81[0])), (safe_mul_func_int16_t_s_s(((((*l_109) = (safe_mul_func_int8_t_s_s((g_46.f0 > (+p_72)), (g_106 &= ((safe_sub_func_int64_t_s_s((safe_mod_func_int64_t_s_s(((--(*l_94)) || (safe_unary_minus_func_uint64_t_u((p_72 ^ ((safe_rshift_func_int16_t_s_u((safe_unary_minus_func_int16_t_s((safe_sub_func_uint64_t_u_u((l_103 , p_73), g_62)))), g_63)) != g_63))))), l_104[3][1])), g_57)) , (*g_16)))))) , 0x718CL) <= g_54), g_54))))))
    { /* block id: 22 */
        int32_t *l_110 = &g_39;
        (*g_77) = l_110;
    }
    else
    { /* block id: 24 */
        int32_t *l_111 = &g_39;
        (*g_77) = l_111;
    }
    return g_63;
}

/* ------------------------------------------ */
/*
 * reads : g_78
 * writes: g_78
 */
static int8_t ** func_74(int32_t ** p_75, int64_t  p_76)
{ /* block id: 14 */
    (*p_75) = (*p_75);
    return &g_16;
}

/************************ statistics *************************
XXX max struct depth: 1
breakdown:
   depth: 0, occurrence: 41
   depth: 1, occurrence: 3
XXX total union variables: 1

XXX non-zero bitfields defined in structs: 3
XXX zero bitfields defined in structs: 0
XXX const bitfields defined in structs: 0
XXX volatile bitfields defined in structs: 1
XXX structs with bitfields in the program: 3
breakdown:
   indirect level: 0, occurrence: 3
XXX full-bitfields structs in the program: 2
breakdown:
   indirect level: 0, occurrence: 2
XXX times a bitfields struct's address is taken: 0
XXX times a bitfields struct on LHS: 0
XXX times a bitfields struct on RHS: 4
XXX times a single bitfield on LHS: 0
XXX times a single bitfield on RHS: 4

XXX max expression depth: 28
breakdown:
   depth: 1, occurrence: 34
   depth: 16, occurrence: 1
   depth: 17, occurrence: 1
   depth: 22, occurrence: 1
   depth: 28, occurrence: 1

XXX total number of pointers: 54

XXX times a variable address is taken: 58
XXX times a pointer is dereferenced on RHS: 10
breakdown:
   depth: 1, occurrence: 9
   depth: 2, occurrence: 1
XXX times a pointer is dereferenced on LHS: 14
breakdown:
   depth: 1, occurrence: 14
XXX times a pointer is compared with null: 0
XXX times a pointer is compared with address of another variable: 0
XXX times a pointer is compared with another pointer: 0
XXX times a pointer is qualified to be dereferenced: 296

XXX max dereference level: 2
breakdown:
   level: 0, occurrence: 0
   level: 1, occurrence: 30
   level: 2, occurrence: 5
XXX number of pointers point to pointers: 21
XXX number of pointers point to scalars: 33
XXX number of pointers point to structs: 0
XXX percent of pointers has null in alias set: 13
XXX average alias set size: 1.15

XXX times a non-volatile is read: 78
XXX times a non-volatile is write: 33
XXX times a volatile is read: 1
XXX    times read thru a pointer: 0
XXX times a volatile is write: 2
XXX    times written thru a pointer: 0
XXX times a volatile is available for access: 9
XXX percentage of non-volatile access: 97.4

XXX forward jumps: 0
XXX backward jumps: 0

XXX stmts: 26
XXX max block depth: 1
breakdown:
   depth: 0, occurrence: 20
   depth: 1, occurrence: 6

XXX percentage a fresh-made variable is used: 31.7
XXX percentage an existing variable is used: 68.3
FYI: the random generator makes assumptions about the integer size. See platform.info for more details.
********************* end of statistics **********************/

Bindgen Invocation
$ bindgen input.h --with-derive-partialeq --with-derive-eq

Actual Results
running 3 tests
test bindgen_test_layout_S0 ... ok
test bindgen_test_layout_U4 ... FAILED
test bindgen_test_layout_S2 ... FAILED

failures:

---- bindgen_test_layout_U4 stdout ----
	thread 'bindgen_test_layout_U4' panicked at 'assertion failed: `(left == right)`
  left: `16`,
 right: `8`: Size of: U4', /tmp/output-7qjh2751.rs:6:5485
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- bindgen_test_layout_S2 stdout ----
	thread 'bindgen_test_layout_S2' panicked at 'assertion failed: `(left == right)`
  left: `4`,
 right: `1`: Alignment of S2', /tmp/output-7qjh2751.rs:6:2289

failures:
    bindgen_test_layout_S2
    bindgen_test_layout_U4

test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out

Expected Results
No layout test failures.

Reduced by Alignment of S2
struct S2 {
  unsigned : 11
};

Reduced by Size of: U4:
union U4 {
  unsigned : 1
};

For alignment problem:
#include <stdio.h>

struct S2 {
  unsigned : 11;
};

int main() {
  printf("sizeof(S2)=%lu,alignof(S2)=%lu\n", alignof(S2), alignof(S2));
}

this little program outputs sizeof(S2)=1,alignof(S2)=1
And this is how it looks in IR

Interesting -- it looks like the layout libclang gives us says size = 2. What compiler are you using to compile the C program?

I compiled with clang++ --std=c++14 main.c
clang++ --version gives me
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Seems like we have a different problem in the size case.
Let's consider this header:
union U4 {
  unsigned : 1
};

in generated bindings assert test is failing
assert_eq!(
    ::std::mem::size_of::<U4>(),
    1usize,
    concat!("Size of: ", stringify!(U4))
);

and it makes sense if we look at U4 definition:
#[repr(C)]
#[derive(Copy)]
pub struct U4 {
    pub _bitfield_1: u8,
    pub bindgen_union_field: u8,
}

there are 2 disjoint fields, and this is clearly wrong.
I suppose in this case we shouldn't generate _bitfield_1 but should refer bindgen_union_field in bitfield's accessors.

Oops, my comment https://github.com/rust-lang-nursery/rust-bindgen/issues/1034#issuecomment-333650331 contains copy-pasta issue. It tells that it outputs sizeof(S2)=1,alignof(S2)=1 but actually it outputs alignof(S2), alignof(S2).
Sorry about that!
Fixed version:
#include <stdio.h>

struct S2 {
  unsigned : 11;
};

int main() {
  printf("sizeof(S2)=%lu,alignof(S2)=%lu\n", sizeof(S2), alignof(S2));
}

returns sizeof(S2)=2,alignof(S2)=1.
This makes things a little clearer.

Is it possible to solve now?
If I understand correctly to make this struct
#[repr(C)]
#[derive(Debug, Default, Copy)]
pub struct S2 {
    pub _bitfield_1: u16,
    pub __bindgen_align: [u8; 0usize],
}

to have alignment of 1 we should have #[repr(align)] attribute...

Depends on https://github.com/rust-lang-nursery/rust-bindgen/issues/849 and https://github.com/rust-lang/rust/issues/33626

It seems that repr(align(N)) on struct S has no effect if N is less than alignment of the S. Here is playground link.
It appears that we actually need to use repr(packed(N)) here.
Good news: repr(packed(1)) is a synonym of the repr(packed).


openjdk: remove references also in CA-derivations

analog to #350137
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[x] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[x] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

@emilazy you did some major refactoring recently to openjdk. Do you have time to have a look here? Should only be a small change, but a major rebuild

I don’t really understand the patch. Why do we need to remove references here?
Also, we should not propagate the jdk-bootstrap vs. jdk-bootstrap' error here. disallowedReferences should just be fixed.

I don’t really understand the patch. Why do we need to remove references here?

Because with ca derivations enabled by default, there is this reference which isn't removed

Also, we should not propagate the jdk-bootstrap vs. jdk-bootstrap' error here. disallowedReferences should just be fixed.

This is a bit above my knowledge. I did take a look there and am not that confident to change that. There seems to be only a few derivations which need that reference removed by hand (see the linked issue or #297466) and without this fix, openjdk will fail for everyone trying ca derivations for their config

Because with ca derivations enabled by default, there is this reference which isn't removed

What leaves a reference to the bootstrap JDK? There shouldn’t be any present, so having to strip them out seems concerning.

This is a bit above my knowledge. I did take a look there and am not that confident to change that. There seems to be only a few derivations which need that reference removed by hand (see the linked issue or #297466) and without this fix, openjdk will fail for everyone trying ca derivations for their config

The current state is incorrect and does not prevent references to the correct bootstrap package on JDK 8. I only kept it when merging the packages into one file to avoid rebuilds. If we’re touching the disallowed references code, we should use jdk-bootstrap' consistently.

Because with ca derivations enabled by default, there is this reference which isn't removed

What leaves a reference to the bootstrap JDK? There shouldn’t be any present, so having to strip them out seems concerning.

The same thing that is required to have disallowedReferences here in the first place.

This is a bit above my knowledge. I did take a look there and am not that confident to change that. There seems to be only a few derivations which need that reference removed by hand (see the linked issue or #297466) and without this fix, openjdk will fail for everyone trying ca derivations for their config

The current state is incorrect and does not prevent references to the correct bootstrap package on JDK 8. I only kept it when merging the packages into one file to avoid rebuilds. If we’re touching the disallowed references code, we should use jdk-bootstrap' consistently.

Ah, I missunderstood. I thought you were asking me to fix disallowedReferences in stdenv.mkDerivation (which would fix this and others like these, but is, like I said, above my understanding). If I now understand correctly, the following diff to this PR is what you are asking?:
diff --git a/pkgs/development/compilers/openjdk/generic.nix b/pkgs/development/compilers/openjdk/generic.nix
index 3238dc521561..ff5371882d8e 100644
--- a/pkgs/development/compilers/openjdk/generic.nix
+++ b/pkgs/development/compilers/openjdk/generic.nix
@@ -580,8 +580,6 @@ stdenv.mkDerivation (finalAttrs: {
           mkdir -p $out/nix-support
           #TODO or printWords?  cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
           echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
-          # remove references also in CA-derivations
-          find "$out" -type f -exec remove-references-to -t ${jdk-bootstrap'} '{}' +
         ''
       else
         ''
@@ -590,8 +588,6 @@ stdenv.mkDerivation (finalAttrs: {
           # properly.
           mkdir -p $jre/nix-support
           printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
-          # remove references also in CA-derivations
-          find "$out" -type f -exec remove-references-to -t ${jdk-bootstrap} '{}' +
         ''
     )
     + ''
@@ -601,6 +597,8 @@ stdenv.mkDerivation (finalAttrs: {
       cat <<EOF > $out/nix-support/setup-hook
       if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
       EOF
+      # remove references also in CA-derivations
+      find "$out" -type f -exec remove-references-to -t ${jdk-bootstrap'} '{}' +
     '';

   postFixup = ''
@@ -626,7 +624,7 @@ stdenv.mkDerivation (finalAttrs: {

   # TODO: The OpenJDK 8 derivation got this wrong.
   disallowedReferences = [
-    (if atLeast11 then jdk-bootstrap' else jdk-bootstrap)
+    jdk-bootstrap'
   ];

   passthru =

The same thing that is required to have disallowedReferences here in the first place.

The disallowedReferences here doesn’t change anything about the derivation outputs. It just implements an assertion that the resulting package doesn’t carry an unnecessary reference to the bootstrap JDK. If it does when ca-derivations are turned on, that seems to point to a problem that we shouldn’t just hack around?

Why do you think it is an assertion? If I read https://github.com/NixOS/nixpkgs/pull/211783 correctly, it actually removes the reference completely from the output. Following up on that https://github.com/NixOS/nix/issues/4629#issuecomment-1413401978 states that the disallowedReferences will not work for ca derivation. The comment from the closed PR which tried to fix it #214044 states
# We exclude Content Addressed derivations as they need to instantiate
# the store path after the derivation is built. Thus discarding
# context does not help in getting rid of the reference.

As @thufschmitt said in  https://github.com/NixOS/nix/issues/4629#issuecomment-2036138028 this is probably a wontfix in stdenv.mkDerivation
Ergo this needs the removeReferencesTo  fix

My understanding of that PR is that it just addresses an infelicity where disallowedReferences pulls in a build‐time dependency. Rather, the issue with https://github.com/NixOS/nixpkgs/pull/214044 is just that the hack we use to fix it breaks with ca-derivations.
I believe this patch is incorrect; it would mean that the disallowedReferences check would never trigger, even when we want it to. The other ones that have already been merged should probably be reverted. I do not think the correct fix is to sprinkle a workaround like this in every package that uses disallowedReferences across the tree for the sake of an experimental feature with known issues; even if we were to do that, it would probably make more sense to just conditionalize disallowedReferences on CA derivations rather than making it non‐functional. We  should fix it at the source in Nix like @thufschmitt suggested in https://github.com/NixOS/nixpkgs/pull/214044#issuecomment-1413447043 or work around it at a lower level like @trofi’s https://github.com/NixOS/nixpkgs/pull/214044.

I believe this patch is incorrect; it would mean that the disallowedReferences check would never trigger, even when we want it to.

I still don't believe it to be a check  but an actual removal of build-outputs from the output. Just not for ca-derivations

I do not think the correct fix is to sprinkle a workaround like this in every package that uses disallowedReferences across the tree for the sake of an experimental feature with known issues;

Agreed. Although I believe ca-derivations to be an important experimental feature, which we should try to make it work. The sprinkles are rather few anyway.
If #214044 actually fixes the issue, I would rather have that in nixpkgs as well.  @thufschmitt and @Ericson2314 what is your take on this?

I still don't believe it to be a check but an actual removal of build-outputs from the output. Just not for ca-derivations

No:
yuyuko:~
❭ nix build --impure --expr 'with import (builtins.getFlake "nixpkgs") { }; runCommand "test" { disallowedReferences = [ hello ]; } "echo ${hello} > $out"'
error: output '/nix/store/9w54wmf6pxxz9hf3ddzz50wdmb5ypjvc-test' is not allowed to refer to the following paths:
         /nix/store/ihc48rywbj8ymmjdb2gypyfzhw8yf8zq-hello-2.12.1

Agreed. Although I believe ca-derivations to be an important experimental feature, which we should try to make it work. The sprinkles are rather few anyway.

They are sprinkles that subvert the very purpose of the mechanism they are trying to fix. If you add remove-references-to on top of disallowedReferences, it’s the same as just removing the disallowedReferences, except with more code and more confusion. And we should not remove disallowedReferences checks just because CA derivations exposes a very broken Nix design decision that we haven’t worked around. At most, we could conditionalize disallowedReferences on CA derivations, but if we have to do that it should be done in stdenv.mkDerivation. I strongly believe the previous PRs should be reverted, as they are misleading and break disallowedReferences.

Thanks for the example and the clarification. This did help a lot.
What do you think of an revival of  #214044 and a tracking issue to remove the other remove-reference-to fixes?

Yeah, I think that sounds reasonable. The stdenv workaround is sort of weird and broken in the way that things were before we added that code in the first place, but it shouldn’t make things actively worse and it seems an acceptable compromise for testing CA derivations. As far as a tracking issue goes, are there more PRs than https://github.com/NixOS/nixpkgs/pull/350137 and https://github.com/NixOS/nixpkgs/pull/297466 that would need undoing?

Yeah, I think that sounds reasonable. The stdenv workaround is sort of weird and broken in the way that things were before we added that code in the first place, but it shouldn’t make things actively worse and it seems an acceptable compromise for testing CA derivations.

Ok, cool.

As far as a tracking issue goes, are there more PRs than https://github.com/NixOS/nixpkgs/pull/350137 and https://github.com/NixOS/nixpkgs/pull/297466 that would need undoing?

I don't know, I'll look into it tomorrow 👍

Let's do https://github.com/NixOS/nixpkgs/pull/214044 instead, please.

I believe this patch is incorrect; it would mean that the disallowedReferences check would never trigger, even when we want it to.

@emilazy I have found 65 references in nixpkgs with rg "(disallowedReferences)|(remove-ereference-to)" --stats where disallowedReferences and remove-ereference-to are used together. From a first glance it hasn't anything to do with CA-derivations but seems to be a common theme. But if I understood you correctly, they should never be used together for the same references, right?
Take gnuradio for example https://github.com/NixOS/nixpkgs/blob/23e89b7da85c3640bbc2173fe04f4bd114342367/pkgs/applications/radio/gnuradio/shared.nix#L71-L75
and
https://github.com/NixOS/nixpkgs/blob/23e89b7da85c3640bbc2173fe04f4bd114342367/pkgs/applications/radio/gnuradio/shared.nix#L85-L93
So, what should we do about those?

I think that they can make sense in conjunction sometimes: you want to enforce that nobody accidentally makes a reference leak, and there are also known references you want to remove to achieve that. If you strip references from every single file in the output, then the check can never break. But if it’s only one or two files it can be a sensible combination. Even if you’re stripping all references, maybe you’re worried about someone doing something in postFixup or something that undoes it? But generally it doesn’t make too much sense in that case, I think.
In the calibre case, if you used disallowedReferences without removeReferencesTo, the package build would fail. They strip the references from $out/lib/calibre/calibre/plugins/podofo.so because that’s what’s known to have such references; adding `disallowedReferences provides an assertion that more references don’t creep in through other files.
So I am only really concerned with packages that had disallowedReferences to express a property like “no trace of the bootstrap compiler remains in these outputs; the resulting OpenJDK does not encode references to the bootstrap tools”, and then get a sledgehammer remove-references-to applied that means that, were any such reference to creep in, we wouldn’t notice. AFAIK there’s only a couple of ca-derivations PRs that have been merged that did that, as that’s presumably the only motivation anyone has had to add these redundant commands, so those are my main concern.
I still don’t fully understand where the ca-derivations error comes from or why this stripping fixes it, but @trofi’s solution worries me a lot less :)

Yeah, this goes a little bit above my understanding, too :-D Thanks for your explanation about the differences and the usecases for  disallowedReferences and removeReferencesTo
@trofi solution seems to work, so I created #359318
I searched through the PRs and the nixpkgs files, but I haven't found more than those.

BTW, I forgot to mention that disallowedReferences is documented in the Nix manual. Possibly we should point to it from the Nixpkgs manual.


✨ Add support sqlite3

SQLite3 is commonly used on many softwares as file-based database.
That support will make this lib more useful, easy to use and getting easy examples.

Implemented at #9


RigidObject velocity control

Motivation and Context
This change introduces the VelocityControl class for setting constant linear|angular control velocities for RigidObjects. The PhysicsManager::stepPhysics() and derived variants consume this class to either set initial simulation velocities (MotionType::DYNAMIC), or integrate velocities to set new object states (MotionType::KINEMATIC).
The VelocityControl::linVelIsLocal variable allows the user to define local linear velocities in order to implement commands such as "forward" (e.g. [0.0,0.0,-1.0]) and "back" easily. In this case the linear velocity vector is rotated by the object's orientation transform before application.
Kinematic integration is done with VelocityControl::integrateTransform() which implements explicit Euler integration native to Habitat (i.e. does not require Bullet). This can be overrode in the future to introduce new integrators if necessary. Note: this form of velocity control is not constrained by collision.
How Has This Been Tested
New C++ unit tests and viewer demo testing (not included in this change):
Example with MotionType::DYNAMIC:

Example with MotionType::KINEMATIC:

Example with random angular velocity (to demonstrate 3D flight):

Types of changes

[ ] Docs change / refactoring / dependency upgrade
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.
[x] I have read the CONTRIBUTING document.
[x] I have completed my CLA (see CONTRIBUTING)
[x] I have added tests to cover my changes.
[x] All new and existing tests passed.

Haha, looking at the animations at first I thought you were hooking up some easing curves from the Easing namespace :)

Does seem that way, haha. Thanks for pointing those out, I'll have to take a look. We've been considering some curve utilities. 👍


Unit tests

I am trying to write unit tests for models in my tenant system, but am coming up short.
My test class looks like this:
<?php

use App\Cluster;
use Hyn\Framework\Testing\TestCase;

class ClusterTest extends TestCase
{

    public static function setUpBeforeClass()
    {
        Cluster::create();
    }

    public function testStore()
    {
    }

    public static function tearDownAfterClass()
    {
        $clusters = Cluster::all()->get();

        $clusters->each(function ($cluster) {

            $cluster->delete();
        });
    }

}

It reports "Class 'Config' not found" in
public static function tenantConnectionName()
    {
        return Config::get('multi-tenant.db.tenant-connection-name', 'tenant');
    }

Could you give some guidance as to how to write unit tests in a multi-tenant system? I don't mind setting which tenant to use manually, but I feel I lack some basic foundation to build upon.

First of all, writing unit tests like the ones you are attempting to write has nothing to do with my package. Second of all using setUpBeforeClass is frowned upon and will most likely not work, because Laravel uses setUp and tearDown to instantiate/setup the application before each method. The setUp method is called after the setUpBeforeClass, so the Laravel application isn't yet available.
Instead you should create your own setUp method and call the parent setUp within.

Well... getting a tenant database connection for unit tests has something to do with your package, I think - but ok, I will not bug you with that, then.
And yes, I don't know where I found that setUpBeforeClass and tearDownBeforeClass example - I got it working now with just setUp, tearDown and manually setting the tenant database connection in config.

The test you are writing is related to your own code, which uses the tenant connection, I agree. But I have no insight into your code and as such cannot help you with writing tests for them. The package by itself also tests the tenant connection, if you need examples how to write tests for them check the tests in the package.


profile added

Profile added
I just added my profile and the rest of the changes are just because of code formatting.

Hey @rahulpandey70, Please make sure you don't change the whole html file, just paste the given code and modify it!
Thank you!

Hey @rahulpandey70, Please make sure you don't change the whole html file, just paste the given code and modify it! Thank you!

I not changing whole HTML code, As I clicked ctrl + s to save file prettier format whole file.

Resolve conflicts, Please have a look

Thanks for your contribution!


Any function to disable swipe?

Is there any function or method to disable swiping of stacks?

Thank you


Can you tell me how to build one installer file?

Hey I am able to build the Installer with the scripts in Tools/msi/ but my installer consists of mutiple files (e.g. python-<IP_ADDRESS>52-amd64.exe, pip.msi, pip.wixpdb, lib.msi, lib.wixpdb and so on) ,  you mangaged to build one big file containing everything e.g. "64-bit executable installer". How do I have to change the scripts to be able to do that.

Building a single-file installer can be done with the buildrelease.bat script. First, add the folder containing gendef.exe to PATH. (This should be externals\windows-installer\binutils relative to the source root.) Then, from the Tools\msi folder, run buildrelease.bat -x86 to build the 32-bit installer or buildrelease.bat -x64 --skip-pgo to build the 64-bit installer.

Thanks you very much that fixed my problem.