Add Linux Notification Support

This mr adds a shared implementation for native code (c++ linux and windows) in native directory, as well as an almost complete implementation for linux and implements the required flutter code for windows but not the platform specific code.
Originally I planned to submit this mr with a working windows notification implementation as well however after two days going crazy trying to work out notifications in a windows VM and me myself not using windows I have decided to leave it for someone else crazy enough to try and wrangle through microsoft's documentation.
For anyone in the future trying to implement notifications on windows - I managed to get notifications to show similar to what is seen below on linux with winrt and its toast notifications, however I couldn't figure out how to update the notification after it was posted, and the CMakeList.txt file and actual code was  "janky".
The linux implementation is almost complete as it lacks alarm / vibration support due to shared preferences not seeming to work and lacks an AlarmManager like implementation. Instead the notification is checked for update every 1000 / 60 ms and in that loop it checks if the timer has expired so at most it would be off by 1000 / 60 ms. If more accuracy is needed there is some kernel function calls and / or SIGALARM but I thought that might have been overkill.
Unfortunately I couldn't seem to get a progress bar.
Examples below using various Notification daemons e.g. dunst, xfce, mate

Crazy work mate really well done. I think i'll look into how to play sounds before merging since the main point of an alarm is being notified at the end.

As for shared preferences errors, I was actually considering removing them and just using drift sqlite for everything (1db instead of 2). Thoughts on me doing that? It means backups/imports of entire DB includes settings (which is getting large now).

Haha I said that, checked out the branch, and did a bunch of work that now depends on your structure so i guess im including it!

As for shared preferences errors, I was actually considering removing them and just using drift sqlite for everything (1db instead of 2). Thoughts on me doing that? It means backups/imports of entire DB includes settings (which is getting large now).

It was pretty useful in Massive especially when debugging, so that sounds like a great idea.
As for the sound originally I was thinking of using something like ffmpeg, but seeing that audioplayers is already a dependency and it has a linux implementation which is currently being linked to the final executable, it might be better to play via that.


My ludosavi app is crashing at startup

Ludusavi version
v0.22.0
Operating system
Windows
Installation method
Standalone
Description
Hello
When I open the executable (with or without admin permissions) this screen appears

Then it closes by itself
I tried redownloading the file, removing the folder in roaming but nothing changes
No logs are created
Logs
No response

It still creates the folder when I click on save data when I close a game through Playnite but I can't open the executable by myself

I had the same issue and resolved it with updating my Graphics Drivers.

I had the same issue and resolved it with updating my Graphics Drivers.

I don't seem to have any update available

Hi! Could you try a few tests?

Test 1: Open Command Prompt and run the following
set LUDUSAVI_DEBUG=1
set RUST_LOG=trace
C:\path\to\ludusavi.exe

After running that, please upload a copy of %APPDATA%\ludusavi\ludusavi_rCURRENT.log

Test 2: Open Command Prompt and run the following
set ICED_BACKEND=tiny-skia
C:\path\to\ludusavi.exe

Does the same issue happen?

Test 3: Please try the latest development version of Ludusavi to see if the issue happens there too: ludusavi-v0.22.0-win64.zip

This is the log
ludusavi_r2024-03-19_08-36-31.log
Test 2 seems to open the app now but only from the Terminal
Test 3 triggered my Windows Defender claiming the .exe is a Defense Evasion

Test 3 triggered my Windows Defender claiming the .exe is a Defense Evasion

For what it's worth, on VirusTotal, Microsoft Defender is the only negative  report, so it's definitely a false positive. That said, I'll see if I can do anything to avoid setting it off.
In the meantime, here's a way to get option 2 working without the terminal:

In the Start Menu, type "Edit the system environment variables" and click on the result with that name
Click the "Environment Variables..." button
In the upper half, click the "New..." button
Variable name: ICED_BACKEND, variable value: tiny-skia

@fantasygone I believe I've fixed the false positive from Windows Defender. Could you give this another try? (Just remember to remove the ICED_BACKEND variable first, if you followed the steps in the above comment.)
Download: ludusavi-v0.22.0-post.31+c79111b-win64.zip
VirusTotal: https://www.virustotal.com/gui/file/8099c5a53eb471fb6ec1a5aaf7fb4b41cbedecf3a66c739cc69296233f6ba2f1?nocache=1

@fantasygone I believe I've fixed the false positive from Windows Defender. Could you give this another try? (Just remember to remove the ICED_BACKEND variable first, if you followed the steps in the above comment.)
Download: ludusavi-v0.22.0-post.31+c79111b-win64.zip
VirusTotal: https://www.virustotal.com/gui/file/8099c5a53eb471fb6ec1a5aaf7fb4b41cbedecf3a66c739cc69296233f6ba2f1?nocache=1

Tested, this one crashes as well. Which is odd since the .exe was working fine last time I used it and I didn't even update or anything (It still was the latest version)
Something on my end probably changed that makes it crash but I have no idea what

If I may ask, what does that environment variable mean and why does changing it solve the issue at hand? Thank you

By default, Ludusavi uses the GPU to render, and it relies on DirectX, Vulkan, or Metal, depending on your system. Setting ICED_BACKEND=tiny-skia makes it use software rendering instead.

So that implies there is an issue with my GPU

My AMD update came just now so that's why I didn't find it the other day, it's working as intended now
Thank you mtkennerly and TariqMK for your time

I don't understand. It's happening again
When I clean uninstall AMD drivers with DDU, I can start ludosavi correctly, but I don't think I should use my pc without drivers
The moment I install AMD drivers even with Windows updates disabled I come across the same issue, I have no idea what to do
Is my GPU broken or something?

It sounds like an issue with specific driver versions. Which version do you have now, and do you remember which version worked a few weeks ago? Are these the generic AMD drivers or ones from your computer manufacturer?

24.3.1 is the latest I downloaded with AMD Software: Adrenaline Version

I don't remember what version it was the other time

Downgrading to 23.12.1 doesn't work either.
I would throw AMD into a dumpster on fire if I could. So many issues for no reason

Is there a way to test with any other program to see if it's a case specific with ludosavi?

There are some other apps that use the same graphics library here: https://iced.rs/ . You could give some of those a try and see if they have the same issue.
If you don't mind installing Git and Rust, you can try some tests in Command Prompt to narrow it down at the library level:
Iced
git clone https://github.com/iced-rs/iced.git
cd iced

# latest version
cargo run -p counter

# version used by next Ludusavi release
git checkout 0.12.1
cargo run -p counter

# version used by Ludusavi v0.22.0
git checkout 0.10.0
cargo run -p counter

Output

Wgpu
git clone https://github.com/gfx-rs/wgpu.git
cd wgpu

# latest version
cargo run --bin wgpu-examples cube

# version used by next Ludusavi release
git checkout v0.19.3
cargo run --bin wgpu-examples cube

# version used by Ludusavi v0.22.0
git checkout v0.16.3
cargo run --example cube

Output

Iced
git clone https://github.com/iced-rs/iced.git
cd iced

# latest version
cargo run -p counter

I tried the Iced option before and after installing AMD drivers. Before it opens and I can see the buttons like in your screenshoot, I can increase and decrease the count.
After installing the drivers, however, I get the same white screen and crash.
This is the error

Could this just be AMD not supporting this thing? Kind of sad if this is it. Yet another thing AMD can't do compared to NVIDIA. Ugh.

Could this just be AMD not supporting this thing?

I'm not sure :/ Driver issues can definitely be a pain to narrow down, and I'm not an expert in that area. For now,  keeping ICED_BACKEND=tiny-skia set is the best advice I can suggest.

If the Wgpu examples don't work either, you could try reporting the issue at https://github.com/gfx-rs/wgpu/issues along with your driver info. Maybe they could help.

Same result sadly

I can try reporting this to Wgpu and see what they say. Could you just copy/paste the full output for this?
set RUST_BACKTRACE=full
cd wgpu
cargo run --bin wgpu-examples cube

C:\Users\user\wgpu>cargo run --bin wgpu-examples cube
Finished dev [unoptimized + debuginfo] target(s) in 9.15s
Running target\debug\wgpu-examples.exe cube
[2024-04-12T08:22:20Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-04-12T08:22:21Z ERROR wgpu_hal::auxil::dxgi::exception] ID3D12CommandQueue::ExecuteCommandLists: Using ClearRenderTargetView on Command List (0x0000014DEC8C6DE0:'Unnamed ID3D12GraphicsCommandList Object'): Resource state (0xD84F1E90: D3D12_RESOURCE_STATE_[COMMON|PRESENT]) of resource (0x0000014DEC8B6920:'Unnamed ID3D12Resource Object') (subresource: 0) is invalid for use as a render target.  Expected State Bits (all): 0xD84F1E70: D3D12_RESOURCE_STATE_RENDER_TARGET, Actual State: 0xD84F1E50: D3D12_RESOURCE_STATE_[COMMON|PRESENT], Missing State: 0x4: D3D12_RESOURCE_STATE_RENDER_TARGET. [ EXECUTION ERROR #538: INVALID_SUBRESOURCE_STATE]
[2024-04-12T08:22:21Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "AMD Radeon(TM) Graphics", vendor: 4098, device: 5688, device_type: IntegratedGpu, driver: "AMD proprietary driver", driver_info: "24.3.1 (AMD proprietary shader compiler)", backend: Vulkan }
[2024-04-12T08:22:21Z INFO  wgpu_examples::framework] Using AMD Radeon(TM) Graphics (Vulkan)
[2024-04-12T08:22:21Z INFO  wgpu_examples::framework] Entering event loop...
[2024-04-12T08:22:21Z INFO  wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 }
[2024-04-12T08:22:21Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 1422, height: 700 }
[2024-04-12T08:22:21Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
[2024-04-12T08:22:21Z INFO  wgpu_examples::framework] Surface resize PhysicalSize { width: 800, height: 600 }
HookApp::findGameWindow, injectWindow:<PHONE_NUMBER>000000
HookApp::findGameWindow, graphicsWindow:<PHONE_NUMBER>0F06A2
error: process didn't exit successfully: target\debug\wgpu-examples.exe cube (exit code: 0xc000041d)

I have something weird to report
I have found out that my GPU 0 is not being used:

Only the GPU 1 is in use, how did this happen? Is this the culprit?

Doing this solved my issue (for now)
Before I close the issue once again how do I set the first GPU by default and why did it change?

That's a good find!

Before I close the issue once again how do I set the first GPU by default and why did it change?

I'm not sure. On my system, the top option is labeled Let Windows decide (High performance), and I have the Performance power plan selected (Control Panel > Choose a power plan), but I don't know if those are directly related.
I would guess that a driver update and/or Windows update caused the preference to change by accident, but it's hard to say for sure.

Alright, thank you
May this thread help someone else with the same issue


Fix failing builds

Fixes forgotten docs sync in https://github.com/bbatsov/rubocop/commit/ff596950180f5b9bdc742a45b473a01234b0c4be.

Specify public_suffix version (since the latest restricts Ruby to >=2.1.0).

These two cause CI failures (in master too) https://travis-ci.org/bbatsov/rubocop/jobs/268281660 and https://travis-ci.org/bbatsov/rubocop/jobs/268281657 respectively.

👍


⚠ AVS (kty) has degraded performance

In f579c9d, AVS (kty) (https://avus.com.br) experienced degraded performance:

HTTP code: 200
Response time: 8128 ms

Resolved: AVS (kty) performance has improved in f9b7d9d.


Implementation for VK_KHR_ray_tracing

Currently, the VK_NV_ray_tracing extension for Vulkan is used.
A sample implementation for VK_KHR_ray_tracing is in progress here and will later be added to this project.

nice.. will keep an eye!

great!


vr: cleanup files in /var/cache/cloud/processed every day

Description
This PR fixes #3757
This adds a daily cron job to clean up files in /var/cache/cloud/processed older than 180 days, 179 days, ... until the disk space usage does not exceed threshold (80%). the logs in last 5 days will not be cleaned.

Types of changes

[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] New feature (non-breaking change which adds functionality)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] Enhancement (improves an existing feature and functionality)
[ ] Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale

[ ] Major
[ ] Minor

Bug Severity

[ ] BLOCKER
[ ] Critical
[ ] Major
[x] Minor
[ ] Trivial

Screenshots (if appropriate):
How Has This Been Tested?

@blueorangutan package

@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_multiplication_x: el8 :heavy_check_mark: debian. SL-JID 917

@blueorangutan package

@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 924

@blueorangutan test

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Trillian Build Failed (tid-1711)

@weizhouapache the logrotate service should be able to take care of this right rather than adding a new shell script? we can specify the duration to keep the logs also

@blueorangutan test

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@weizhouapache the logrotate service should be able to take care of this right rather than adding a new shell script? we can specify the duration to keep the logs also

@ravening no. logrorate will rotate the log files in /var/log

@weizhouapache the logrotate service should be able to take care of this right rather than adding a new shell script? we can specify the duration to keep the logs also

@ravening no. logrorate will rotate the log files in /var/log

@weizhouapache but we can add an extra rule to monitor /var/cache also right?

Trillian test result (tid-1714)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34754 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5331-t1714-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_iso.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 87 look OK, 0 have error(s)
Only failed tests results shown below:

Test
Result
Time (s)
Test File

@weizhouapache the logrotate service should be able to take care of this right rather than adding a new shell script? we can specify the duration to keep the logs also

@ravening no. logrorate will rotate the log files in /var/log

@weizhouapache but we can add an extra rule to monitor /var/cache also right?

@ravening the problem is, we do not know what the filenames are.
here is an example
root@r-88-VM:~# ls -l /var/cache/cloud/processed/
total 24
-rw-r--r-- 1 root root 239 Aug 19 07:44 vm_dhcp_entry.json.82cf8311-f5d4-4a10-9b50-001e0558082a.gz
-rw-r--r-- 1 root root 239 Aug 19 07:42 vm_dhcp_entry.json.ef071140-60d8-4a20-970d-ca4979aee9f5.gz
-rw-r--r-- 1 root root 406 Aug 19 07:44 vm_metadata.json.26853b78-280b-4ea5-94b2-55e83bb332e4.gz
-rw-r--r-- 1 root root 406 Aug 19 07:42 vm_metadata.json.27cbd5c6-43b8-417f-8c1d-e51fc697ce10.gz
-rw-r--r-- 1 root root 160 Aug 19 07:42 vm_password.json.08296973-3f9a-4fb5-ac75-d9c9c9c9c8fb.gz
-rw-r--r-- 1 root root 160 Aug 19 07:44 vm_password.json.dea5c53d-043a-43f1-980c-f904a1e7b5b7.gz


New versions of a stack should update CRDs installed by previous versions of the stack

What problem are you facing?
Namespace Stacks (StackInstalls) can have multiple instances installed per Crossplane cluster.  Furthermore, they may also be at different versions from each other.  This is described in detail in the security/isolation design doc.
If an existing version of a Namespace Stack is already installed and a new version is attempted to be installed, the Stack Manager will currently see that the CRDs already exist and do nothing.  This means that any new versions of the CRD that are in the new version of the stack will be ignored and not installed.
How could Crossplane help solve your problem?
The Stack Manager should be smarter about how it handles multiple versions of a namespace stack.  Instead of seeing that a CRD already exists and doing nothing, it should attempt to "update" the existing CRD with the new schema/versions in the new stack.  Example:
Stack foo:v1 is installed which has CRD bar.group.io/v1.  If stack foo:v2 gets installed which has CRD bar.group.io/v2, we should end up with a merged/updated CRD bar.group.io that has both versions v1 and v2.
We'll need to think through this carefully, I'm sure there are plenty of pitfalls.
Homework research problem: what is the right behavior to do in general (upstream k8s) if a CRD is installed when an older version of it already exists? Is there upstream guidance on this?

Homework research problem: what is the right behavior to do in general (upstream k8s) if a CRD is installed when an older version of it already exists? Is there upstream guidance on this?

An interesting feature of the CRD spec is that each version details its own OpenAPI spec.  There is also a conversion option: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/#specify-multiple-versions
I think one strategy that we can take is to always adopt the newer CRD and fail a StackInstall if the CRD provided has conflicting (or omitted) version definitions required by installed Stacks.
By doing this, we do not need to hand tweak (merge) CRDs.  Doing so would leave conversion to change, and the CRD author should take control of that.  I don't know enough about the conversion process.  I wonder if the StackManager or controllers would need special roles to trigger a conversion or if a CRD conversion definition introduces an opportunity for (namespaced) Stack installers to get escalated privileges.

https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning/#webhook-conversion
The ability to convert resources to newer versions will require Stacks to install conversion Services.  I believe the limitations and requirements of these services would be bound to a new service account.  I do not know what requirements should be necessary.  It may be sufficient to initially restrict the Service service account to operate on the kind it is converting.  I don't think remote (url) webhooks pose a problem for Stacks over "service" referencing webhooks.

This content has been merged into #1014 for consolidated tracking


Option to add description to snapshot

Output of restic version
restic 0.9.5 (v0.9.5-46-g604b18aa) compiled with go1.12.7 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
Ability to add a description to a snapshot (i.e. "after upgrading OS to version 5.4.2")
What are you trying to do?
When I list snapshots, I would like an optional description describing the event that
caused us to make the snapshot (i.e. after upgrade to version 3.4.5)
Did restic help you or made you happy in any way?
Very good things:

Static binary (which can live with the backups)
Ability to mount the snapshots
Save a good amount of space by deduping

Just add a tag to the snapshot. See restic help backup, in particular the -t tag argument. It's not free-form text, but good enough to do what you need if you just don't write such plain english. An example tag could be postUpgradeOsToV542.

I knew about tags, but sometimes I want to include 'bullet points' in my description, such as:
"After running tronscript 10.8.2:

with mb disabled
and cleaners disabled"

I find it improper and difficult to put this in a tag.

Heh, seems terribly overkill to me. I can't even relate to wanting to do that. But I guess everyone has their use cases :-)

I can see the usecase though. It's like a btrfs snapshot where you can add a comment or when you do a snapshot in VMWare; you can add a comment to it. I just checked and Borg has a feature where you can add a comment to a snapshot. Not to say that just because borg has it, restic must have it also, but just to highlight that there can be usecases.
I could see that one would do a restic snapshots and maybe filter for specific words in a comment field to find the right snapshot. But then again this could also be solved via tags - but maybe this is abusing the tag feature for something it shouldn't do.

because restic uses principles from git i would say that the request sounds similar to a commit-message

I agree with @moritzdietz. Like a comment on a git commit, a snapshot must have a description to make sense if you plan to keep them for years. In my opinion it a very serious design oversight which makes it more manifest the longer you use restic snapshots. I have been using it for 3 years now and cannot make any head and tail from the old snapshots I took in the beginning. I wish I had the ability to put comments on them to explain to my future self what are the reasons for those snapshots. This is a very serious issue in hindsight.
The way I think of it is somehow being able to add/link description to a snapshot like an annotated tag in git with the ability to add/edit/remove them from snapshots.
It would also make sense to have an option to exclude snapshots with descriptions from forget command if desired or marking a snapshot with a flag protected to indicate that it must be retained and excluded during forget operations.

This would be very much appreciated

Started using Restic recently and was surprised that despite it being so feature-rich, it didn't have this basic feature. Would greatly appreciate adding it. Thanks

Same. I've been trying to use a generated file list via --files-from-raw so I could have greater control over what gets stored but it's resulting in a comically huge message that's actually causing multiple GUIs (restic-browser and backrest) to either freeze or fail to browse the snapshot contents; that's not restic's fault of course, but it does illustrate how unexpected this is.

I would also like to see this feature being added to Restic some day :+1:

+1

Thank you so much for adding this to your roadmap! ✨

I'd love this! I started using restic because I wanted a tool exactly like it and it fit my use case perfectly! I think adding descriptions would be super useful since I do my backups manually, like if I have a folder I want to archive I'd manually run a backup and delete the folder. But the name of the folder alone isn't good enough to know what it was or why I archived it and the context.
This would fit a similar use case to https://github.com/restic/restic/issues/4026


Corrects neovim installation directory

This is to match the more correct location for the autoload directory, so that it matches the instructions on the Wiki.

Note that the Travis builds are currently failing right now, but I highly believe that it is an unrelated problem to my PR, as I am only changing the README.

I think you're mistaken, the path was suggested by the maintainer of Neovim. See the discussion in #559.

Okay @junegunn , that's fair. But then, if the README indeed has the correct information, should the Wiki page then match that of the README?
I don't mind making that change, in that case.
And I don't mind being corrected, thank you for the updated information :)

The information is correct for regular Vim. And we don't want to repeat ourselves here and there for every alternative implementation of Vim. When one chooses to use an alternative rather than the base implementation that the majority of the users use, one should be aware of its differences.

By the way, whice wiki page are you referring to? The link you posted above is pointing to a travi-ci page. I'll update the page if it contains outdated information.

@junegunn My bad on the incorrect link! Friday night, less caffeine in the system...inexcusable!
I have corrected my original PR description. Pasting it here too: https://github.com/junegunn/vim-plug/wiki/tips. Check out the Automatic Installation section.


Add stopPropagation to remove choice handler

Hi!
I've faced the problem using select2 with multiple=true inside bootstrap's dropdown: selecting new values worked fine but clicking on x to remove choice closed dropdown leaving select2's list.
It's suggested to add stopPropagation to click handlers to prevent dropdowns from closing, like it's done in bootstrap for forms: https://github.com/twbs/bootstrap/blob/v4-dev/js/src/dropdown.js#L428
I've ended with this monkey-patch to make everything work:
  var MultipleSelection, old_bind;
  MultipleSelection = $.fn.select2.amd.require('select2/selection/multiple');
  old_bind = MultipleSelection.prototype.bind;
  MultipleSelection.prototype.bind = function() {
    old_bind.apply(this, arguments);
    return this.$selection.on('click', '.select2-selection__choice__remove', function(evt) {
      evt.stopPropagation();
      return false;
    });
  };

Do you think if this stopPropagation should be added to select2's default behaviour? Or this example to docs?
PS. Thanks for using prototypes instead of private local functions :)

Is this the information that is supposed to be covered in the "preventing events" section?  See https://github.com/select2/docs/issues/5

I'm not sure. Seems like that section is for preventing select2 internal events. But this one is about preventing click event. I have this for preventing dropdown close, but it works for everything except this x buttons:
  $(document).on('click', '.dropdown-form', function(e) {
    e.stopPropagation();
    return false;
  });

I think this is because they got removed from document in select2 handler, and this delegated handler is not fired. So the question was more about adding stopPropagation to select2 implementation.

Or this snippet can be placed to cookbok, if there will be one.

Actually, did you know about the closeOnSelect configuration option?  Maybe a closeOnRemove option would be a useful complement to this.

This options affects select2 dropdown behaviour, but i'm about bootstrap's dropdown which contains select2 input.

I hope we can close this one.


Fix (cross) i686-netbsd

Motivation for this change
With these changes, I was able to cross-compile GNU hello to i686 NetBSD (didn't check it runs yet).
Not sure if there's maybe a better way to make the triple change.
Things done

[x] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Added a release notes entry if the change is major or breaking
[x] Fits CONTRIBUTING.md.

I should investigate whether USE_SSP=no is needed globally on i686, because I think it's unlikely to be anything libc-specific.

For nix-build --arg crossSystem "{ config = \"i686-unknown-netbsd\"; }" -A hello I still get a configure time error for binutils at e6d4cd3bf3be8a96a2472a7c82ba2181af936acc.
*** ld does not support target i686-unknown-netbsd
*** see ld/configure.tgt for supported targets

What is the triple supposed to be? i686-unknown-netbsdelf?

From the perspective of the GNU toolchain, it's supposed to be i486--netbsdelf. It's "netbsdelf" because the (very old) NetBSD i386 target is for a.out binaries. However, I don't think nixpkgs groks i486 as a target.

i686-unknown-netbsdelf works.  @sternenseemann I'm guessing your problem is that you're specifying the triple, so we won't generate one?  I tested with crossSystem.system = i686-netbsd.

i686-unknown-netbsdelf works.  @sternenseemann I'm guessing your problem is that you're specifying the triple, so we won't generate one?  I tested with crossSystem.system = i686-netbsd.

From the perspective of the GNU toolchain, it's supposed to be i486--netbsdelf. It's "netbsdelf" because the (very old) NetBSD i386 target is for a.out binaries.

GNU understands i686-unknown-netbsdelf fine as well, so I think I'd like to go with that for consistency.

However, I don't think nixpkgs groks i486 as a target. It is probably worth supporting as a target, because besides retro machines, AMD Geode LX embedded boards (commonly used for e.g. outdoor wifi access points) are 586-class.

Working on it. :)

i686-unknown-netbsdelf works. @sternenseemann I'm guessing your problem is that you're specifying the triple, so we won't generate one? I tested with crossSystem.system = i686-netbsd.

Okay, will try again, I thought it would parse i686-unknown-netbsd and spit it out as i686-unknown-netbsdelf again.

It's ugly, but i feel it might be better to either just use netbsdelf everywhere, or patch GNU tools. We've never had this sort of conflict before.

I am happy to help upstream that sort of thing too. I at least have done a lot of gnu config contributing in the past.

"netbsdelf" on i*86 only feels more correct to me, but it does come at the expense of having a special case.  I think I have a mild preference for it over hardcoding "netbsdelf".
What do you imagine being fixed upstream?  autoconf already recognises "i686-unknown-netbsd", but it assumes it's a.out, and then says it doesn't support it.  AIUI, a.out hasn't been the right choice since the 90s, so it must be a backwards compatibility thing?  Since it already recognizes it, I'd expect it to be fairly difficult to change that behaviour?

IMO, deviating from the target names used by NetBSD toolchain is a bad idea. xxx-unknown-netbsd is the standard expected format for most NetBSD architectures, but means a.out on i386, and changing the meaning of that might be dangerous.
Also, a lot of NetBSD support is missing from upstream binutils. I'm not sure if nixpkgs using upstream binutils over NetBSD binutils for NetBSD targets is th right e way to go currently.

They way I see it, everything was historically a.out, and the only reason upstream didn't change was netbsd was fine making any patches locally. Furthermore, per conventions this should be i686-unknown-netbsd-elfif some sort of distinguisher is really necessarily.
I can't imagine very much uses a.out at this point, so I think it would be at least good to have the conversation, and put forth .*-netbsd-elf as a fallback if back compat is still an issue.

That would be totally inconsistent with what NetBSD itself does, and you'd be renaming the targets of the most popular architectures - the ones that weren't historically a.out (amd64, aarch64, sparc64...)

Every single thing that uses a GNU build system would break.

Would it?  As far as I can tell, the GNU build system understands "netbsdelf" and "netbsd" identically on all platforms that use elf by default?  configure scripts I've looked at seem to all check for *-*-netbsd*.

Furthermore, per conventions this should be i686-unknown-netbsd-elf if some sort of distinguisher is really necessarily.

Is that the convention?  I've only ever seen the fourth triple member used for libc, and there were no matches when I looked for "-elf" in config.guess.

Also, in Nixpkgs, we also chose to interpret pairs like i686-elf as i686-none-elf. GNU config doesn't yet, in fairness, but LLVM also does I believe.

I've thought about this further, and I definitely don't think netbsdelf everywhere is the way to go.  That would mean just setting the kernel name in Nixpkgs to netbsdelf, and I think that would come back to haunt us, because the executable format is not a property of the kernel -- NetBSD can run both ELF and a.out.  So we wouldn't be able to accurately compare kernels just by comparing their names, which we currently do.  I don't want to have to introduce a whole new complicated layer to determine kernel compatibility.
So that makes me think that the approach in this PR is the way to go -- just accept that this is a somewhat ugly special case.

I've pushed a small cleanup, that also takes into account the other architectures we support that GNU assumes are a.out on NetBSD.

I either kept or choose to call that the "kernel", but that is wrong an should be changed, it is really about the syscall interface, or more broadly the interface between the userland and the kernel:

WSL1 and lxbranded zones use "linux"
Wine uses "windows" or similar
we ought to have a "browser" one that firefox and chrome can implement for JS and WASM.

I am down to merge this as a stop-gap, but it would be nice to see what the offending bits in binutils and gcc are so we can decide how hard they are to patch.

I think it probably wouldn't be that hard to patch -- the a.out versions don't do anything except print a message saying they're unsupported.  It's really just a policy question to ask upstream, I think -- do they want to change the defaults?  We'd probably also want to ask the maintainers of the binutils tree in NetBSD what they think, so they're not surprised by any change.

Fair enough. Also note that config is supposed to be parsable too so you might need special cases in the other direction. (Sorry I didn't think of this sooner.)


UML diagrams

Added fist rev of class diagram of HAL, SPI, I2C and Sensors combined

Needs to be updated with new I2C lib


[Question] How to read a tar from assets

I have a tar.gz in my assets bundle, I would like to read that as a stream. Is that possible with this package?

It is possible with this package. But you can't benefit from the steaming reader as much since there is no way to open an asset as a stream right now (https://github.com/flutter/flutter/issues/73322). Still, you can do something like:
final data = await bundle.load(...);
final reader = TarReader(Stream.value(data.asUint8List()).transform(gzip.decoder));

while (await reader.moveNext()) {
  // deal with tar entry
}

Ah, that's a bummer. I considered using this package because of its streams.
I have a rather large archive (uncomoressed 400mb) that I want to unpack from assets. So that the UI is not blocked, I am unpacking it in a separate isolate. However, the root bundle is not accessible in an isolate. Therefore, the whole archive needs to be loaded into memory and then copied to the second isolate, which takes a lot of time additional to the unpacking.
Maybe there is a workaround I am not aware of?

To be fair you only need to load the compressed archive as a single blob, by invoking the gzip decoder as a stream transformer the decoding can still happen in smaller chunks.

I was thinking about using a dart:ffi pointer and pass that to the isolate as the loaded data from root bundle is just a Uint8List?

Yeah that should work, but I think you need to copy to get a pointer from the Uint8List. So you might as well use a TransferrableTypedData which can be moved across isolates - then you don't have to care about when to free memory.

Yeah that should work, but I think you need to copy to get a pointer from the Uint8List. So you might as well use a TransferrableTypedData which can be moved across isolates - then you don't have to care about when to free memory.

Wow, thank you, this looks promising! However, the docs state

A TransferableTypedData is created from a number of bytes. This will take time proportional to the number of bytes.

So, will this still copy the whole thing once? Or can I create this directly from the root bundle?

To be fair you only need to load the compressed archive as a single blob, by invoking the gzip decoder as a stream transformer the decoding can still happen in smaller chunks.

Would it be possible to just send the stream transformer to the isolate, thus avoiding the need of copying?

So, will this still copy the whole thing once? Or can I create this directly from the root bundle?

Yeah, it will copy. But if you want to convert the asset into an externally-managed buffer with dart:ffi, you'll have to copy once as well.

Would it be possible to just send the stream transformer to the isolate, thus avoiding the need of copying?

The stream transformer alone is not that useful, and streams can't be sent over isolates since they need to track callbacks and the data source. I think copying the (compressed) asset once to move it to the background isolate (which would then do the decompression + tar reading) is likely the most efficient approach possible right now.

@simolus3 thank you for your help! I will then stick with the frozen UI and unpacking it in the main isolate. Copying the data seems to take a very long time (the time to unpack the data nearly tripled)
I am not sure how you want to handle this issue, this would be a great feature to add in the future. Maybe you want to keep it open to track this feature.

Well, I need to correct myself here, the slowdowns came from an update to the archive package. However, once streaming from assets and access to assets in an isolate is possible, would be great to use this in this package, then I would also switch to this package.
Here the related issues from the flutter repo

https://github.com/flutter/flutter/issues/96895
https://github.com/flutter/flutter/issues/73322

I'll close this issue since nothing in this package is blocking it, Flutter just needs to expose streams for assets.

Well, I need to correct myself here, the slowdowns came from an update to the archive package

Note that, while the total extraction time might be slightly slower when using package:tar, there are many asynchronous suspension points allowing other parts of your app to run.
So it might be possible to extract gzipped tar files by loading the compressed blob into memory and then using a TarReader(Stream.value(compressedData).transform(gzip.decoder)) without causing UI lags.


Unable to obtain latest Mitre Att&CK information. Please ensure that the device is connected to the internet.

When executing with the following command (with and without admin privileges):
.\Mitigate.exe -OutFile=results.json
The following error message appear :

-> Unable to obtain latest Mitre Att&CK information. Please ensure that the device is connected to the internet.

Please take note that nothing on my device would indicate (at first sight) a network problem.

Thank you for letting me know @VBoucher.
I have just pushed a small update (334ddf09772c15a9fa0fe9391b2db44893c2355e)  that seems to resolve the issue ( The root cause had to do with an SSL issues).
Can you kindly let me know whether this resolves the issue on your machine as well?

Hello,
Sorry for the huge delay. It worked. I no longer have the problem.


Change input format to use GML

Summary
We need an input describing what flows are free, and we chose to use GML.
Basic Example
Here is an example of GML file:
graph [
	comment "This is a sample graph"
	directed 1
	id 42
	label "Hello, I am a graph"
	node [
		id 1
		label "node 1"
		thisIsASampleAttribute 42
	]
	node [
		id 2
		label "node 2"
		thisIsASampleAttribute 43
	]
	node [
		id 3
		label "node 3"
		thisIsASampleAttribute 44
	]
	edge [
		source 1
		target 2
		label "Edge from node 1 to node 2"
	]
	edge [
		source 2
		target 3
		label "Edge from node 2 to node 3"
	]
	edge [
		source 3
		target 1
		label "Edge from node 3 to node 1"
	]
]

Drawbacks
It looks like it doesn't support data to be attached to nodes and edges (@suvayu, do you know?). If that is the case, we might have to find something else.
@datejada, is there anything else apart from the profile that is attached to an edge?
Reference Issues
No response

Just realize that for the Nordic test case we have in the repo, all the input data are attached to assets/nodes (even profiles). No input data are attached to the flows/vertices.

It looks like it doesn't support data to be attached to nodes and edges (@suvayu, do you know?). If that is the case, we might have to find something else.

I think that's correct.  GML is only for the graph.  Based on what I recall, there is no standard for the attached metadata because it can be anything, there's no way to standardise this.  The way I see it, any such data is essentially tabular:
id:
  type: integer
name:
  type: string
meta1:
  type: string
meta2:
  type: number
meta3:
  type: array
  items:
    type: number
...

So a combination of GML + CSV should suffice.

Hi,
I agree with @suvayu that combining GML + CSV files should be enough.
@abelsiqueira please find in the attached file the example we use for testing in the GML format (only the assets and flows information). The profiles should be the same as the ones in the current CSV files, but let me know if we need to change the format too...
ex1-assets-flows-graph.txt


cookies missing

Hi,
I fed the script with my key (-s) and the script crashed.
am I missing something?
Traceback (most recent call last):
  File "~/.local/bin/hbd", line 8, in <module>
    sys.exit(cli())
  File "~/.local/lib/python3.8/site-packages/humblebundle_downloader/cli.py", line 84, in cli
    DownloadLibrary(
  File "~/.local/lib/python3.8/site-packages/humblebundle_downloader/download_library.py", line 63, in start
    self.purchase_keys = self.purchase_keys if self.purchase_keys else self._get_purchase_keys()  # noqa: E501
  File "~/.local/lib/python3.8/site-packages/humblebundle_downloader/download_library.py", line 397, in _get_purchase_keys
    raise Exception("Unable to download user-data, cookies missing?")
Exception: Unable to download user-data, cookies missing?

this should be in the readme somewhere! Thanks for sharing the explanation :-)
It should be noted that windows batch (or plain windows cmd.exe) escape the " differently, here I had to
--session-auth """whatever I found in my browser"""
so literally three double quotes on each side. The outer ones keep the string together, and the inner pair then is actually an escaped double quote (basically, on windows "" does the same what \" does in most linux shells)


Invariant Violation: Element type is invalid: expected a string but got undefined.

I'm using the example on the github page with boilerplate react native expo snack code. The error only arises when I add the chartConfig prop (with the default chartConfig provided in the readme). I can't get the component to load on screen at all and consistently get this error.

Same problem here :+1:  (example from README.md)


Support later nsdoc revision

Is your feature request related to a problem? Please describe.
As a user of OpenSCD I want to use the latest nsd/nsdocs file.
At present it seems that we are looking for a match to the files in packages/openscd/public/xml which (at least one) is out of date.
Users are trying to use later versions and finding that they cannot be used. https://openscd.zulipchat.com/#narrow/channel/447335-general/topic/NSDocs/near/484782598
Describe the solution you'd like
OpenSCD needs a more flexible approach and the latest nsd files should be included.
Requirements
Ideally, support arbitrary version, revision and release in the OpenSCD code and then periodically we update the nsd files.

How backwards compabible is the NSD/NSdoc in general?


mejs-duration time display  incorrect in HLS live video

When I play HLS live video , the duration time dispaly  incorrect. The HLS video is live. The duration time does not increase over time. Sorry, my english is not well. I think you know what I mean.

If it's live you don't get a time duration. What is what you are experiencing?

Or can yo provide a URL so I can see this, please?

Sorry,  I used mediaelementjs in my local dev ENV. So I can not give you a URL to see it.
You are right that If it's live I don't get a time duration. Maybe I just need a timer to display how long the live has in processing. And in fact, I do it just like this.  I create a new timer in the success callback function and display the timer.
I think you can add a property, such as 'isLive' . If set the property true, the duration was not time duration, and it will become a increament timer, like 00:00:05, 00:00:06, 00:00:07 ......  ( live on 5 seconds，6 seconds,7 seconds ).
Whatever, I had done my task and thank you ~

You are welcome. Glad you figured this out


Trim quotes from template

Fixes #5835. Will add functional tests after #5837 is merged.

We shouldn't be enforcing the presense of quotes at this level, just removing them right?

Please add unit tests as well as updating the functional tests, my PR has been merged.

:up::date:

:up::date:

:up::date:

I filed #5868 for that comment @NTaylorMullen.


Can't install ghc-7.8.4 with packages (cabal-install, cabal2nix, ghc-mod) on osx

I am using nixpkgs-unstable on osx not using the pure stdenv. I am trying to install ghc 7.8.4 withPackages cabal-install, cabal2nix, and ghc-mod with this in my ~/.nixpkgs/config.nix
ghc784 = pkgs.haskell.packages.ghc784.ghcWithPackages (
  haskellPackages: with haskellPackages; [
    cabal-install
    cabal2nix
    ghc-mod
  ]
);

Here is the output I get where it errors:
building path(s) ‘/nix/store/hmf7h4a4n3pfazil4s7xhmljz7ifv8d3-haskell-network-<IP_ADDRESS>’
setupCompilerEnvironmentPhase
Build with /nix/store/lab259kib5a9hfimxy3284imyhiw5z50-ghc-7.8.4.
unpacking sources
unpacking source archive /nix/store/3yq58312mv9l1mbzjv4wl74dq35fknm1-network-<IP_ADDRESS>.tar.gz
source root is network-<IP_ADDRESS>
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/var/folders/8w/n_txhbn945j9gxp6bz2nhkhr0000gn/T/nix-build-haskell-network-<IP_ADDRESS>.drv-0/package.conf.d -j8
[1 of 1] Compiling Main             ( Setup.hs, /private/var/folders/8w/n_txhbn945j9gxp6bz2nhkhr0000gn/T/nix-build-haskell-network-<IP_ADDRESS>.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/hmf7h4a4n3pfazil4s7xhmljz7ifv8d3-haskell-network-<IP_ADDRESS> --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=clang --package-db=/private/var/folders/8w/n_txhbn945j9gxp6bz2nhkhr0000gn/T/nix-build-haskell-network-<IP_ADDRESS>.drv-0/package.conf.d --ghc-option=-optl=-Wl,-headerpad_max_install_names --disable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
Configuring network-<IP_ADDRESS>...
Dependency HUnit -any: using HUnit-<IP_ADDRESS>
Dependency base >=3 && <5: using base-<IP_ADDRESS>
Dependency bytestring <0.11: using bytestring-<IP_ADDRESS>
Dependency network -any: using network-<IP_ADDRESS>
Dependency test-framework -any: using test-framework-<IP_ADDRESS>
Dependency test-framework-hunit -any: using test-framework-hunit-<IP_ADDRESS>
Dependency unix >=2: using unix-<IP_ADDRESS>
Setup: The following installed packages are broken because other packages they
depend on are missing. These broken packages must be rebuilt before they can
be used.
package ansi-terminal-<IP_ADDRESS> is broken due to missing package
base-<IP_ADDRESS>-99f2b20e2491b27225d4c673401d826f,
unix-<IP_ADDRESS>-1e65c8c07a296a114e84d60c2f18351a
package mtl-<IP_ADDRESS> is broken due to missing package
base-<IP_ADDRESS>-99f2b20e2491b27225d4c673401d826f
package test-framework-<IP_ADDRESS> is broken due to missing package
random-1.1-822c19b7507b6ac1aaa4c66731e775ae
package xml-1.3.14 is broken due to missing package
text-<IP_ADDRESS>-8ef0a2f3c6eb30c72fb494410dc2efe1
builder for ‘/nix/store/k438imaq7r7gbqrcl4p1drwk5axami4h-haskell-network-<IP_ADDRESS>.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/xzwiqrdhpjdl0afp18i9b3bgffc5db98-cabal-install-<IP_ADDRESS>.drv’: 1 dependencies couldn't be built
cannot build derivation ‘/nix/store/q2aakk5v2398zz9frndpsr7j5n6p7s5p-ghc-7.8.4.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/q2aakk5v2398zz9frndpsr7j5n6p7s5p-ghc-7.8.4.drv’ failed

Also note I have a similar problem when trying with ghc 7.6.3. Thanks!

cc @peti @copumpkin @jwiegley @cstrahan @Fuuzetsu any ideas?

Do you have an existing ~/.ghc perhaps?  I'm using 7.8.4 with those packages.

@jwiegley thanks to @Fuuzetsu I got it working, but the only way I can get it to work on OS X is with --option binary-cache "". Works fine in my nixos running in virtualbox.

@codedmart I have the same pb..
building path(s) ‘/nix/store/f5z5ihvgmbqd9z5hjy6pwdsd2cc0mm4d-haskell-JuicyPixels-<IP_ADDRESS>’
setupCompilerEnvironmentPhase
Build with /nix/store/lab259kib5a9hfimxy3284imyhiw5z50-ghc-7.8.4.
unpacking sources
unpacking source archive /nix/store/8ibpzxg8583ilrxq9m8vfs91fb74l0g6-JuicyPixels-<IP_ADDRESS>.tar.gz
source root is JuicyPixels-<IP_ADDRESS>
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/var/folders/g7/rkzqym9j0w1dpq97clqgmxpw0000gn/T/nix-build-haskell-JuicyPixels-<IP_ADDRESS>.drv-0/package.conf.d -j4
[1 of 1] Compiling Main             ( Setup.hs, /private/var/folders/g7/rkzqym9j0w1dpq97clqgmxpw0000gn/T/nix-build-haskell-JuicyPixels-<IP_ADDRESS>.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/f5z5ihvgmbqd9z5hjy6pwdsd2cc0mm4d-haskell-JuicyPixels-<IP_ADDRESS> --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=clang --package-db=/private/var/folders/g7/rkzqym9j0w1dpq97clqgmxpw0000gn/T/nix-build-haskell-JuicyPixels-<IP_ADDRESS>.drv-0/package.conf.d --ghc-option=-optl=-Wl,-headerpad_max_install_names --disable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --enable-tests
Configuring JuicyPixels-<IP_ADDRESS>...
Flags chosen: mmap=False
Dependency base >=4.5 && <5: using base-<IP_ADDRESS>
Dependency binary >=0.5 && <0.8: using binary-<IP_ADDRESS>
Dependency bytestring >=0.9 && <0.11: using bytestring-<IP_ADDRESS>
Dependency containers >=0.4.2 && <0.6: using containers-<IP_ADDRESS>
Dependency deepseq >=1.1 && <1.5: using deepseq-<IP_ADDRESS>
Dependency mtl >=1.1 && <2.3: using mtl-<IP_ADDRESS>
Dependency primitive >=0.4 && <0.7: using primitive-0.6
Dependency transformers >=0.2: using transformers-<IP_ADDRESS>
Dependency vector >=0.9 && <0.11: using vector-<IP_ADDRESS>
Dependency zlib >=<IP_ADDRESS> && <0.7: using zlib-<IP_ADDRESS>
Setup: The following installed packages are broken because other packages they
depend on are missing. These broken packages must be rebuilt before they can
be used.
package mtl-<IP_ADDRESS> is broken due to missing package
base-<IP_ADDRESS>-99f2b20e2491b27225d4c673401d826f
builder for ‘/nix/store/2yx36f64an5hzl4pv6gj4bjfjz52jpmq-haskell-JuicyPixels-<IP_ADDRESS>.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/di5l6wzf2cpjadylgd942k9fjx0c193g-ghc-7.8.4.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/di5l6wzf2cpjadylgd942k9fjx0c193g-ghc-7.8.4.drv’ failed

which is odd as I have base installed
$ ghc-pkg list -v G base                                                                                not sandboxed
Timestamp 1970-01-01 00:00:01 UTC for /nix/store/p3kx0icpph7lh2zjz91sdwxqaknl1yx8-ghc-7.8.4/lib/ghc-7.8.4/package.conf.d/package.cache
Timestamp 1970-01-01 00:00:01 UTC for /nix/store/p3kx0icpph7lh2zjz91sdwxqaknl1yx8-ghc-7.8.4/lib/ghc-7.8.4/package.conf.d (same as cache)
    base-<IP_ADDRESS> (base-<IP_ADDRESS>-99f2b20e2491b27225d4c673401d826f)

Please see http://hydra.nixos.org/build/24297094/download/1/nixpkgs/manual.html#how-to-recover-from-ghcs-infamous-non-deterministic-library-id-bug for further details.

In case anyone else looks for this the link @peti provides no longer works. Look here


Use identityserver methods in api

Can someone help me,
I am using identityserver for authentication and autohrization
Now i want to delete a user from my web api, so how can i use identityserver methods in my web api (external)
Should i call to identityserver or what ....

Important update
This organization is not maintained anymore besides critical security bugfixes (if feasible). This organization will be archived when .NET Core 3.1 end of support is reached (3rd Dec 2022). All new development is happening in the new Duende Software organization.
The new Duende IdentityServer comes with a commercial license but is free for dev/testing/personal projects and companies or individuals making less than 1M USD gross annnual revenue. Please get in touch with us if you have any question.


Vite fails to resolve dependencies when switching to a different root

Describe the bug
Hi!
I'm building two SPAs with Vite, and I have hit a minor issue. I'm switching which SPA is "active" by changing the root config option. However I have files that are named the same in both of my SPA folders, and that seems to be confusing vite, as when I switch the active SPA I get an The following dependencies are imported but could not be resolved error.
Loving Vite so far though!
Reproduction
My project file structure is set up like the following. A foo folder for one SPA, and a bar folder for the other.
bar
    index.html
    main.js
foo
    index.html
    main.js
vite.config.js

For this reproduction, both index.html files are identical:
<!DOCTYPE html>
<html lang="en">
    <head></head>
    <body>
        <script type="module" src="main.js"></script>
    </body>
</html>

Both main.js files are empty.
My config is this:
import { defineConfig } from "vite"

const app = "bar";

export default defineConfig(() => {
    return {
        root: `./${app}`,
    };
})

After running npm install I run npm run dev and everything works fine. However changing the app variable from "bar" to "foo"  triggers the error (In reality I'm using an environment variable to trigger the switch, but I've simplified it for this reproduction). Re-running npm run dev produces the following error (paths edited):
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:

  main.js (imported by C:/.../bar/index.html)

Are they installed?
    at optimizeDeps (C:\...\node_modules\vite\dist\node\chunks\dep-36bf480c.js:71645:15)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async runOptimize (C:\...\node_modules\vite\dist\node\chunks\dep-36bf480c.js:75494:48)
    at async Server.httpServer.listen (C:\...\node_modules\vite\dist\node\chunks\dep-36bf480c.js:75510:21)

I can "reset" Vite and fix the problem by editing the src path in the HTML from "main.js" to "./main.js", but this is annoying to do each time. I am able to re-name my main.js files to have different names to sole the problem if this is unfixable, but having them the same name does add some nice consistency to my project.
System Info
System:
    OS: Windows 10 10.0.19043
    CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
    Memory: 17.37 GB / 31.92 GB
  Binaries:
    Node: 14.16.1 - C:\Program Files\nodejs\node.EXE
    npm: 7.18.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1023.0), Chromium (93.0.961.52)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    vite: ^2.5.4 => 2.5.10

Used Package Manager
npm
Logs
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
[X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
[X] The provided reproduction is a minimal reproducible example of the bug.

Looking at this more today, the issue goes away if I set the src paths in both index.html files to "./main.js". I can switch between the two without issue now. Not sure how I didn't catch this earlier.


Process h264d - use C++ primitives: memcpy => std::copy

Issue: MDP-50956

Please take a closer look at umc_media_data.h
Original:
virtual void* GetDataPointer(void)   { return m_pDataPointer; }
Now:
virtual uint8_t* GetDataPointer(void)   { return m_pDataPointer; }
This method was changed because std::copy function does not accept void* as 3 parameter.

It is already done in https://github.com/Intel-Media-SDK/MediaSDK/pull/724/

already done


Implement collection method for Database

Time spent on this PR: 10 min
Pull Request type

Please check the type of change your PR introduces:

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, renaming)
[ ] Refactoring (no functional changes, no API changes)
[ ] Build-related changes
[ ] Documentation content changes
[ ] Testing

What is the new behavior?

Implement collection method for Database.
Does this introduce a breaking change?

[ ] Yes
[X] No

I'm not sure what the goal of the new method is,you don't seem to use it anywhere

Just read your review, nvm


Fix | Improve sendAndRetry

I've also added a PHPStan Github action 😁

Regarding the PHPStan reports, it's because I've set the level to max in the default PHPStan config (phpstan.dist.neon).
I intended on fixing everything before release (and the GitHub action).
In the meantime I guess we can set the level to 6, and I can increase it in each PR I add for type hints.


VS Code crash ("The window is not responding") after running "Organize Usings"

This was filed at https://github.com/Dart-Code/Dart-Code/issues/4486, but I believe the crash is a VS Code issue.
I can reproduce the issue by doing the following:

Set up a Dart SDK and install the Dart extension
Open an empty folder and create a foo.dart file with the following contents (and no trailing newline):export 'interior_material_selector.dart';
export 'mileage_selector.dart';
export 'owners_selector.dart';
export 'price_selector.dart';
export 'seat_count_selector.dart';
export 'year_selector.dart';
export 'winter_options_selector.dart';export 'camera_selector.dart';

Run the "Organize Imports" command
VS Code immediately hangs and the cursor stops flashing, eventually reporting the crash and asking to reopen/close

I ran the Dart language server from source and stripped out a lot of the capabilities to reduce the traffic. When removing the Semantic Tokens capability, the issue stops occurring, so it may be related to semantic tokens but I'm not certain.
Here is the LSP log (the version running the reduced set of Dart server capabilities):
==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":11548,"clientInfo":{"name":"Visual Studio Code","version":"1.77.0"},"locale":"en-gb","rootPath":"/Users/danny/Desktop/dart_samples/dartcode_4486","rootUri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"configuration":true,"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]},"resolveSupport":{"properties":["location.range"]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"didChangeConfiguration":{"dynamicRegistration":true},"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true},"inlineValue":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"diagnostics":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true},"insertTextMode":2,"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode"]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true,"foldingRangeKind":{"valueSet":["comment","imports","region"]},"foldingRange":{"collapsedText":false}},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator","decorator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false,"serverCancelSupport":true,"augmentsSyntaxTokens":true},"linkedEditingRange":{"dynamicRegistration":true},"typeHierarchy":{"dynamicRegistration":true},"inlineValue":{"dynamicRegistration":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":false}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0","allowedTags":["ul","li","p","code","blockquote","ol","h1","h2","h3","h4","h5","h6","hr","em","pre","table","thead","tbody","tr","th","td","div","del","a","strong","br","img","span"]},"positionEncodings":["utf-16"]},"notebookDocument":{"synchronization":{"dynamicRegistration":true,"executionSummarySupport":true}},"experimental":{"supportsWindowShowMessageRequest":true,"snippetTextEdit":true,"dartCodeAction":{"commandParameterSupport":{"supportedKinds":["saveUri"]}}}},"initializationOptions":{"allowOpenUri":true,"appHost":"desktop","closingLabels":true,"flutterOutline":false,"onlyAnalyzeProjectsWithOpenFiles":false,"outline":true,"suggestFromUnimportedLibraries":true},"trace":"off","workspaceFolders":[{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486","name":"dartcode_4486"}]},"clientRequestTime":1680702758109}
<== {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["edit.sortMembers","edit.organizeImports","edit.fixAll","edit.sendWorkspaceEdit","refactor.perform","move_top_level_to_file"],"workDoneProgress":true},"workspace":{"workspaceFolders":{"changeNotifications":true,"supported":true}},"workspaceSymbolProvider":true},"serverInfo":{"name":"Dart SDK LSP Analysis Server","version":"3.0.0-edge.c57cbd0c193d1f2cfdfcbdd730c9cc9103cea857"}}}
==> {"jsonrpc":"2.0","method":"initialized","params":{},"clientRequestTime":1680702767138}
<== {"id":1,"jsonrpc":"2.0","method":"client/registerCapability","params":{"registrations":[{"id":"0","method":"textDocument/didOpen","registerOptions":{"documentSelector":[{"language":"dart","scheme":"file"},{"language":"yaml","pattern":"**/pubspec.yaml","scheme":"file"},{"language":"yaml","pattern":"**/analysis_options.yaml","scheme":"file"},{"language":"yaml","pattern":"**/lib/fix_data.yaml","scheme":"file"}]}},{"id":"1","method":"textDocument/didClose","registerOptions":{"documentSelector":[{"language":"dart","scheme":"file"},{"language":"yaml","pattern":"**/pubspec.yaml","scheme":"file"},{"language":"yaml","pattern":"**/analysis_options.yaml","scheme":"file"},{"language":"yaml","pattern":"**/lib/fix_data.yaml","scheme":"file"}]}},{"id":"2","method":"textDocument/didChange","registerOptions":{"documentSelector":[{"language":"dart","scheme":"file"},{"language":"yaml","pattern":"**/pubspec.yaml","scheme":"file"},{"language":"yaml","pattern":"**/analysis_options.yaml","scheme":"file"},{"language":"yaml","pattern":"**/lib/fix_data.yaml","scheme":"file"}],"syncKind":2}},{"id":"3","method":"textDocument/codeAction","registerOptions":{"codeActionKinds":["source","source.organizeImports","source.fixAll","source.sortMembers","quickfix","refactor"],"documentSelector":[{"language":"dart","scheme":"file"}]}},{"id":"4","method":"textDocument/semanticTokens","registerOptions":{"documentSelector":[{"language":"dart","scheme":"file"}],"full":{"delta":false},"legend":{"tokenModifiers":["documentation","constructor","declaration","importPrefix","instance","static","escape","annotation","control","label","interpolation","void"],"tokenTypes":["annotation","keyword","class","comment","method","variable","parameter","enum","enumMember","type","source","property","namespace","boolean","number","string","function","typeParameter"]},"range":true}}]}}
==> {"jsonrpc":"2.0","id":1,"result":null,"clientRequestTime":1680702767197}
==> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart","languageId":"dart","version":1,"text":"export 'interior_material_selector.dart';\nexport 'mileage_selector.dart';\nexport 'owners_selector.dart';\nexport 'price_selector.dart';\nexport 'seat_count_selector.dart';\nexport 'year_selector.dart';\nexport 'winter_options_selector.dart';export 'camera_selector.dart';"}},"clientRequestTime":1680702767197}
==> {"jsonrpc":"2.0","id":1,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart"},"range":{"start":{"line":6,"character":68},"end":{"line":6,"character":68}},"context":{"diagnostics":[],"triggerKind":2}},"clientRequestTime":1680702767198}
<== {"id":1,"jsonrpc":"2.0","result":[]}
==> {"jsonrpc":"2.0","id":2,"method":"textDocument/semanticTokens/range","params":{"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart"},"range":{"start":{"line":0,"character":0},"end":{"line":6,"character":68}}},"clientRequestTime":1680702767502}
==> {"jsonrpc":"2.0","id":3,"method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart"}},"clientRequestTime":1680702767828}
<== {"id":2,"jsonrpc":"2.0","result":{"data":[0,0,6,1,0,0,7,33,15,0,1,0,6,1,0,0,7,23,15,0,1,0,6,1,0,0,7,22,15,0,1,0,6,1,0,0,7,21,15,0,1,0,6,1,0,0,7,26,15,0,1,0,6,1,0,0,7,20,15,0,1,0,6,1,0,0,7,30,15,0,0,31,6,1,0,0,7,22,15,0]}}
<== {"id":3,"jsonrpc":"2.0","result":{"data":[0,0,6,1,0,0,7,33,15,0,1,0,6,1,0,0,7,23,15,0,1,0,6,1,0,0,7,22,15,0,1,0,6,1,0,0,7,21,15,0,1,0,6,1,0,0,7,26,15,0,1,0,6,1,0,0,7,20,15,0,1,0,6,1,0,0,7,30,15,0,0,31,6,1,0,0,7,22,15,0]}}
==> {"jsonrpc":"2.0","id":4,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart"},"range":{"start":{"line":6,"character":68},"end":{"line":6,"character":68}},"context":{"diagnostics":[],"only":["source.organizeImports"],"triggerKind":1}},"clientRequestTime":1680702777207}
<== {"id":4,"jsonrpc":"2.0","result":[{"command":{"arguments":[{"path":"/Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart"}],"command":"edit.organizeImports","title":"Organize Imports"},"kind":"source.organizeImports","title":"Organize Imports"}]}
==> {"jsonrpc":"2.0","id":5,"method":"workspace/executeCommand","params":{"command":"edit.organizeImports","arguments":[{"path":"/Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart"}]},"clientRequestTime":1680702777229}
<== {"id":2,"jsonrpc":"2.0","method":"workspace/applyEdit","params":{"edit":{"documentChanges":[{"edits":[{"newText":"export 'camera_selector.dart';\nexport 'interior_material_selector.dart';\nexport 'mileage_selector.dart';\nexport 'owners_selector.dart';\nexport 'price_selector.dart';\nexport 'seat_count_selector.dart';\nexport 'winter_options_selector.dart';\nexport 'year","range":{"end":{"character":52,"line":6},"start":{"character":0,"line":0}}}],"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart","version":1}}]},"label":"Organize Imports"}}
==> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///Users/danny/Desktop/dart_samples/dartcode_4486/bin/dartcode_4486.dart","version":2},"contentChanges":[{"range":{"start":{"line":6,"character":51},"end":{"line":6,"character":52}},"rangeLength":1,"text":""},{"range":{"start":{"line":6,"character":48},"end":{"line":6,"character":50}},"rangeLength":2,"text":""},{"range":{"start":{"line":6,"character":46},"end":{"line":6,"character":47}},"rangeLength":1,"text":"ye"},{"range":{"start":{"line":6,"character":38},"end":{"line":6,"character":38}},"rangeLength":0,"text":"\n"},{"range":{"start":{"line":5,"character":8},"end":{"line":6,"character":8}},"rangeLength":29,"text":""},{"range":{"start":{"line":0,"character":8},"end":{"line":0,"character":8}},"rangeLength":0,"text":"camera_selector.dart';\nexport '"}]},"clientRequestTime":1680702777265}
==> {"jsonrpc":"2.0","id":2,"result":{"applied":true},"clientRequestTime":1680702777271}
<== {"id":5,"jsonrpc":"2.0","result":null}

Here is the crash-dump folder: crash_dump.zip
Symbolicated: symbolicated.zip, though https://github.com/microsoft/vscode-electron-prebuilt (mentioned at https://github.com/Microsoft/vscode/wiki/Native-Crash-Issues) is a 404 so these may be incomplete.
I've not had any luck reproducing this without the Dart extension/server by writing extension code that just applies the same edits (possibly because it requires semantic tokens) nor have I spotted anything unusual in the LSP traffic, but I'll have another go through these and post back if I figure anything out. Hopefully the crash log will help though.
VS Code version:
Version: 1.77.0
Commit: 7f329fe6c66b0f86ae1574c2911b681ad5a45d63
Date: 2023-03-29T09:57:11.797Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: <IP_ADDRESS>-electron.0
OS: Darwin x64 22.2.0
Sandboxed: Yes

I was able to reproduce this in an isolated test extension by just hard-coding semantic tokens and the edits:
https://github.com/DanTup/vscode-repro-sort-imports-crash
The complete code looks like this (though you'll need to contribute the "danny" language or change it.. I didn't want to reuse an existing language incase it had its own semantic tokens):
export async function activate(context: vscode.ExtensionContext) {

	vscode.languages.registerDocumentSemanticTokensProvider(
		{ language: "danny" },
		{
			provideDocumentSemanticTokens(document, token) {
				// Copied from the repro.. we only get asked once, for the original file so this is fine (and if it's not, it shouldn't crash)
				return new vscode.SemanticTokens(new Uint32Array([0, 0, 6, 1, 0, 0, 7, 33, 15, 0, 1, 0, 6, 1, 0, 0, 7, 23, 15, 0, 1, 0, 6, 1, 0, 0, 7, 22, 15, 0, 1, 0, 6, 1, 0, 0, 7, 21, 15, 0, 1, 0, 6, 1, 0, 0, 7, 26, 15, 0, 1, 0, 6, 1, 0, 0, 7, 20, 15, 0, 1, 0, 6, 1, 0, 0, 7, 30, 15, 0, 0, 31, 6, 1, 0, 0, 7, 22, 15, 0]), undefined);
			},
		},
		{
			"tokenModifiers": ["documentation", "constructor", "declaration", "importPrefix", "instance", "static", "escape", "annotation", "control", "label", "interpolation", "void"],
			"tokenTypes": ["annotation", "keyword", "class", "comment", "method", "variable", "parameter", "enum", "enumMember", "type", "source", "property", "namespace", "boolean", "number", "string", "function", "typeParameter"]
		},
	);

	await new Promise((resolve) => setTimeout(resolve, 1000));

	const content1 = "export 'interior_material_selector.dart';\nexport 'mileage_selector.dart';\nexport 'owners_selector.dart';\nexport 'price_selector.dart';\nexport 'seat_count_selector.dart';\nexport 'year_selector.dart';\nexport 'winter_options_selector.dart';export 'camera_selector.dart';";
	const content2 = "export 'camera_selector.dart';\nexport 'interior_material_selector.dart';\nexport 'mileage_selector.dart';\nexport 'owners_selector.dart';\nexport 'price_selector.dart';\nexport 'seat_count_selector.dart';\nexport 'winter_options_selector.dart';\nexport 'year";

	const doc = await vscode.workspace.openTextDocument({ language: 'danny', content: content1 });
	const editor = await vscode.window.showTextDocument(doc);
	await new Promise((resolve) => setTimeout(resolve, 3000));

	const edit = new vscode.WorkspaceEdit();
	edit.replace(doc.uri, new vscode.Range(new vscode.Position(0, 0), new vscode.Position(6, 52)), content2);
	await vscode.workspace.applyEdit(edit);
}

Doesn't seem to reproduce in the monaco editor.
However, @alexdima, I can observe in VS Code that LineTokens is created with unsorted offsets:
constructor(tokens: Uint32Array, text: string, decoder: ILanguageIdCodec) {
for (let i = 2, len = tokens.length; i < len; i += 2) {
	if (tokens[i - 2] > tokens[i]) {
		console.log('Tokens are not sorted!');
	}
}
}

@DanTup Thank you for the clean repro! ❤

Fix LGTM, thanks!
/verified


update codeowners

Remove individual contributors from codeowners

duplicate of https://github.com/microsoft/Application-Insights-Workbooks/pull/1836


Echo

fixes
This PR fixes #204.
checklist

[x] Make sure you read and understood the CONTRIBUTING.md.
[x] Make sure you applied sufficient labels, milestone and assignee.
[x] Make sure all TODOs are addressed.
[x] Make sure there is sufficient documentation.
[x] Make sure there are sufficient tests.
[ ] Make sure all commits are squashed before merging.
[ ] Make sure to delete the feature branch after merging.

Current coverage is 96.43% (diff: 100%)

Merging #212 into master will not change coverage

Powered by Codecov. Last update 0bf0283...288089f

LGTM


The new coverage modeller and germline CNV caller (PR preview)

This is a preview of the upcoming PR and is meant to serve for initial assessment by the reviewers. The final PR will be issued separately in a day or two and this PR will be deleted.
Here are the following remaining tasks before the final PR:

Further code cleanup and documentation
More unit and integration tests (or specs for required tests along with TODO + issue #)
Thoroughly review TODOs, make issues for them and cite issue numbers in the code

Looking forward to it!  If it's not too much trouble, could you organize files into separate commits in the final PR to make things a bit easier on us?

Sure @samuelklee, I can break it down. BTW, the only way I know for this is to unstage the changes, then restage in chunks and commit. Is that how you do it too?

Yeah, that's pretty much how I do it.  It's relatively painless using tig status.  There might be better ways to do it, though?

closing this, issuing the real pull request now.


Why doesn't the plugin work?

I installed this plugin, but didn't find it to do anything. Is it what it does to format the code or what?
Under what circumstances can the function of this plugin be triggered?

This plugin does not format anything, it runs the pug-lint, which checks your templates based on the rules you define in the config and reports them in the browser.
In order for the plugin to be triggered, you need to attach the function exported by the plugin to your vite.config.ts:
import { fileURLToPath, URL } from 'url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pugLint from 'vite-plugin-vue-pug-lint';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [pugLint(), vue()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  }
})

By default it takes the config from the .pug-lintrc file in the project root. I created an example repository with basic setup.
For instance, in the repository above, there is a rule disallowClassAttributeWithStaticValue, which prevents from adding static css classes via attributes (span(class='example')) and prefers css literal syntax instead (span.example).
With this rule set, the following template:
<template lang="pug">
.greetings
  h1.green {{ msg }}
  h3
    | You’ve successfully created a project with
    a(target='_blank', href='https://vitejs.dev/') Vite
    | +
    a(target='_blank', href='https://vuejs.org/') Vue 3
    |.
</template>

compiles without errors, but the following one (notice the difference in the first line):
<template lang="pug">
div(class='greetings')
  h1.green {{ msg }}
  h3
    | You’ve successfully created a project with
    a(target='_blank', href='https://vitejs.dev/') Vite
    | +
    a(target='_blank', href='https://vuejs.org/') Vue 3
    |.
</template>

results in the compilation error shown in the browser:

Hopefully this answers your question.


Add UIKit DiffableListsOfState example

Motivation
A new DiffableListsOfState UIKit example was created to demonstrate the usage of TCA with a list of (collection view) cells that have a store and are backed by a diffable data source.
It uses a Store.child helper to return a single scoped store for a particular child (cell), from its identifier. This is useful to
avoid re-scoping all children when only a subset of children needs to be created (e.g. in a diffing set up, only insertion stores need to be created).
Changes

Create new DiffableListsOfState UIKit example

Create new DiffableCounterList TCA "stack" andDiffableCountersTableViewController which uses Diffing in a UICollectionView via UICollectionViewDiffableDataSource.
Create new CounterCollectionViewCell which wraps a counter, to demonstrate injecting child stores in cells.
Enrich CounterState with a id: UUID property for diffing.

DiffableListsOfState Demo
https://user-images.githubusercontent.com/1391324/116435915-c701ef00-a843-11eb-9a67-b9f3007745fb.mov

@stephencelis @mbrandonw did this work by any chance inspire you for episode 148? It certainly has some similar ideas! 😅
If so, does that mean you'll be taking a look at this soon? 😇🙏🏼

@stephencelis @mbrandonw  hi there! 👋🏼
Made the Store.child a private helper on the example itself, to avoid increasing public API surface (which I think would be the deal breaker in this PR 😇)
That means this PR is now only a UIKit example on how to use TCA with a diffable data source backed VC. Please let me know if you think it adds value and if it's in line with what you want for the case studies.

Hi @stephencelis @mbrandonw 👋🏼
Sorry for pushing, but this PR has sadly been sitting here waiting for your review for over a year now. Do you think these changes are worth it, or should I just close this? Thanks!

Hey @p4checo! Sorry again for the looong delay. It becomes very easy to lose track of open PRs after some time. I think what we've come to understand is that we should be very comfortable with all the case studies in the repo to be able to maintain them well, so we're trying to be quite careful in adding surface area here. That said, whenever you solve a problem like this we think the GitHub discussions are the perfect place to share and for folks to discover more and more ways of solving problems with TCA. I know it's been some time, but if you do want to share your diffable demo there, it'd be the perfect place!


Using ubuntu rootfs instead of linaro.

Thank you for your instruction. It works well.
And can I use ubuntu root file system instead of linaro?
Although I tried to use following rootfs, it doesn't work well.
http://cdimage.ubuntu.com/ubuntu-base/releases/16.04/release/ubuntu-base-16.04.6-base-arm64.tar.gz
log.txt

Hayato
I would guess it is possible to use the Ubuntu filesystem instead of the Linaro one but I have not done it in a long while.  I think I used to use the Ubuntu filesystem before I started using Petalinux.
Does the Linaro filesystem work for you?  I think it is Debian which is very close to Ubuntu.
Pete


Create New Auction can be made a button instead of clickable h2

Currently it's a simple h2 tag and there's un-clickable normal text below it
We need to seperate out both of them, so the Create New Auction can be made into a typical button

I'd like to take this up

I'd like to take this up

Assigned to you!


Line breaks and carriage returns not working properly

It seems that this tool doesn't handle line breaks and carriage returns properly.
Example when writing:

Modify the "write_metadata" example from this project
Change the metadata like this:

const metadata = {
    all: '', // remove all metadata at first
    'Caption-Abstract': 'test-line1\ntest-line2',
}

Run code

The output then contains:
{
  "data": null,
  "error": "Error: File not found - test-line2\r\n    1 image files updated\r\n    1 files weren't updated due to errors"
}

As you can see, the line break character causes it to believe that "test-line2" is a file argument.
I noticed this when trying to update the metadata of an image with existing line breaks (\n) and carriage returns (\r). It was part of a field that I didn't intend to modify (so I left it unchanged), but when writing the metadata I got this error:
undefined:1
======== some text [1/6]
^

SyntaxError: Unexpected token = in JSON at position 0
    at JSON.parse (<anonymous>)
    at C:\redacted\node_modules\node-exiftool\src\lib.js:146:37
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

When looking at this (line 146 and the surrounding lines), I see this code:
return {
    data: res[0] ? JSON.parse(res[0]) : null,
    error: res[1] || null,
}

This means that it is expecting json formated output from exiftool in res[0].
Adding some code that prints this data just before the return, I got this:
This is the content of res[0]:
-----------------------------------------------------------------------
======== some text [1/6]
======== some more text [2/6]
======== some more text  [3/6]
======== some more text  [4/6]
======== some more text  [5/6]
======== C:/redacted/some_image.jpg [6/6]
-----------------------------------------------------------------------

The lines with "-----------------------------------------------------------------------" is not part of the output. Here you can see that for some reason exiftool doesn't output json here. Instead it outputs text strings that each was prefixed with a line break or carriage return, except for the last line that is the path to the image processed. And each output is for some reason prefixed with "======== "
When outputting the content of res[1] I get a bunch of exiftool warnings about things that isn't writable (like "Warning: Sorry, ExifToolVersion is not writable"), but at the end there is an error "Error: File not found - ..." for each "some text" line above.
So, clearly, these line breaks and carriage returns is messing up the communication between node-exiftool and exiftool. Sadly I haven't been able to construct a sample jpg that causes this, and because of copyright reasons I can't share the actual image used.
Actually, maybe this is two bugs in one. One bug being the line breaks and/or carriage returns causing incorrect input data to exiftool, and one bug being that node-exiftool always asumes that the output from exiftool is json without checking.

@jihu I have the same problem here. It comes from the fact that node-exiftool makes exiftool read an argfile from stdin (i.e. calls exiftool with arguments -@ -). In that "mode", each line is interpreted as a single argument and so, in your example, test-line2 is considered as a new argument passed to the tool.
The solution is actually here, see point (e):

Use the "#[CSTR]" feature to allow C-style escape sequences for a specific line in a -@ argfile

I patched this function so that it enables C-style escape sequences when data written to stdin contain carriage returns and/or new lines. It then looks like this:
function writeStdIn(proc, data, encoding) {
    if(/[\n\r]/.test(data)) {
        proc.stdin.write("#[CSTR]", encoding)
        proc.stdin.write(data.replaceAll(/(\r\n|\n\r|\n|\r)/g, "\\n"), encoding)
    } else {
        proc.stdin.write(data, encoding)
    }
    proc.stdin.write(EOL, encoding)
}

This solution may not be platform independent but it works on Linux at least.

For the record, we created a fork and published a package which contains the fix (as well as type definitions for those interested). If anyone has write access to this repository and is willing to keep up maintaining it, I would be happy to create a PR.

Please take a look at my repo. I hope it'll solve your problem
Link: https://github.com/anasshakil/metadata


Add Areko Consulting Ltd. to the documentation and license

To make clear that I created during my working time.

I updated the licenses comments and moved most of the documentation out of the readme file.


cp: cannot create regular file

When I run
sudo cp builddir/org.freedesktop.ratbag1.service /etc/dbus-1/system-services/org.freedesktop.ratbag1.conf
i recieve the error
cp: cannot create regular file '/etc/dbus-1/system-services/org.freedesktop.ratbag1.conf': No such file or directory

cp: cannot create regular file '/etc/dbus-1/system-services/org.freedesktop.ratbag1.conf': No such file or directory

You might be missing /etc/dbus-1/system-services/. IIRC, this is not created by default on most distributions.


Correction for raw affiliation PHIM Plant Health Institute, Univ Montpellier, CIRAD, INRAE, Institut Agro, IRD , Montpellier, France; UMR PHIM, CIRAD , Montpellier, France

Correction needed for raw affiliation PHIM Plant Health Institute, Univ Montpellier, CIRAD, INRAE, Institut Agro, IRD , Montpellier, France; UMR PHIM, CIRAD , Montpellier, France
raw_affiliation_name: PHIM Plant Health Institute, Univ Montpellier, CIRAD, INRAE, Institut Agro, IRD , Montpellier, France; UMR PHIM, CIRAD , Montpellier, France
new_rors: 05kpkpg04;051escj72;03fkrcm40;05q3vnk25;03rnk6m14;003vg9w96;05y5s3h28
previous_rors: 05kpkpg04;051escj72;03fkrcm40;05q3vnk25;03rnk6m14;003vg9w96
works_examples: W3182084436;W4297097659
contact: 3aebc1bac5398e4c9334f13ccd3635c8:81e005f23b7375b87e2539dddcacbeb019f8 @ inrae.fr

This issue was accepted and ingested by the OpenAlex team on 2024-10-09. The new affiliations should be visible within the next 7 days.


Update ClinVar data preparation scripts for Hail's VEP changes

The preparation scripts for ClinVar data run VEP. Hail has changed where it stores VEP data, so documentation needs to be updated to require Hail >= 0.2.34 and set requester pays arguments when starting the cluster.

hailctl dataproc start takes care of setting the requester pays arguments required for VEP data.


InconsistentMigrationHistory when running many test suites against database

I am working on an integration and attempting to run each test suite and an integration test suite with tox.
Note that each test suite passes just fine when run against a fresh database.  However, I am getting django.db.migrations.exceptions.InconsistentMigrationHistory when running them back to back via a loop using subprocess.Popen against the same infrastructure.
I was following a traceback and noticed the migrations do not specify the test database here: https://github.com/tomturner/django-tenants/blob/master/django_tenants/test/cases.py#L76
Should they be?  This error message indicates the test is running migrations on the 'default' database instead of the test database: django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.
Is this intended?  Do I need to drop the database between test suites?  Each test suite runs as its own django project (like DJANGO_SETTINGS_MODULE=foo.settings; python manage.py test) against the same docker containers for infrastructure (db, cache, etc)
Traceback:
 Traceback (most recent call last):
   File "/var/lib/project/bin/runtests_integration", line 38, in <module>
     runtests()
   File "/var/lib/project/bin/runtests_integration", line 34, in runtests
     execute_from_command_line(argv)
   File "/var/lib/project/django/core/management/__init__.py", line 401, in execute_from_command_line
     utility.execute()
   File "/var/lib/project/django/core/management/__init__.py", line 395, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/var/lib/project/django/core/management/commands/test.py", line 23, in run_from_argv
     super().run_from_argv(argv)
   File "/var/lib/project/django/core/management/base.py", line 328, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/var/lib/project/django/core/management/base.py", line 369, in execute
     output = self.handle(*args, **options)
   File "/var/lib/project/django/core/management/commands/test.py", line 53, in handle
     failures = test_runner.run_tests(test_labels)
   File "/var/lib/project/django/test/runner.py", line 684, in run_tests
     old_config = self.setup_databases(aliases=databases)
   File "/var/lib/project/django/test/runner.py", line 606, in setup_databases
     self.parallel, **kwargs
   File "/var/lib/project/django/test/utils.py", line 173, in setup_databases
     serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
   File "/var/lib/project/django/db/backends/base/creation.py", line 72, in create_test_db
     run_syncdb=True,
   File "/var/lib/project/django/core/management/__init__.py", line 168, in call_command
     return command.execute(*args, **defaults)
   File "/var/lib/project/django/core/management/base.py", line 369, in execute
     output = self.handle(*args, **options)
   File "/var/lib/project/django_tenants/management/commands/migrate_schemas.py", line 49, in handle
     executor.run_migrations(tenants=[self.PUBLIC_SCHEMA_NAME])
   File "/var/lib/project/django_tenants/migration_executors/standard.py", line 11, in run_migrations
     run_migrations(self.args, self.options, self.codename, self.PUBLIC_SCHEMA_NAME)
   File "/var/lib/project/django_tenants/migration_executors/base.py", line 36, in run_migrations
     MigrateCommand(stdout=stdout, stderr=stderr).execute(*args, **options)
   File "/var/lib/project/django/core/management/base.py", line 369, in execute
     output = self.handle(*args, **options)
   File "/var/lib/project/django/core/management/base.py", line 83, in wrapped
     res = handle_func(*args, **kwargs)
   File "/var/lib/project/django/core/management/commands/migrate.py", line 89, in handle
     executor.loader.check_consistent_history(connection)
   File "/var/lib/project/django/db/migrations/loader.py", line 299, in check_consistent_history
     connection.alias,
 django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.

I am going to close this. I didn't notice the issue is against the pooler not the database


Multi-Install exe files

How do I go about installing this? It looks like 11.3 server and portal both now have 2 install files.

Just need to make sure that you have one file named .exe (the smaller one) and one file named .exe.001 (the larger one)... For some reason ours were named .exe and _2.exe.
https://enterprise.arcgis.com/en/portal/latest/administer/windows/common-problems-and-solutions.htm#anchor1


Seashelf of Aquatic Filtration not blacklisting modded enchants.

I am having a issue with the Seashelf of Aquatic Filtration and that is that it's not actually working in blocking the enchants Rebounding and Repellant, I am playing in the latest All the mod 9 pack and I'm enchanting their vibranium armor. I have all sorts of different levels of the enchants in the shelf yet it's not actually blacklisting any of them! It's very annoying, I don't know if they're enchants from Apotheosis or some other mod....

Do the enchantments show as crossed out in the enchanting info window (the ? tab)

No they do not, but I did learn that it seemingly worked when I moved the shelf down a block. Which is weird cause technically it WAS in a valid shelf space.

If it worked after moving it it means it wasn't being picked up for some reason.  Sometimes certain blocks can prevent the block from being detected, but I don't think there's a bug here.


It's in mid March want to see the code

me too

Trying my best to finish it this week

Almost finished needing a few more days

Code is live 😄 sorry for the delay!


Remove Zookeeper dependency from tranquility

Currently Tranquility requires address of zookeeper hosts where Druid cluster publishes (called "external discovery") overlord host and task hosts that consume the events.
There is an effort in progress to make zookeeper optional on Druid side which will result in removal of zookeeper based "external discovery" feature and for that Tranquility needs to become ready.

Tranquility already has the ability to discover tasks using HTTP endpoints. It should switch to this mechanism and remove zookeeper based discovery completely.

Starting Druid-0.11.0, Druid coordinator exposes an HTTP endpoint /druid/coordinator/v1/cluster/overlord which should be used for discovering Overlord. So tranquility would take a list of coordinators, that is, comma separated scheme://host:port and discover Overlord hosts from there. It might have to follow redirects and or use getLeader endpoints at overlord to reach the leader. Similar work is done in Druid ( https://github.com/druid-io/druid/pull/4735 ) for this use case.

@himanshug, are you willing to help out with this? I can give some pointers to where to look in the code.

Tranquility already has the ability to discover tasks using HTTP endpoints. It should switch to this mechanism and remove zookeeper based discovery completely.

Let's keep the ZK based discovery option, just so we can support older Druid versions pre-<IP_ADDRESS> (the first version supporting HTTP based task discovery). But I think we should switch the default to HTTP since <IP_ADDRESS> has been out long enough.

Starting Druid-0.11.0, Druid coordinator exposes an HTTP endpoint /druid/coordinator/v1/cluster/overlord which should be used for discovering Overlord. So tranquility would take a list of coordinators, that is, comma separated scheme://host:port and discover Overlord hosts from there. It might have to follow redirects and or use getLeader endpoints at overlord to reach the leader. Similar work is done in Druid ( druid-io/druid#4735 ) for this use case.

That sounds good. The place to look at in Tranquility for adding that would be to create a new Resolver impl that can find the overlord (see DiscoResolver and DruidTaskResolver for examples of resolvers) and then to create an OverlordLocator impl that uses this resolver.

@gianm thanks for the pointers.
I can take a stab at it once Druid changes are done which still has long way to go. In the meantime, if someone gets some cycles to take care of this, that would be awesome.


Patterns with future years should not limit the day and month range

This fixes #97. This bug is triggered if the pattern has a year in the future but the day/month older than the date in after, resulting in no upcoming dates being matched. A test case has been added to cover this scenario as well.

Is this project still maintained or is it looking for supporters/maintainers? If the latter, I can provide some support if @zslayton  is okay with that.


iOS: Added "path" field for iOS.

iOS

Added "path" field for iOS.

The uri is: content://path/to/the.file
And the path is just: /path/to/the.file
When you try to upload files using FormData you only need the path without any "content|file://" prefix.
But that does not matter, thank you for your time.


BREAKING: Remove Task.

It is moved to fsa-emitter.

Coverage increased (+0.4%) to 94.052% when pulling 328a71f03fa7804c6a7aecdf50b507a037f7fbf4 on remove-task into 2450387c260e1b89c6f2e6d5818103b47aeb4c38 on master.


UI  Fixes :octocat:

Hello There....
Thanks for Contributing to Our Project....
It Would be Great if You Could Tell us The Features of your PR.

[ ] Is It regarding the Views?
[ ] Is it Regarding Any Improvments?

If It's Regarding any Other Things not Mentioned here...Do Tell Us.

Fixes about #6 #5

Sample Images