Signing Windows installer doesn't sign every binary

[x] I have read the contribution documentation for this project.
[x] I agree to follow the code of conduct that this project follows, as appropriate.
[x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:
It appears that electron-packager and electron-wininstaller do not support signing all of the Windows binaries such as ffmpeg.dll, libEGL.dll, and node.dll; AND the resources/*.asar. This means that someone could replace the files in resources/*.asar or the unsigned dll's with malicious code.
Who is looking into this issue?

Thanks for filing an issue, but this is not an Electron Packager issue. Packager does not currently handle signing on Windows (or proxy it to another module). The other issue you filed in the electron-winstaller project is a better place for this.

Asar file cannot be signed using windows tool. File format doesn't support it simply. Electron should support it, because it is not possible to implement check on application side (since asar files can be changed).
Good news is that on macOS it is possible to fix without Electron team — https://stackoverflow.com/questions/35013006/where-does-codesign-store-the-signature-for-a-signed-text-file-on-osx I will file PR to electron-osx-sign soon.

Yes, sadly Windows went fully for the "sign only the executables" where the definition of "executables" has become increasingly out of date. It sounds like the electron/asar library would need to be extended, or a detached signature for the resource/*.asar files be embedded in the electron-builder output.
And as in my situation, the signing would need to be able to be performed by a third party tool.
I'm some what surprised that this issue hasn't already been raised by any of the other electron application users. I've filed https://github.com/electron/asar/issues/123

@develar @malept @drjasonharrison I've done quite a bit of research into code signing ASAR files to protect against source code injection in Electron applications and I've got a few things to say here.

Unless the OS is doing the verification there is always a way around internal signiture verification, it might be a lot harder but it will always be possible to bypass an application that self-validates for the obvious reason that you could modify the bit of the program that does the self-validation.  Just look at game DRM where companies spend years trying to make their game uncrackable, it always gets cracked eventually 😆

macOS doesn't verify static assets at runtime, you can codesign any files you want in the app but only what apple considers "runtime code" will be validated, this means the Electron binary and the Electron Helper binaries will be validated but static assets like .asar files and other such files will not be validated

Windows doesn't do any signature validation on anything that isn't an .exe or .dll and even then it will sometimes still launch invalid or unsigned files 👏

This is the big one for me, in order to actually exploit this (changing an ASAR file) the malicious program / attacker needs physical access / to be already running in a privileged state on your users machine at which point they can do whatever they want anyway, including replacing your application completely with a fake one with a valid signature that looks the same 😆 Once the user has lost control of their own machine there is little we can do as developers to protect them.

All this said I would love if someone could prove me wrong and come up with a foolproof way to sign and validate static resources cross-platform (or even just one platform would be impressive) but I'm pretty sure it's not possible and I don't believe the teams stance on source code protection has changed.

@MarshallOfSound thanks for summary. (To be clear, here we are talking only about code validation, not source code protection or app licensing).

But app is cracked using cracked license servers / license generation. Not using simple hex editing of exe file. Or I am wrong? Anyway — codesign on Windows doesn't work. Because not enabled by default (blocking unsigned code), easy way to bypass UAC (e.g. NSA exploit).

Yes — https://stackoverflow.com/a/4716079/1910191 I doubt that Electron or node check DLL signature.

how app can be replaced? You need to have private key to sign. Sha2 not yet broken to produce the same hash. Access — due to easy auto update, nsis/Squirrel both install app by default to user directory.

@develar Yeah, validating code has the same limitations as mentioned before though 😞

Cracking license servers is only useful for getting the game for free, also talking about modding the content of the game which is more on-parr with this topic.  The best metaphor I saw for describing this went something like this

Imagine you have a box and you want to keep it's content safe, but you have to store the key to the box with the box itself or at least within easy reach of the box.  You can see how you could hide the key, put decoy keys all over the place.  But eventually someone would find the correct key and the whole charade would be pointless

Yeah, but that's still self-validation 😄 Change the core code for the application and there goes the validation because windows doesn't enforce validation of signatures at an OS level it's basically a catch-22.

Well I mean on macOS replacing the app is as easy as executing a bit of bash

rm -rf /Application/MyApp.app
mv /path/to/fake/app.app /Applcations/MyApp.app

It's a technique I've seen used before, if the app has a similar UI (possibly even a slightly modified version of the original app) and the same icon / name the user won't notice a thing and as long as the new app is signed with a valid cert, macOS won't complain either 😢

Another option is to put all static assets in a native library file. .asar becomes .dll or .so/.a

@MarshallOfSound this isn't a source code protection issue. It's a cover-my-ass issue.
Release checklist:

[ ] installer is signed with corporate derived certificate
[ ] post-installation, all executable components are signed with corporate derived certificate
[ ] etc

@drjasonharrison Let's discuss in the https://github.com/electron/asar/issues/123


I can't accept android-licenses

Steps to Reproduce
When I run flutter build apk and flutter run I get
Error running Gradle:
Unable to download needed Android SDK components, as the following licenses have not been accepted:
Android SDK Build-Tools 26.0.2, Android SDK Platform 27
To resolve this, please run the following command in a Terminal:
flutter doctor --android-licenses

But flutter doctor --android-licenses says
 Warning: File /home/user/.android/repositories.cfg could not be loaded.
 All SDK package licenses accepted.======] 100% Computing updates...

So it looks like all license agreements were accepted. PS. I can build Android Apps in Android Studio.
Flutter Doctor
Flutter (on Linux, locale en_US.UTF-8, channel beta)
    • Flutter version 0.1.4 at /home/user/Downloads/flutter
    • Framework revision f914e701c5 (8 days ago), 2018-02-19 21:12:17 +0000
    • Engine revision 13cf22c284
    • Dart version 2.0.0-dev.27.0-flutter-0d5cf900b0
   ✗ Downloaded executables cannot execute on host (see https://github.com/flutter/flutter/issues/6207 for more information)

For more information about diagnosing and reporting Flutter bugs, please see https://flutter.io/bug-reports/.

Same here, same errors. Any ideas ?
Thanks !

I found a solution... maybe it will work for you as it did for me (For me the issue was the flutter create command used the old android sdk folder).
Please @allowthere , check your "local.properties" file in the android folder.
Be sure the "sdk.dir= " value points to the same folder as the ANDROID_HOME variable.
Hope it helps !

@allowthere would you mind including the entire output of flutter doctor --verbose, in particular the bit covering Android Studio?
Also, based on the Downloaded executables cannot execute on host. message, it looks like you may not have a 32-bit version of libstc++ installed. I actually just landed a patch (#15004) that improves the error message a bit. The new instructions read:
Downloaded executables cannot execute on host.
See https://github.com/flutter/flutter/issues/6207 for more information.

On Debian/Ubuntu/Mint: sudo apt-get install lib32stdc++6
On Fedora: dnf install libstdc++.i686
On Arch: pacman -S lib32-libstdc++5

It looks like there may be a mismatch between the Android Studio location that Flutter is detecting and the one in your local.properties file under your project's android directory. What @mkhennoussi suggested should work to fix the license issue (related issue: #13750). You'll also need to install the appropriate 32-bit libstdc++ library for the 32-bit AOT compiler to produce binaries for Android. The instructions above should help -- if not, please shout :)

@mkhennoussi I had the same problem. The solution works great for me. The Android SDK isn't on default path in OSX.

@mkhennoussi  Nice ,It works!

I ran into this issue today and the recommendation didn't work.
Run SDK_LOCATION\tools\bin\sdkmanager --licenses instead of the recommendation to update.  It'll let you accept the missing licenses

I too had the same problem I rectified it by manually installing sdk version 26.0.2 from sdk manager in Android Studio. hope it helps!

I have this problem as well. I've run flutter doctor --android-licenses more than a dozen times. Each time it tells me at the end All SDK package licenses accepted and then the next time I run it, it starts with 5 of 5 SDK package licenses not accepted. 100% Computing updates....
I am also unable to install the Flutter plugin in Android Studio. It's nowhere to be found. One time, I actually did see it, and then the next moment it was no longer in the list of plugins.
flutter doctor --verbose gives this:
[✓] Flutter (Channel beta, v0.4.4, on Linux, locale en_NG)
    • Flutter version 0.4.4 at /home/user/Programs/flutter
    • Framework revision f9bb4289e9 (5 weeks ago), 2018-05-11 21:44:54 -0700
    • Engine revision 06afdfe54e
    • Dart version 2.0.0-dev.54.0.flutter-46ab040e58

[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
    • Android SDK at /home/user/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.0
    • ANDROID_HOME = /home/user/Android/Sdk
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_76-release-b03)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Android Studio (version 2.2)
    • Android Studio at /opt/android-studio
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    • Dart plugin version 145.971.7
    • Java version OpenJDK Runtime Environment (build 1.8.0_76-release-b03)

[✓] VS Code (version 1.22.2)
    • VS Code at /usr/share/code
    • Dart Code extension version 2.12.1

[!] Connected devices
    ! No devices available

! Doctor found issues in 2 categories.

@Wryhder Try running sudo flutter doctor --android-licenses

@egm24 I installed Flutter in my home directory; running that gives me
sudo: flutter: command not found

I have successfully installed the Flutter plugin in Android Studio. Probably because I upgraded to version three point something from 2.2.
It took a few tries, but I also can now run a project. Still can't accept the licenses, though.
Output of flutter doctor --verbose:
[✓] Flutter (Channel beta, v0.5.1, on Linux, locale en_NG)
    • Flutter version 0.5.1 at /home/user/Programs/flutter
    • Framework revision c7ea3ca377 (4 weeks ago), 2018-05-29 21:07:33 +0200
    • Engine revision 1ed25ca7b7
    • Dart version 2.0.0-dev.58.0.flutter-f981f09760

[!] Android toolchain - develop for Android devices (Android SDK 28.0.0)
    • Android SDK at /home/user/Android/Sdk
    • Android NDK at /home/user/Android/Sdk/ndk-bundle
    • Platform android-28, build-tools 28.0.0
    • ANDROID_HOME = /home/user/Android/Sdk
    • Java binary at: /home/user/Programs/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    ✗ Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[✓] Android Studio (version 3.1)
    • Android Studio at /home/user/Programs/android-studio
    • Flutter plugin version 25.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.22.2)
    • VS Code at /usr/share/code
    • Flutter extension version 2.12.2

[!] Connected devices
    ! No devices available

! Doctor found issues in 2 categories.

@Wryhder that looks like you didn't add the flutter/bin directory to PATH

@zoechi It's in my PATH.
Here's the result of echo $PATH:
/home/user/.local/share/umake/bin:/home/user/.rvm/gems/ruby-2.4.2/bin:/home/user/.rvm/gems/ruby-2.4.2@global/bin:/home/user/.rvm/rubies/ruby-2.4.2/bin:/home/user/.cargo/bin:/home/user/bin:/home/user/.local/bin:/home/user/.nvm/versions/node/v8.9.4/bin:/home/user/Programs/flutter/bin:/home/user/.pyenv/plugins/pyenv-virtualenv/shims:/home/user/.pyenv/shims:~/.pyenv/bin:/home/user/.local/share/umake/bin:/home/user/.cargo/bin:/home/user/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/user/.rvm/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/user/Android/Sdk/tools:/home/user/Android/Sdk/platform-tools:/home/user/Programs/flutter/bin/cache/dart-sdk/bin:/home/user/.rvm/bin:/home/user/.rvm/bin

@Wryhder please check if /home/user/Programs/flutter/bin contains a flutter executable for example by executing /home/user/Programs/flutter/bin/flutter and post the output.

@zoechi Apologies for the late reply. I'm assuming I wouldn't be able to use Flutter at all if there weren't an executable in there?
Here's the output:
~$ ~/Programs/flutter/bin/flutter
Manage your Flutter app development.

Common commands:

  flutter create <output directory>
    Create a new Flutter project in the specified directory.

  flutter run [options]
    Run your Flutter application on an attached device or in an emulator.

Usage: flutter <command> [arguments]

Global options:
-h, --help            Print this usage information.
-v, --verbose         Noisy logging, including all shell commands executed.
-d, --device-id       Target device id or name (prefixes allowed).
    --version         Reports the version of this tool.
    --bug-report      Captures a bug report file to submit to the Flutter team (contains local paths, device
                      identifiers, and log snippets).

    --flutter-root    The root directory of the Flutter repository (uses $FLUTTER_ROOT if set).

Available commands:
  analyze          Analyze the project's Dart code.
  build            Flutter build commands.
  channel          List or switch flutter channels.
  clean            Delete the build/ directory.
  config           Configure Flutter settings.
  create           Create a new Flutter project.
  devices          List all connected devices.
  doctor           Show information about the installed tooling.
  drive            Runs Flutter Driver tests for the current project.
  emulators        List and launch available emulators.
  format           Format one or more dart files.
  fuchsia_reload   Hot reload on Fuchsia.
  help             Display help information for flutter.
  install          Install a Flutter app on an attached device.
  logs             Show log output for running Flutter apps.
  packages         Commands for managing Flutter packages.
  precache         Populates the Flutter tool's cache of binary artifacts.
  run              Run your Flutter app on an attached device.
  screenshot       Take a screenshot from a connected device.
  stop             Stop your Flutter app on an attached device.
  test             Run Flutter unit tests for the current project.
  trace            Start and stop tracing for a running Flutter app.
  upgrade          Upgrade your copy of Flutter.

Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used options.

@Wryhder sorry, seems I misinterpreted the error message.

sudo: flutter: command not found

Perhaps it means the sudo command was not found or sudo: flutter was not found.
Actually I find it hard to tell :D

@zoechi I get that kind of error message when I append sudo to a command that doesn't require it. I installed Flutter in my home directory, so I don't need sudo to run it.
If, however, I'd installed it in /opt/ or /usr/local/share/, I might need sudo.
I just tried to run sudo npm -g ls, and I got a similar error message. However, plain npm -g ls works.

@Wryhder https://unix.stackexchange.com/questions/245772/why-running-command-as-sudo-returns-command-not-found
You can also check https://stackoverflow.com/questions/39760172/you-have-not-accepted-the-license-agreements-of-the-following-sdk-components but this might have changed since the answers were posted, but I think it's worth a try.

@Wryhder this looks to me as though flutter isn't on the PATH when sudo'ed to root. If you wanted to do this, I would run sudo /absolute/path/to/flutter/bin/flutter.
That said, generally you should avoid running flutter as root; in fact, Flutter includes checks to warn people specifically not to do this.
If the issue is that flutter thinks you haven't yet accepted the licences, you could try running the sdkmanager command directly:
~/Library/Android/sdk/tools/bin/sdkmanager --licenses

and see if that helps.

@cbracken @zoechi @egm24 Thanks a lot!
sudo /home/user/Programs/flutter/bin/flutter doctor --android-licenses worked.
I accepted the licenses, and when I ran ~/Android/Sdk/tools/bin/sdkmanager --licenses (just to make sure), I got
Loading local repository...
All SDK package licenses accepted.======] 100% Computing updates...

regarding the licenses, after accepting all 6 licenses, it still wont work and Flutter keeps saying that I should I accept the licenses which I have done several times...
SOLUTION I found was:
I ran the Command as Administrator and accepted all licenses and now its working

flutter doctor --android-licenses
and agree for licenses type y
this is the best soloution for this issue

I ran into this issue today and the recommendation didn't work.
Run SDK_LOCATION\tools\bin\sdkmanager --licenses instead of the recommendation to update. It'll let you accept the missing licenses

This is work for me, thanks.

I solved it configuring java SDK 1.8 and Android API 28 in "Project Structure" (File->Project Structure).

Hi @allowthere
I'm closing this issue as it refer to an older version of Flutter.
If you are you still experiencing this issue with the latest version of Flutter,
you may want to open a new issue or comment below;
either way please provide your updated flutter doctor -v.
It would be helpful to have also your flutter run --verbose
and a self contained app on github (or the steps to reproduce it).
Thank you

I resolve this running cmd like administrator and in linux running with sudo

I resolved this in Linux by running
sudo yes | sdkmanager --licenses
to accept all licenses.

I found a solution... maybe it will work for you as it did for me (For me the issue was the flutter create command used the old android sdk folder).
Please @allowthere , check your "local.properties" file in the android folder.
Be sure the "sdk.dir= " value points to the same folder as the ANDROID_HOME variable.
Hope it helps !

Sir, can you please elaborate a little more .. after opening  local.properties file what I to do??

All Possible solution added [Solved] Flutter run error: You have not accepted the license agreements


Prompts layer

Hi, your paper says there are prompts in the front L layer
But I see your code should not be layer 1 is there no prompt
Which means there's an L-1 prompts?
Looking forward to your reply
if not self.first_layer:
if len(compound_prompts_deeper) > 0:
This means that deeper compound prompts are turned on
Here it behaves differently for text and visual side
Forward function is same for both
if not self.text_layer:
First check if the ith layer needs compound prompts or not
if not (counter > len(compound_prompts_deeper) - 1):

Hi @nwlxcdh255,
Thank you for showing interest in MaPLe!
Regarding your question, kindly note that we are using prompts in the first L layers.
Actually, in the MaPLe trainer code, we have already used prompts for the first layer (as shown in these lines at maple.py at this line).
Therefore, we do not use additional prompts in the first layer when we are inside model.py (that is why we have the if not self.first_layer:).
So overall we are using learnable prompts in the first L layers.
I hope that is clear now. Let us know if there are any questions.
Thank you and kind regards!

Thank you very much for your reply.


fix: add sort option for org and country only when needed

Fixes #1559
Changes:
Added sort options only if they are needed in the SpeakersDetailActivity.
Screenshots for the change:

@iamareebjamal yeah repititions are happening.
what i can do is use a getter method in the SepakersListAdapter and us that to give me the orgs and country instead of running on the main thread. what say?

You can do that, but instead whenever there is an update of list if speakers, you'll get that in the subscribe function of the observable. Trigger a function there to calculate the organisations and countries in 1 loop. and set it in a variable.
And when showing the dialog, use this variable to determine what should be the options

@iamareebjamal i think it should be fine now. anyways have a look.

@iamareebjamal @arp95 Is it necessary to perform so many computations? I suggest that you can just provide a default sorting option if the parameter is null.

@mananwason i think its needed because many things we have been seeing just for the fossasia event. In cases when orgs are same or country are same we have to remove the sort option i think.

@mananwason Besides, the computations will be less once Realm implementation has been merged, then we'll be able to easily query the amount of countries, orgs separately

@arp95 the problem is acceptable but the solution is not. You could have also just check for first few records if they contained the parameter then you could include it in sort options. If we get a large enough database, the app will start lagging from your solution.
@iamareebjamal Realm will not greatly improve performance in my opinion. The solution is flawed. A for loop on the ui thread is a definite NO!

@mananwason do you mean i just check first 4-5 values and update according to that?

@arp95 Yes. Just of the top of my head, this will be a better solution. I'm sure you can find an even better one.

@mananwason That's why I suggested RxJava to compute the results off the thread

Or you can use SQL query to COUNT DISTINCT country attribute

@mananwason @iamareebjamal is this approach fine? removed the for loop.

@mananwason @iamareebjamal i think this should be efficient.

@arp95 , using COUNT DISTINCT seems like a better approach in my opinion. Let the mentors make the final call though. @mananwason

@arp95 , using COUNT DISTINCT as suggested by @iamareebjamal  seems like a better approach in my opinion. Let the mentors make the final call though. @mananwason

@mahikaw When we merge Realm, SQL queries won't be available, and we'll have to resort o this methods only. Requiring breaking changes with merging. And this approach requires no computation, just a condition check on all holding and one assignment, which is much more efficient than a SQL query which may take several 100 milliseconds

@iamareebjamal seems like I didn't think this through. Thanks for pointing it out. 👍


Implement square and multiply algorithm for Scalar ^ operator

Now that we have pow implemented via ^, it runs very slowly for powers >100. Do a proper square and multiply implementation to make it fast.

How are you profiling the execution?


Development Build does not work with fingerprint as Runtime Version

Build/Submit details page URL
https://expo.dev/accounts/jinbu/projects/my-demo-expo-app/builds/25a7434a-4535-464e-b079-4863268b939b
Summary
When creating development build using fingerprint as runtime version, the branches with the same runtime versions arent recognized as compatible update. Happens for iOS and Android apps.
Managed or bare?
managed
Environment
npx expo-env-info
expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 14.6.1
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 18.20.4 - ~/hostedtoolcache/node/18.20.4/arm64/bin/node
      Yarn: 1.22.22 - ~/.yarn/bin/yarn
      npm: 10.7.0 - ~/hostedtoolcache/node/18.20.4/arm64/bin/npm
    Managers:
      CocoaPods: 1.15.2 - /opt/homebrew/lib/ruby/gems/3.0.0/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 23.5, iOS [17](https://github.com/ash-blossom/masquerena/actions/runs/10479750265/job/29026011412#step:7:18).5, macOS 14.5, tvOS 17.5, visionOS 1.2, watchOS 10.5
      Android SDK:
        API Levels: 33, 33, 33, 34, 34, 34, 34, 34, 35
        Build Tools: 33.0.2, 33.0.3, 34.0.0, 35.0.0
        Android NDK: 26.3.11579264
    IDEs:
      Xcode: 15.4/15F31d - /usr/bin/xcodebuild
    npmPackages:
      expo: ~51.0.28 => 51.0.28
      react: [18](https://github.com/ash-blossom/masquerena/actions/runs/10479750265/job/29026011412#step:7:19).2.0 => 18.2.0
      react-dom: 18.2.0 => 18.2.0
      react-native: 0.74.5 => 0.74.5
      react-native-web: ~0.[19](https://github.com/ash-blossom/masquerena/actions/runs/10479750265/job/29026011412#step:7:20).11 => 0.19.12
    Expo Workflow: managed

npx expo-doctor
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check for app config fields that may not be synced in a non-CNG project
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check npm/ yarn versions
✔ Check for legacy global CLI installed locally
✔ Check that native modules do not use incompatible support packages
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

Error output
No error.
Branches that dont have any updates yet will be listed here with no updates available. As soon as you push an update to the branch, it disappears.
In the first screenshot, you will see that the development branch is not showing. The second and third pictures shows that both the build and update runtime versions are the same.
The 4th picture shows what I see as version number, not sure if this is normal.
The 5th and 6th pictures shows that my app does work when semantic versioning is used.
1st picture

2nd picture

3rd picture

4th picture

5th picture

6th picture

Reproducible demo or steps to reproduce from a blank project
create app.config.js with the fingerprint runtime version
runtimeVersion: {
  policy: 'fingerprint'
},

run eas build command
run eas update command
ensure that same platform, channel, branch etc are used.

As a temporary fix, what I have done is create app.config.js that dynamically determines the runtime version
const getRuntimeVersion = () => {
  if (RUNTIME_VERSION === 'fingerprint') {
    return { policy: 'fingerprint' }
  }

  return RUNTIME_VERSION
}
...
...
runtimeVersion: getRuntimeVersion(),

Then in the CI/CD I set the RUNTIME_VERSION to 'fingerprint', run a script that in essence executes npx expo-updates fingerprint:generate command to generate the hash. Overwrite RUNTIME_VERSION env with the new hash and build the app. Now, instead of file:fingerprint, I get the actual hash. After the build, I set the RUNTIME_VERSION back to fingerprint and execute whatever commands comes after that, like eas update.

Hi @okkes
In screenshot number 1, you list updates for branch production and there aren't any. It looks like you don't have any updates from branch production compatible with this runtime version, which seems correct because you don't have any updates for the production branch with this runtime version, only for branch development. Are you able to see the updates for branch development using the same version of the dev client app? It seems like there are a few compatible with this runtime version on the development branch 🤔

Sorry for causing confusion with that screenshot. The screenshot #1 was to actually show that the development branch was not listed. The reason why the production is there is because there are no updates pushed yet. That one will also disappear as soon as I push an update there.
So, the issue I am getting from this is actually related to the 4th picture. When building using fingerprint + dev client, it shows file:fingerprint as runtime version. And this one is most likely literally compared to the hash in updates. When I use the hash as custom runtime version during the build, the build can find the updates that are generated using fingerprint

I talked about it with developers working on the dev client/fingerprint/EAS Update, and it seems like this is a bug/current limitation of the dev client that it doesn't support the fingerprint policy to load compatible updates.

Will fix before moving fingerprint runtime version out of beta. Should be production ready by SDK 53 or maybe 52.

@wschurman when do you think fingerprint policy will be production ready?

@markwitt1 - Looking like SDK 53 or 54 for continuous deployment to production (need to figure out how to do continuous submission). For development (PR comment using expo/expo-github-action/continuous-deploy-fingerprint) it is working well.


Using xf to restrict the root growth

Maybe RFV is not conservative in different soil types.
Maybe RFV is not consistence in the presence of water stress.
Soil parameter xf can be the tool to vary RFV in different layers.
But first, some evidence is necessary to verify that the RFV does change over time and depths.
This needs to go back the raw data and do the change point analysis.

did use this in chapter 4 for the seedling crops


refactor(step-2) remove env, file_utils and filesystem_utils

Proposed changes
Issue Number: close #17764
Problem summary
Follow #17586.
This PR mainly changes:

Remove env/
Remove FileUtils/FilesystemUtils
Some methods are moved to LocalFileSystem
Remove olap/file_cache
Add s3 client cache for s3 file system
In my test, the time of open s3 file can be reduced significantly
Fix cold/hot separation bug for s3 fs.

This is the last PR of #17586.
After this, all IO operation should be in io/fs.
Checklist(Required)

[ ] Does it affect the original behavior
[ ] Has unit tests been added
[ ] Has document been added or modified
[ ] Does it need to update dependencies
[ ] Is this PR support rollback (If NO, please explain WHY)

Further comments
If this is a relatively large or complex change, kick off the discussion at<EMAIL_ADDRESS>by explaining why you chose the solution you did and what alternatives you considered, etc...

run buildall

run buildall

TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 33.84 seconds
stream load tsv:          438 seconds loaded<PHONE_NUMBER>9 Bytes, about 162 MB/s
stream load json:         24 seconds loaded<PHONE_NUMBER> Bytes, about 93 MB/s
stream load orc:          72 seconds loaded<PHONE_NUMBER> Bytes, about 14 MB/s
stream load parquet:          30 seconds loaded 861443392 Bytes, about 27 MB/s
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230326112555_clickbench_pr_120776.html

run buildall

run buildall


Optional parameter to enable the mask being displayed immediately

Is it possible to add an optional parameter that, when set to true, displays the mask immediately. In the current version, the user has to type the first character before the mask is shown.
It would like that all input fields with a mask, display there mask when the form is rendered.

+1, without this the text-mask can be used only for simple local phone
Another needed improvement is placeholder-mask like dd/mm/yyyy 12/mm/yyyy 12/03/yyyy (the user uses the correct format, not guess it e.g. //____ - what should I put first, day or month?)
mask: CHE999999999 (ide of swiss doctor)
what I see in placeholder: CHE99999999
when I start typing, I do "C" and see that my cursor on "CHE_"
It should be "CHE_" right after I clicked in input - that is what the issue about.

+1

Any news about this issue?

I'm afraid I still haven't had time to figure it out.

maybe a fake key event?


Replace header image with Octocat

@githubteacher This PR changes the image at the top of the website to be a user on a computer with an Octocat. :octocat:
What do you think?

@stoe, that's a great point, thank you! I've found another GitHub image and uploaded it directly to this repository.


Compare & Contrast Everything for Performance

Is your feature request related to a problem? Please describe.
Figuring out what network topology to use based on previous data and particular problems is incredibly time consuming and frustrating.
Describe the solution you'd like
It would be amazing if Carrot could automate the process of not only neuroevolution, but also what network and network structure/architecture/paradigm would be best to solve a particular problem.
Describe alternatives you've considered
Trail and error; Data Robot; reading research papers; etc.
Additional context

This might also help with this:
https://github.com/liquidcarrot/carrot/issues/50


flutter_logs:compileReleaseJavaWithJavac. > error: invalid source release: 17

Hi, after upgrading to flutter 3.22 i am getting this error white running on jenkins with windows, my local machine(macos) does not have this trouble:
Running Gradle task 'assemblePayerRelease'...
FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':flutter_logs:compileReleaseJavaWithJavac'.

error: invalid source release: 17

here are the
below flutter docs:
flutter doctor -v
[√] Flutter (Channel stable, 3.22.0, on Microsoft Windows [versao 10.0.14393], locale pt-BR)
• Flutter version 3.22.0 on channel stable at C:\Users\Administrator\Documents\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 5dcb86f68f (13 days ago), 2024-05-09 07:39:20 -0500
• Engine revision f6344b75dc
• Dart version 3.4.0
• DevTools version 2.34.3
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at C:\Users\Administrator\AppData\Local\Android\Sdk
• Platform android-34, build-tools 32.0.0
• ANDROID_HOME = C:\Users\Administrator\Documents\android-sdk
• ANDROID_SDK_ROOT = C:\Users\Administrator\Documents\android-sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.11.31829.152
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.84.1)
• VS Code at C:\Users\Administrator\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (2 available)
• Windows (desktop) • windows • windows-x64    • Microsoft Windows [versao 10.0.14393]
• Chrome (web)      • chrome  • web-javascript • Google Chrome 124.0.6367.210
[√] Network resources
• All expected network resources are available.
• No issues found!
my installed javas:
javac 17.0.11
java 17.0.11 2024-04-16 LTS
Java(TM) SE Runtime Environment (build 17.0.11+7-LTS-207)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.11+7-LTS-207, mixed mode, sharing)
does anybody got any idea whats is going on?

Same for me

Somebody found a workaround for this?

Please try version 1.0.22


Do chrome web browsers use Glide to cache images

Good day, nice library. am curious i want to know if chrome web browsers also uses glide to cache their images thanks.

I would not expect so. Browsers have to follow complex rules to determine how images are cached, based on headers, e-tag, other mechanisms. Glide is also an Android only library, Chrome supports Windows, Mac, linux.


Canvas is on!

Game canvas is on background
React Interface is on top
Co-Authored-By: Nick Kosarev<EMAIL_ADDRESS>Co-Authored-By: Sleeplessness8<EMAIL_ADDRESS>

About 100 FPS on my laptop


Check Array1.Serialization unit test failure in release mode

In CubbyFlow, all unit tests are passed in debug mode.
However, in release mode, Array1.Serialization test is failed.
I think Serialization.cpp is not linked due to optimization (may be unused).
At least, the problem will fixed naturally while implementing Ver 0.3.
Keep in touch,

Fixed. Check issue #79.


Garage fan position

Is your feature request related to a problem? Please describe.
I have my “Meross Smart WLAN garage door opener”, which has no information about the current position.
What options would I have to implement a fan position for the garage?
I first thought of a time-based cover variant to retrofit the %.
That would be the feature request as to whether it is possible to determine the position in the integration over time.
Something like here: https://github.com/davidramosweb/home-assistant-custom-components-cover-time-based
However, the project looks a little outdated

Okay, I don't think that helps at all because there is no remote stop, so the garage always opens and closes completely anyway.

Yep..it would require a lot of effort and 99% of the times garage doors just open/close to a full run when operated.


haskellPackages.hnix-store-{core,remote}: downgrade to < 0.5

hnix 0.13.* doesn't support hnix-store-* >= 0.5 yet, pending some
refactors to get GHC 9.0.x support working. Until that happens,
we downgrade hnix-store-* since nothing needs the new version yet.
https://github.com/haskell-nix/hnix/issues/952

Motivation for this change
Things done

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

[ ] 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/)
21.11 Release Notes

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

[ ] Fits CONTRIBUTING.md.

@ofborg build haskellPackages.hnix

Thank you!


Convert floats to strings

I'm very new to go, so sorry for a potentially dumb question... As far as I understand the problem in #37 is caused by marshaling from float64 into string with too much precision.
Can't we just define a MarshalJSON function that will convert float64 with like like fmt.Sprintf("%.8f", amount).
As far as I understand, most of the cryptocurrencies need max 8 digits after the decimal point. Price in USD, EUR or GBP need 2 digits %.2f.

There is a general issue of accuracy: https://stackoverflow.com/questions/3730019/why-not-use-double-or-float-to-represent-currency

Yes, I see. We have two issues here:

Accuracy of calculations with floats
Wrong marshaling logic

But we need to think about the solution more carefully. Your changes solve the marshaling issue by making users to perform marshaling. This solves the accuracy issue implicitly by forcing users to perform string parsing. but introduces few other issues. Few from top of my head:

This change will break backward compatibility;
You have to support different types to be able to implement very basic things. For example, if you want to maintain a real-time order book with maps for asks and bids (something like map[KeyType]OrderBookItemType) and be able to order asks and bids by price you would need to use float as KeyType anyway, because you can't use decimals in map keys: you will get duplicates and you can't use strings because "200.01" > "19999.01" == true.

I think, this change makes the library harder to use.
I'm looking at min values for currencies supported by GDAX:
BTC 0.00000001
LTC 0.00000001
ETH 0.00000001
BCH 0.00000001
EUR 0.01
GBP 0.01
USD 0.01

And it seems to me that we can just:

Implement MarshalJSON that will convert floats into strings with required precision. It will solve #37. I can be wrong, but as far as I can see you will not lose anything when you round your float number into %.8f. You would need to round a number anyway after calculations.
Update the documentation to instruct users to use decimals for calculations, if they care about accuracy and convert decimals into floats.

So we use floats only for transport/marshaling purposes. It will be easier to use the library for people who don't care about accuracy much or already use decimals for calculations.

I solved it for orders only in a very simple way, did not create a PR as it's not solving the problem for all the objects:
`diff --git a/order.go b/order.go
index 74a64a7..795a956 100644
--- a/order.go
+++ b/order.go
@@ -4,18 +4,25 @@ import (
"fmt"
)
+type Float float64
+
+// Limit precision of floats to 4 digits when marschalling them to JSON.
+func (n Float) MarshalJSON() ([]byte, error) {

return []byte(fmt.Sprintf("%.4f", n)), nil
+}

type Order struct {

Type      string  json:"type"
Size      float64 json:"size,string,omitempty"
Side      string  json:"side"
ProductId string  json:"product_id"
ClientOID string  json:"client_oid,omitempty"
Stp       string  json:"stp,omitempty"

Type      string json:"type"
Size      Float  json:"size,string,omitempty"
Side      string json:"side"
ProductId string json:"product_id"
ClientOID string json:"client_oid,omitempty"
Stp       string json:"stp,omitempty"
// Limit Order

Price       float64 json:"price,string,omitempty"
TimeInForce string  json:"time_in_force,omitempty"
PostOnly    bool    json:"post_only,omitempty"
CancelAfter string  json:"cancel_after,omitempty"

Price       Float  json:"price,string,omitempty"
TimeInForce string json:"time_in_force,omitempty"
PostOnly    bool   json:"post_only,omitempty"
CancelAfter string json:"cancel_after,omitempty"
// Market Order
Funds float64 json:"funds,string,omitempty"
// Response Fields`

And then to use, in a call, just do gdax.Float(p) where p is the float64 value.

I strongly agree with @preichenberger on this one - using strings and letting users handle conversions is the way to go IMO.
Using floats for monetary values is extremely dangerous. Some solutions proposed here attempt to work around the precision error by wrapping floats but that just hides the problem. At the end of the day it's going to get silently either truncated or rounded up.
This is especially dangerous if you're doing operations (e.g. add, multiply) behind the scenes using those values (which I'm guessing most users of this library eventually do?).
shopspring/decimal gives some examples of that.
For instance, adding 0.01 a thousand times results in 9.999999999999831 rather than 10: https://play.golang.org/p/TQBd4yJe6B
I don't see how anyone can perform reliable operations using floats (e.g. place a limit order 10% below the current market price). Strings are the way to go (which is why both CoinBase and GDAX APIs deal with strings, not integers nor floats).
There are a few ways users can deal with that, depending on their particular use case and what they're willing to tolerate:

Use big.Rat (standard library - https://golang.org/pkg/math/big/) to convert from string, do some operations, convert back to a string without silently losing any precision.
Use a third party library like shopspring/decimal
Use strconv or fmt.Sprintf if you like to live dangerously

Please do not bake float conversion into the library and try to hide them. Those 15 seconds gained by being more "pleasant" to use will come back and haunt you down the road.

is it possible to merge this soon? @preichenberger. I was unaware of this issue as I was building off of the go-gdax library and it's caused some headache.


support multiple sessions

Currently a user can only log in to one device at a time.

Do you want help on this?

@henriquesa Absolutely! Any help/suggestions are always welcome.

@henriquesa If you would like to help, please reference #11 for some things to keep in mind.

Awesome! I read up on that issue and the linked SO discussion, and I think we can brainstorm a good solution.
The SO discussion seems pointed towards how to invalidate the JWT token, while avoiding a DB hit. The original poster gave up on this original idea and decided to always query the user. The second answer you pointed out has an interesting idea of using JWTs with a short lifespan. I don't think this is a good approach because I believe the user must have a way to immediately revoke access to their account of other active sessions. Appy doesn't currently use JWTs to avoid DB hits either, so there's an added implementation complexity. This isn't a huge deal though, I do think we should pick the better option, but I don't think that's it.

Do you agree we should ignore the extra DB hit for immediate revoking and not consider the temporary JWT approach?

then they could easily invalidate all their current tokens by changing their password.

I agree a password hash is a very easy way to invalidate these tokens when users change passwords. I'd suggest on top of this an extra endpoint where a logged in user could invalidate all their sessions for this specific use-case, a "log out of all other devices" action.

Assuming appy stops destroying other sessions on new logins, what do you think about this extra endpoint?

While I don't mind the password hash approach, do you think it's also worth it destroying sessions when the password changes?

Do you see any issues having the logout endpoint destroying that specific session and keeping the others active?

@JKHeadley on number 1, "Do you agree we should ignore" may be better read as "Do you agree we should keep ignoring", because there's already a hit on both Session and User for every request.

Hi @henriquesa, thanks for the brainstorming thoughts!  Here are my thoughts on your points.

This depends on the type of authentication strategy being used.  Please see the wiki for details on the different strategies.  The default strategy for appy uses both an access token and a refresh token.  The idea is that the access token has a short lifespan, but does not require a db hit, while the refresh token has a long lifespan, but requires a db hit, and therefore can be invalidated.  This reduces the number of db hits while still providing a level of control over token security.
On the other hand the session strategy does hit the db on every request, and therefore can revoke all token access immediately.
In either case, allowing multiple user sessions, and how sessions are revoked, should be independent of which authentication strategy is used (unless of course the strategy does not use sessions).

I agree that having an endpoint to log out of all sessions would be useful.

I do feel that invalidating all tokens (not necessarily destroying all sessions) is good on a password change, simply because the nature of a password change is usually an action to gain control/increase security, and invalidating tokens falls in line with that theme.

I think the logout endpoint should always only destroy the one session linked to the current token.  I do see an issue with "orphan" sessions cluttering the db if multiple sessions are allowed (when a user logs in but never logs out), but I believe there are ways to account for this.
The best option I see is to swap the "createdAt" session property (seen here ) with an "updatedAt" property that includes an expiration period equal to the refresh token expiration period.  Whenever the refresh token is updated, the "updatedAt" property should be updated to the current time as well.  This guarantees that when the refresh token expires, mongodb will automatically delete the session as well.  You can read more about expiring data through mongodb here

I did forget there are multiple strategies when thinking about this, I only took into consideration the session strategy! Agreed revoking should be independent of the choice wherever possible.
With this new info, I guess the session implementation is very straightforward. We could

on login, stop invalidating other sessions
on logout, only invalidate the current session
create an endpoint where all sessions are invalidated
implementing the updatedAt property for mongodb purging (as well as suggesting implementing a shorter expiration period to further help avoiding the mentioned orphan sessions)

Unless I'm missing something, the refresh token strat wouldn't really differ, because refresh is very similar to session. Do you think the standard token should change in any way, both in the standard token strategy and its behavior in the refresh token strategy? And do you agree with the steps above?

@henriquesa That sounds good!
I do believe the refresh and session strategies use the same internal logic for handling sessions, so it should work the same for both.  I don't think the standard/access token should change in any way.
I see your point with implementing shorter expiration periods.  I think in the end it is up to the developer using appy how long each expiration period should be.  Either way I think it makes sense for the session expiration to match the refresh/session token expiration, since one expiring invalidates the other.

@henriquesa Just checking in, how's the progress with this?

@JKHeadley, can I join?

@labsvisual I actually have an implementation in place for this feature now, but you are definitely welcome to work on other features!


Fix missing required parameters when instantiating rule addresses

Pack (replace this with the pack's name)
Status
Replace this: describe the pack and PR status. Examples:

new pack, complete
pack extension, work in progress
bugfix

Description
Replace this with the PR description.
Checklist (tick everything that applies)

[ ] Metadata: pack.yaml, icon, structure (required for new packs)
[ ] Version bump (required for changed packs)
[ ] Code linting (required, can be done after the PR checks)
[ ] Tests (not required but really recommended)

Thanks.
I will merge this into trunk and pin requirements.txt to latest trunk again and then the tests should pass I believe - https://travis-ci.org/StackStorm/st2contrib/jobs/125680628

Yep, tests are passing with those changes + trunk version - https://travis-ci.org/StackStorm/st2contrib/builds/125727781


Support local storage live migration for direct download templates

Description
This PR fixes live local storage migration for VMs created with "Direct Download" images.
Currently, the local storage driver has no special handling for direct download templates during live storage migration. The workflow is something like 1) check to see if root volume's backing template exists on destination primary storage 2) if not, then send a CopyCommand to copy template to destination storage 3) create new destination volume on destination primary storage against the backing template. 4) send destination volume info during MigrateCommand so we can rewrite the volume path in the VM XML during migration 5) migrate VM.  In step 2 - CopyCommand is not the right thing to do for putting a "Direct Download" template onto primary storage, it should instead be a type of DirectDownloadCommand.
Additionally, Direct Downloads don't use the template ID as the name of the template file on primary, they use a dynamically generated name, so the template paths are different between source and destination pools. Thus we need to pass the new template path along in MigrateCommand so we can replace this backing store path in the VM XML during live migration.
This patch updates the KvmNonManagedStorageDataMotionStrategy used during local storage migration to handle staging of DirectDownload templates via a DirectDownloadCommand instead of a CopyCommand, and also provides the backing store path and relevant XML substitution during MigrateCommand handling.
Additional testing would be appreciated for workflows involving the KVMNonManagedStorageDataMotionStrategy, though I suspect the scope is fairly limited to live storage migration of Filesystem and NFS storage types. Since this class extends the StorageSystemDataMotionStrategy, some minor changes were made to it as well but nothing that should change its behavior.
I haven't tested migration of Direct Download VMs while stopped yet, that may need a separate/similar PR.
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
[x] Minor

Bug Severity

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

How Has This Been Tested?
Tested in local virtual environment with local storage KVM hypervisors, first reproduced the problem and then fixed it.

@blueorangutan package

@rohityadavcloud a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 5960

@blueorangutan test

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

Trillian test result (tid-6444)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39450 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7453-t6444-kvm-centos7.zip
Smoke tests completed. 109 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test
Result
Time (s)
Test File

Thanks @mlsorensen for raising this. I'm unable to reproduce the issue but have manually tested live migration with local storage on direct download templates, as well as with secondary storage and it works as expected. Smoke tests are also passing

Thanks @mlsorensen for raising this. I'm unable to reproduce the issue but have manually tested live migration with local storage on direct download templates, as well as with secondary storage and it works as expected. Smoke tests are also passing

Thanks @davidjumani This concerns me, I don't want to make the change if it is working for you - however I don't see how it is possible that it is working just based on reading the code.  One way it may work is if the direct download template has already been used on destination storage before an attempt for VM live migration. I'd like to get to the bottom of this before we merge.

@davidjumani I was able to get the live migration to work with local storage, however there are a few steps that silently error, and the result is that the VM after moving is not linked to a template, it is its own full copy. These steps that silently fail revolve around staging the template to destination storage which are addressed in this patch.
I suspect if you look at your test setup, you may also see errors and also see that post migration there is no longer a backing file on your VM's root disk, even though the migration succeeded.

@nvazquez can you review/test this? If this is ready for merge, pl go ahead. Thanks.

This is ready for merging but @mlsorensen can you rebase (or change) base of your PR to 4.18. It would benefit to have the fix in 4.18 branch and fwd-merged into main. Thanks.

Hi @mlsorensen can you please rebase to branch 4.18?

@blueorangutan package

@nvazquez a Jenkins job has been kicked to build packages. It will be bundled with  KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 6020

@blueorangutan test

Trillian test result (tid-6503)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43646 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7453-t6503-kvm-centos7.zip
Smoke tests completed. 108 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test
Result
Time (s)
Test File


ceylon.build can be now configured by the file .ceylon/config

The build can now be configured like the other Ceylon plugins by reading .ceylon/config.
A new section [builder] now contains the options passed to the compiler for compiling the build script.
[builder]
cache.repo=...
encoding=...
javacoption=...
mavenoverrides=...
nodefaultrepositories=...
offline=...
user.repo=...
resource=...
source=...
suppresswarning=...
system.repo=...
verbose=...

Additionally it honours settings in the [defaults] section.
[defaults]
encoding=...
timeout=...

One additional fix is included, for unsetting Ant properties now correctly.

Closing pull request, because I'll do it in little PRs. At least making it compileable again and adding some bugfixes. Configuration should be done differently as @quintesse pointed out, but I'm not getting it.

Just get in touch @HenningB , I'll be happy to help!


Args with '--' don't parse correctly

Given a test program, /test-args, with the following content:
#!/bin/sh

echo $@

When I use chroot_vm.c to call /test-args with the arguments 1 2 3 4 5 6, I get back 1 2 3 4 5 6 respectively.
However, when I use chroot_vm.c to call /test-args with the arguments -- 1 2 3 4 5 6, I get back no arguments.
It seems that libkrun is stripping out arguments entirely if they contain --. I ran into this when I was trying to get tini to cooperate and realized that it wasn't seeing any parameters if the args contained a --.
Note that this doesn't happen if I don't use krun_set_exec at all and instead pivot to using /.krun_config.json to set my command, which works fine.

The krun_set_exec method has, indeed, many shortcomings coming from the fact that it relies on the kernel command line to pass the arguments to init.c. Many of those shortcoming can't be fixed without a significant amount of hackery, and since nowadays the preferred way of passing arguments is through /.krun_config.json, I don't think it's worth investing time it was it will likely be a suboptimal solution.


Allow importing native structs/defining new structs

Currently we are unable to define custom/native structs, making a select few functions in the game's codebase unusable.
One example is the inkText widget which should allow the definition of a word-wrap policy:
myInkTextWidget.SetWrappingInfo(new textWrappingInfo(true, 1000000.0, textWrappingPolicy.Default));
Since the native struct textWrappingInfo is not exposed by default (and not able to be imported into Redscript currently) and we cannot define a custom struct we cannot actually pass in the required parameters. This makes defining custom widgets created in Redscript that also rely on text wrapping difficulty.
There may be other similar examples in the codebase as well.

I've added basic support here, feel free to test if you want

Awesome, thank you. Will test this out soon!

it's been merged and released now,
create a new issue if you run into any problems


[Bug]: Used too much storage to store build intermediates

Is there an existing issue for this?

[X] I have searched the existing issues

Is there a StackOverflow question about this issue?

[X] I have searched StackOverflow

What happened?
Usually, I will run this command to check there is no compile error in the project.
./gradlew --init-script gradle/init.gradle.kts --no-configuration-cache --no-daemon clean spotlessApply assembleRelease testClasses assembleAndroidTest --warning-mode all
I noticed that after finishing compiling, the size of the project folder grows rapidly, it will use about 15GB of disk space to store build intermediates.

Each feature module took around 1.3G of disk space:

In the core folder, the size of designsystem, ui, and database modules are abnormal, for other modules, the size is ok.
I am curious if it is expected to use so much storage to save build intermediates for a single module. The size can be easily 'exploded' by adding more modules to the project.
GitHub-hosted free tier runners provide 14G of storage to run actions, the storage limit of the runners is almost the same as the size of the project. If we add one more module, the action will fail and throw a No space left error, causing the CI to fail all the time.
Relevant logcat output
No response
Code of Conduct

[X] I agree to follow this project's Code of Conduct

When executing assembleRelease testClasses assembleAndroidTest you are effectively asking Gradle to build almost everything in all variants:

assembleRelease: assembleProdRelease/assembleDemoRelease for all Android modules
assembleAndroidTest: assembleDemoDebugAndroidTest/assembleProdDebugAndroidTest for all Android modules
testClasses: build JVM modules only
You are therefore "wasting" a lot of compute time to build artifacts you probably don't need.

Test APKs are bundled with a lot of junk (not sure what is including them at the moment, agp, build-tools, etc.?) and can be found in intermediates artifacts as well.

Fonts (~150M) (especially NotoSansCJK)
IBM's ICU (~50M)
librobolectric (~32M) (for macos while using windows...)
sqlite4java (~2.7M) (all arch)

If feel like this is not normal 🤯
Details of a test apk...

.
├── [ 26M]  com
│   └── [ 26M]  ibm
│       └── [ 26M]  icu
│           ├── [2.9K]  ICUConfig.properties
│           └── [ 26M]  impl
├── [159M]  fonts
│   ├── [3.8M]  DroidSansFallback.ttf
│   ├── [1.2M]  NanumGothic.ttf
│   ├── [9.0M]  NotoColorEmoji.ttf
│   ├── [ 18M]  NotoSansCJK-Black.ttc
│   ├── [ 18M]  NotoSansCJK-Bold.ttc
│   ├── [ 17M]  NotoSansCJK-DemiLight.ttc
│   ├── [ 17M]  NotoSansCJK-Light.ttc
│   ├── [ 17M]  NotoSansCJK-Medium.ttc
│   ├── [ 18M]  NotoSansCJK-Regular.ttc
│   ├── [ 16M]  NotoSansCJK-Thin.ttc
│   └── ...
├── [ 25M]  icu
│   └── [ 25M]  icudt68l.dat
├── [ 32M]  native
│   └── [ 32M]  mac
│       ├── [ 15M]  aarch64
│       │   └── [ 15M]  librobolectric-nativeruntime.dylib
│       └── [ 16M]  x86_64
│           └── [ 16M]  librobolectric-nativeruntime.dylib
└── [2.7M]  sqlite4java
    ├── [1.5M]  osx
    │   └── [1.5M]  libsqlite4java.dylib
    ├── [668K]  win32-x64
    │   └── [668K]  sqlite4java.dll
    └── [518K]  win32-x86
        └── [517K]  sqlite4java.dll

Found this issue 🕵 preparing the fix with a report…

When executing assembleRelease testClasses assembleAndroidTest you are effectively asking Gradle to build almost everything in all variants:
You are therefore "wasting" a lot of compute time to build artifacts you probably don't need.

Yes, I did it intentionally. I need to check if there are any compilation issues in the code. Sometimes I modify the ViewModel but Android Studio won't notify me if there are errors that exist in the ViewModelTests. So I have to compile everything to avoid failures in CI.

The main issue comes from robolectric being added to the runtime classpath of instrumented tests because it is transitively exported by :core:testing.
https://github.com/android/nowinandroid/blob/aea26aa831c7b4b565bb2088281123d35eba5410/core/testing/build.gradle.kts#L43
Here are some stats/results with different solutions:

Default (main branch)
BUILD SUCCESSFUL in 17m 10s
2259 actionable tasks: 2256 executed, 3 up-to-date

du --human-readable --summarize .
7.6G    .

find . -name "*.apk" -exec du --human-readable --summarize '{}' \;
159M    ./app/build/outputs/apk/androidTest/demo/debug/app-demo-debug-androidTest.apk
23M     ./app/build/outputs/apk/demo/debug/app-demo-debug.apk
177M    ./core/database/build/outputs/apk/androidTest/demo/debug/database-demo-debug-androidTest.apk
177M    ./core/designsystem/build/outputs/apk/androidTest/demo/debug/designsystem-demo-debug-androidTest.apk
177M    ./core/ui/build/outputs/apk/androidTest/demo/debug/ui-demo-debug-androidTest.apk
177M    ./feature/bookmarks/build/outputs/apk/androidTest/demo/debug/bookmarks-demo-debug-androidTest.apk
177M    ./feature/foryou/build/outputs/apk/androidTest/demo/debug/foryou-demo-debug-androidTest.apk
177M    ./feature/interests/build/outputs/apk/androidTest/demo/debug/interests-demo-debug-androidTest.apk
177M    ./feature/search/build/outputs/apk/androidTest/demo/debug/search-demo-debug-androidTest.apk
178M    ./feature/settings/build/outputs/apk/androidTest/demo/debug/settings-demo-debug-androidTest.apk
177M    ./feature/topic/build/outputs/apk/androidTest/demo/debug/topic-demo-debug-androidTest.apk
177M    ./sync/work/build/outputs/apk/androidTest/demo/debug/work-demo-debug-androidTest.apk

1st solution (changing the configuration)
-implementation(libs.robolectric.shadows)
+compileOnly(libs.robolectric.shadows)

BUILD SUCCESSFUL in 13m 33s
2259 actionable tasks: 2254 executed, 5 up-to-date

du --human-readable --summarize .
2.3G    .

find . -name "*.apk" -exec du --human-readable --summarize '{}' \;
1.7M    ./app/build/outputs/apk/androidTest/demo/debug/app-demo-debug-androidTest.apk
23M     ./app/build/outputs/apk/demo/debug/app-demo-debug.apk
18M     ./core/database/build/outputs/apk/androidTest/demo/debug/database-demo-debug-androidTest.apk
19M     ./core/designsystem/build/outputs/apk/androidTest/demo/debug/designsystem-demo-debug-androidTest.apk
19M     ./core/ui/build/outputs/apk/androidTest/demo/debug/ui-demo-debug-androidTest.apk
19M     ./feature/bookmarks/build/outputs/apk/androidTest/demo/debug/bookmarks-demo-debug-androidTest.apk
19M     ./feature/foryou/build/outputs/apk/androidTest/demo/debug/foryou-demo-debug-androidTest.apk
19M     ./feature/interests/build/outputs/apk/androidTest/demo/debug/interests-demo-debug-androidTest.apk
19M     ./feature/search/build/outputs/apk/androidTest/demo/debug/search-demo-debug-androidTest.apk
20M     ./feature/settings/build/outputs/apk/androidTest/demo/debug/settings-demo-debug-androidTest.apk
19M     ./feature/topic/build/outputs/apk/androidTest/demo/debug/topic-demo-debug-androidTest.apk
20M     ./sync/work/build/outputs/apk/androidTest/demo/debug/work-demo-debug-androidTest.apk

2nd solution 2 (:roborazzi) #1163
BUILD SUCCESSFUL in 11m 21s
2122 actionable tasks: 2118 executed, 4 up-to-date

du --human-readable --summarize .
2.0G    .

find . -name "*.apk" -exec du --human-readable --summarize '{}' \;
1.2M    ./app/build/outputs/apk/androidTest/demo/debug/app-demo-debug-androidTest.apk
23M     ./app/build/outputs/apk/demo/debug/app-demo-debug.apk
3.8M    ./core/database/build/outputs/apk/androidTest/demo/debug/database-demo-debug-androidTest.apk
17M     ./core/designsystem/build/outputs/apk/androidTest/demo/debug/designsystem-demo-debug-androidTest.apk
19M     ./core/ui/build/outputs/apk/androidTest/demo/debug/ui-demo-debug-androidTest.apk
19M     ./feature/bookmarks/build/outputs/apk/androidTest/demo/debug/bookmarks-demo-debug-androidTest.apk
19M     ./feature/foryou/build/outputs/apk/androidTest/demo/debug/foryou-demo-debug-androidTest.apk
19M     ./feature/interests/build/outputs/apk/androidTest/demo/debug/interests-demo-debug-androidTest.apk
19M     ./feature/search/build/outputs/apk/androidTest/demo/debug/search-demo-debug-androidTest.apk
20M     ./feature/settings/build/outputs/apk/androidTest/demo/debug/settings-demo-debug-androidTest.apk
19M     ./feature/topic/build/outputs/apk/androidTest/demo/debug/topic-demo-debug-androidTest.apk
7.4M    ./sync/work/build/outputs/apk/androidTest/demo/debug/work-demo-debug-androidTest.apk

@lihenggui the main issue has been fixed during this PR:

#1140

I prepared a followup PR to clean things up a bit more in:

#1315

You can close the issue 👍

@lihenggui the main issue has been fixed during this PR:

Update AGP to 8.3.0 #1140

I prepared a followup PR to clean things up a bit more in:

Cleanup dependencies #1315

You can close the issue 👍

Great, thank you!

A question here, the dependency resolution behavior is reverted in the AGP 8.3.1 version.

The behavior change for library modules is reverting to 8.2 behavior in 8.4.0-alpha12, and this revert will also be cherry-picked to 8.3.x.

Does that mean this issue will appear in the latest version again?

This was not the fix. The fix was mostly removing robolectric-shadow from the :core:testing module (which was included almost everywhere in the project)
https://github.com/android/nowinandroid/pull/1140/files#diff-6b9a7ef5da2d63d65731cee8c37d0228c481830ce6a813cdf9e9069c3cfd6288L43

My PR #1163 was also fixing the issue, before the AGP update.


Face-antispoof pretrained model

Recently, I am reproducing your paper--ANRL. I have four datasets(I&C&M&O), and train  a model based on your source code. In I&C&m to O task, the EER of O is above 0.3, while in the training dataset, the EER is very low, below 0.001. I don't know why. Can you provide me a pretrained model.

Hi @tyyff, I would like to reproduce anti-spoofing papers for my research.
But I cannot access to Replay Attack dataset (I).
Could you please share this database?
My email<EMAIL_ADDRESS>I really appreciate any help you can provide.


StackPanel ActualWidth reports Wrong value

Describe the bug
ActualWidth reports window client width not width of Stack Panel
ActualHeight reports the same value, independed for window client size
Steps to reproduce the bug
Create a Stack panel with a fixed width.
Report ActualWidth of stackpanel in you favorite way. I used a text box and button to fill it with the stackpanel.ActualWidth.
Change the window size to less and more then size of stack panel width and observe the ActualWidth property.
the output is the window client width if under the fixed size of the stack panel.  If the window size is larger then the stack panel then the value is the fixed size.
The actualheight property is always the stack panel height, no matter the window size.
Expected behavior
The ActualWidth and ActualHeight should be the size of the stack panel.
Screenshots

NuGet package version
None
Windows version
Windows 10 (21H2): Build 19044
Additional context
Microsoft Visual Studio Community 2022
Version 17.5.0
VisualStudio.17.Release/17.5.0+33414.496
Microsoft .NET Framework
Version 4.8.09037
Installed Version: Community
Visual C++ 2022   00482-90000-00000-AA781
Microsoft Visual C++ 2022
ASP.NET and Web Tools   17.5.317.37931
ASP.NET and Web Tools
Azure App Service Tools v3.0.0   17.5.317.37931
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools   17.5.317.37931
Azure Functions and Web Jobs Tools
C# Tools   4.5.0-6.23109.5+6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Cookiecutter   17.0.22336.2
Provides tools for finding, instantiating and customizing templates in cookiecutter format.
Extensibility Message Bus   1.4.3 (main@2a4517a)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
Linux Core Dump Debugging   <IP_ADDRESS>414
Enables debugging of Linux core dumps.
Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Mono Debugging for Visual Studio   17.5.9 (11975e6)
Support for debugging Mono processes with Visual Studio.
NuGet Package Manager   6.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Office Developer Tools for Visual Studio   17.0.33303.00
Microsoft Office Developer Tools for Visual Studio
Python - Django support   17.0.22336.2
Provides templates and integration for the Django web framework.
Python - Profiling support   17.0.22336.2
Profiling support for Python projects.
Python with Pylance   17.0.22336.2
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.
Razor (ASP.NET Core)   <IP_ADDRESS>7502+8b3141d86b738daf2ca3ed9c15b12513071fc676
Provides languages services for ASP.NET Core Razor.
SQL Server Data Tools   17.2.40118.0
Microsoft SQL Server Data Tools
StylerPackage Extension   1.0
StylerPackage Visual Stuido Extension Detailed Info
Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.
Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.
Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.
TypeScript Tools   17.0.20105.2003
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools   4.5.0-6.23109.5+6a5a63bbc9f4449d9bd1e95a8f9624939c3ccdc3
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual C++ for Cross Platform Mobile Development (Android)   17.0.33312.129
Visual C++ for Cross Platform Mobile Development (Android)
Visual C++ for Linux Development   <IP_ADDRESS>414
Visual C++ for Linux Development
Visual F# Tools   17.5.0-beta.23053.5+794b7c259d9646a7eb685dad865aa27da7940a21
Microsoft Visual F# Tools
Visual Studio IntelliCode   2.2
AI-assisted development for Visual Studio.
VisualStudio.DeviceLog   1.0
Information about my package
VisualStudio.Mac   1.0
Mac Extension for Visual Studio
VSPackage Extension   1.0
VSPackage Visual Studio Extension Detailed Info
Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.
Xamarin   <IP_ADDRESS> (d17-5@33e727c)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer   <IP_ADDRESS> (remotes/origin/d17-5@e4dd80b2bb)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK   <IP_ADDRESS> (d17-5/797e2e1)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: 6dd9def
Java.Interop: xamarin/java.interop/main@149d70fe
SQLite: xamarin/sqlite/3.40.0@fdc1e34
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@9f02d77

I cannot reproduce the bug.
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100">
    <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
</StackPanel>

void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&)
{
    auto actualwidth = Content().as<Controls::StackPanel>().ActualWidth();
    myButton().Content(box_value(actualwidth));
}

Do you shrink the width of the bounding app window to less then the size of the stack panel?
Ex..  the outer window width is appWindow.ClientSize().Width
and I am reading the stack panel width with spMain().ActualWidth()
I create a larger stack panel which is about 600 pixels wide.

And I read it with...
windowWidth = int(spMain().ActualWidth());

Please try my code and tell me what you expect.

If you ensure my code works well, please close the issue.

I don't know how to try your code. Please share a minimal reproducible example shown in the following article.
How to create a Minimal, Reproducible Example
Your code is not complete. The following code has a compile error and the width of StackPanel is not fixed, it dosen't follow the steps to reproduce the bug.
	<StackPanel
		x:Name="spMain"
		Width="Auto"
		Height="Auto"
		Margin="0,0,0,0"
		Padding="0,0,0,0"
		HorizontalAlignment="Left"
		VerticalAlignment="Top"
		Background="Gray"
		BorderThickness="0"
		Orientation="Vertical"
		RequestedTheme="Default"
		SizeChanged="spMainSizeChanged">

A minimal reproducible example is like this;
<StackPanel Width="600"/>

In this sample, ActualWidth of the StackPanel always returns 600.

I dont want to use the button as the size. This bug is about the actual size of the STACKPANEL not producing the correct size output, NOT THE BUTTON.

I used the button to display the StackPanel ActualWidth, not the Button ActulaWidth. I followed the steps to reproduce the bug.

Create a Stack panel with a fixed width. I set 100 as the width.
Report ActualWidth of stackpanel in you favorite way. I used button to display the StackPanel ActualWidth.
Change the window size to less and more then size of stack panel width and observe the ActualWidth property. The ActualWidth property returns always 100.

ActualHeight works the way I expected.   It reports the height independent of whether the outside window is smaller and it is set to Auto.
Have you tried my code?  Make a default project with a 500 x500 fixed size stack panel and test it.  Your code doesnt access the stack panel width and height values.   If you dont want to check it pass the bug on to someone that cares.

Have you tried my code?

I tried your code. It had a compile error. I added 2 lines at the bottom. This reproduces the bug. The StackPanel size is not fixed, but the content size is fixed.
    <StackPanel
        x:Name="spMain"
        Width="Auto"
        Height="Auto"
        Margin="0,0,0,0"
        Padding="0,0,0,0"
        HorizontalAlignment="Left"
        VerticalAlignment="Top"
        Background="Gray"
        BorderThickness="0"
        Orientation="Vertical"
        RequestedTheme="Default"
        SizeChanged="spMainSizeChanged">
        <Rectangle Width="600" Height="600" Fill="Red"/>
    </StackPanel>

Someone can help you.

@Jellomoldbrain I believe this is a specification. To avoid this behavior, please set the Width property of the StackPanel to a constant value.

There appear to be two difference scenarios here, both of which are functioning as intended.
Scenario 1: StackPanel's explicit width exceeds the available space (e.g. wider than window).
<Window>
    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Width="100">
        <Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
    </StackPanel>
</Window>
In this case, if the window is smaller than the 100 pixel width, the stack panel will continue to report an actual width of 100 pixels because, that is how big you told it to be.  Even though the stack panel was told there wasn't enough space during layout for all 100 pixels it still honors the requested width because it doesn't know what its parent is going to do with it.  In this case it will clip it, but it also could offset it some way (such as the way a scroll viewer would) to show different parts of it.
Senario 2: StackPanel width is not specified but its contents exceed the available space (e.g. wider than the window).
<Window>
    <StackPanel>
        <Rectangle Width="600" Height="600" Fill="Red"/>
    </StackPanel>
</Window>
Here if the window is smaller than the 600 pixel width, the stack panel will report the actual width of the window because that is how wide it is.  It was told during layout that there were less than 600 pixels available and since there are no specific instructions to override that (such as a width or a minwidth property), it will honor that and take up only as much space as it was told it could have.  The behavior of a stackpanel is to clip its children if needed.  So the children being 600 pixels wide is fine, the stack panel will be the size of the window and clip the excess parts of the children.
I have validated that both these scenarios are working as expected.

Closing per @JJBrychell's comments above.


DateTime add(Duration(days: 1)) does not consider DST, but difference() does

Library: time
Dart SDK Version: 2.14.3

Running the following code on a machine in Europe/Vienna
var a = DateTime(2021, 10, 31);
print("${a.add(Duration(days:1))}");

prints 2021-10-31 23:00:00.000
I would expect 2021-11-01 00:00:00.000
especially since the following code is correctly taking DST into account
final end = DateTime(2021, 11, 1);
final start = DateTime(2021, 10, 31);
final duration = end.difference(start);
print("Duration $duration");

correctly prints Duration 25:00:00.000000 instead of 24:00

Also consider, that other languages like e.g. golang do this correctly: https://play.golang.org/p/Mx0REwHQp-b

I think this may be expected behaviour because these are local times and a 1-day Duration is always 24 hours - see https://github.com/dart-lang/sdk/issues/44014#issuecomment-720388984.
And in the Duration docs:

Durations are context independent. For example, a duration of 2 days is always 48 hours, even when it is added to a DateTime just when the time zone is about to do a daylight-savings switch. (See DateTime.add).

Yes, I've read that. I just find it very inconsistent, that subtracting the two days yields 25h, which is correct, but adding doesn't take DST into account. Especially frustrating since golang does ist correctly and is also developed by Google ;)

It would require a change to Duration to store calendar days separately from clock time. Not impossible, but different from what we are doing now, and therefore a breaking change.
It also requires some design.
If I have a duration of "one day and 20 hour", and I add it to noon the day before daylight saving starts/ends, are the hours added before or after the day? The result is going to differ by one hour depending on that choice.
If we introduce "months" and "years" as well, which are also not a fixed amount of the lower unit, we need to answer that question in general. And if we do, say, days before hours for addition, should we do it in the other direction for subtraction, because otherwise the two won't be inverses? Should adding a negative duration be taken as a subtraction then, so adding duration and then -duration gets you back to where you started (most of the time)?
Or should we just give you what DateTime(dt.year + dur.years, dt.month + dur.months, dt.day + dur.days, dt.hour + dur.hours, etc) would give you. (I'm not sure I can predict what that is in general, but it's definitely a consistent behavior).
We can definitely do something, but it's not clear that it's always going to be the thing that the user wants.
That's why we are a little wary about doing anything about this (that, and it being breaking).

Ok, I see the problem. Those are all very valid points. Maybe a solution would be to go the golang Route and add a separate DateTime.addDate() function that only accepts years, months, days?
From the golang docs:
func (t Time) Add(d Duration) Time
func (t Time) AddDate(years int, months int, days int) Time

Add(d Duration) is equivalent to Dart's add(Duration) and ignores DST. AddDate() is DST/timezone aware.
This also wouldn't be breaking. It could be implemented already as an extension, but seems quite essential and might be worth considering for the standard library.

Adding only calendar years/months/days does avoid some of the problems, but not all. You can still start with a date and time where that time doesn't exist at the resulting date (because of daylight saving starting), or where there are two (because of daylight saving ending) but it's less likely to be a problem.
The extension would be easy:
extension DateTimeAddDate on DateTime {
  DateTime addDate({int years = 0, int months = 0, int days = 0}) {
    if (years == 0 && months == 0 && days == 0) return this;
    return isUtc
        ? DateTime.utc(year + years, month + months, day + days, hour, minute,
            second, millisecond, microsecond)
        : DateTime(year + years, month + months, day + days, hour, minute,
            second, millisecond, microsecond);
  }
}

You can still run into quirky situations around, especially, daylight saving start:
void main() {
  {
    var t = DateTime(2021, 10, 30, 2, 30);
    print(t);
    var t2 = t.addDate(days: 1);
    print(t2);
    var t3 = t2.addDate(days: 1);
    print(t3);
  }
  {
    var t = DateTime(2021, 03, 27, 2, 30); // Assume DST starts March 28th.
    print(t);
    var t2 = t.addDate(days: 1);
    print(t2); // No 2:30, so becomes 3:30
    var t3 = t2.addDate(days: 1);
    print(t3);
    var t4 = t.addDate(days: 2);
    print(t4); // Skips the DST start day, so becomes 2:30
  }
}

We could add this to the platform. It's easier to add it as an extension method, because someone might implement DateTime (but, why?!), but it'd be better as an instance methods (because any of those implementations get to return their own type), ... but then it's breaking.

Thanks. Yes, I guess the extension is the best fix for me now. Adding it as a member to DateTime would be ideal imo as it wouldn't breaking. It is also exactly the same behaviour as in golang (I've translated your sample here https://play.golang.org/p/FIRAuz22lJn)
I guess most of the confusion came from the fact that Duration() takes days as a constructor param. Only allowing hours would've been more explicit, because with Duration(hours: 24) is immediately clear, that it doesn't take DST into account. But removing days now would be breaking. Maybe you could consider deprecating it for future releases?


@conda-forge-admin, please add bot automerge

Additional comment:
No response

Hi! This is the friendly automated conda-forge-webservice.
I just wanted to let you know that I added bot automerge in conda-forge/acsconv-feedstock#2.


⚠ DesiTorrents has degraded performance

In d283567, DesiTorrents ($DST) experienced degraded performance:

HTTP code: 200
Response time: 10918 ms

Resolved: DesiTorrents performance has improved in f409394 after 9 minutes.


Move MiqTask#human_status into it's own module

Purpose or Intent
To be used with Manageiq/manageiq#9559, this will allow the code for other models to reuse the human_status display logic, assuming they implement the methods state and status.  There is currently no enforcement requiring that those methods exist for this to be included in a class though.
Links

https://github.com/ManageIQ/manageiq/pull/9559

Steps for Testing/QA
Added tests around the logic for MiqTask::human_status, so that should suffice for testing beyond checking in the app/UI in common functionality around MiqTasks still works.

@miq-bot add_label refactoring

Part of me thinks this is really a UI presenter concern.  Do you know where this is actually being used?  Perhaps this can just be a helper or in one of the presenter / decorators.

@Fryguy Yup, I agree, but was unsure of proper way to go about refactoring it into more of a decorator without rocking the boat too much.
Basically, it seems to only be used in two places:

MiqReportResult#status
MiqWidget#status

So not very often, but the question is where those are now being used, and what they would affect if they were changed/removed.  Haven't looked into that, but I will report back with what I find.

Ugh, so the {miq_report_result,miq_widget}#status shows task#human_status which is made up from task#status and task#state
Is it possible for us to rename {miq_report_result,miq_widget}#status to #human_status so the field always means the same thing?

@kbrock That is kind of what I am looking into right now.  Seeing if I can make human_status basically what is called by those two and changing out status and state of those classes to reference the aliased columns or delegate to the associated miq_task.  I need to see where status is being used first though before I make any more decisions, which is a bit of a exercise in project greping.

ag `[. ]status\b`

1411 matches across 368 .rb files
Wish I knew a better way to say something that is not in a string or comment.
GL

@NickLaMuro
def status
  # puts "called status", caller
  raise "called status"
end

bundle exec rake #or have travis do it

not fool proof, but may be a start

So, taking a huge step back...what does this buy you...risk/reward/roi and all that?

@Fryguy we use "delegators" (with arel) for the 2 fields, bring them in as part of the main query and remove N+1 (and fetch less data)
not to mention status takes on a consistent meaning

I just wanted to get this out in the open so we can make a decision on this (hopefully today) if it should included or not.
The patch at the bottom of this comment is from the combination of #9559 and a final modification to this PR, making human status work with configurable columns/methods (columns ideally).  Here are some quick numbers:
Before
No Subtrees
Started GET "/report/explorer" for ::1 at 2016-07-12 17:03:49 -0500
Completed 200 OK in 4660ms (Views: 609.8ms | ActiveRecord: 594.0ms)

ms
bytes
objects
queries
query (ms)
rows

4,223.6
N/A
4,263,693
260
3,560.2
27,205

Single 10000+ node subtree loaded
Started GET "/report/explorer" for ::1 at 2016-07-12 17:11:49 -0500
Completed 200 OK in 45140ms (Views: 536.8ms | ActiveRecord: 6741.1ms)

ms
bytes
objects
queries
query (ms)
rows

44,799.6
N/A
63,164,707
20,824
16,718.7
47,769

After
No Subtrees
Started GET "/report/explorer" for ::1 at 2016-07-12 16:48:33 -0500
Completed 200 OK in 4085ms (Views: 405.0ms | ActiveRecord: 594.9ms)

ms
bytes
objects
queries
query (ms)
rows

3,959.7
N/A
4,358,944
260
3,558.7
27,205

Single 10000+ node subtree loaded
Started GET "/report/explorer" for ::1 at 2016-07-12 16:55:46 -0500
Completed 200 OK in 18754ms (Views: 618.6ms | ActiveRecord: 730.6ms)

ms
bytes
objects
queries
query (ms)
rows

18,589.5
N/A
42,712,405
260
4,567.4
37,487

A few notes:

The metrics from here are pre #9930, so the All of these metrics will be about 2secs faster, and 20,000ish rows cheaper.
The are the slowest runs after a refresh on each one done in development mode, so some classes and queries should be eager loaded at this point (I think).
The data can be similarly reproduced using miq_seeds (see README.md for setup instructions), and the following seeding in the console:

irb> require 'miq_seeds'
irb> seed_array = [10000, 7000, 6000, [400, 250, 60]*3, [20]*5, [10]*60 ].flatten
irb> MiqSeeds.generate :miq_reports, seed_array

Hopefully this helps answer @Fryguy 's question about risk/reward/ROI.  I tried spiking on doing this by moving the status stuff into the views/presenters, and found it to require a much bigger hammer (lots of things breaking) then just doing the following patch, which falls back to the old way of doing things when human status on MiqReportResult doesn't work (not using ::with_task_status_and_state).
diff --git a/app/models/miq_report_result.rb b/app/models/miq_report_result.rb
index 96d6404..2a964f4 100644
--- a/app/models/miq_report_result.rb
+++ b/app/models/miq_report_result.rb
@@ -1,5 +1,6 @@
 class MiqReportResult < ApplicationRecord
   include_concern 'Purging'
+  include HumanStatus

   belongs_to :miq_report
   belongs_to :miq_group
@@ -16,6 +17,9 @@ class MiqReportResult < ApplicationRecord

   virtual_has_one :result_set,           :class_name => "Hash"

+  self.status_attribute = 'task_status'
+  self.state_attribute  = 'task_state'
+
   before_save do
     user_info = userid.to_s.split("|")
     if user_info.length == 1
@@ -31,7 +35,11 @@ class MiqReportResult < ApplicationRecord
   end

   def status
-    miq_task.nil? ? "Unknown" : miq_task.human_status
+    if miq_task_id.nil?
+      "Unknown"
+    else
+      (human_status rescue nil) || miq_task.human_status
+    end
   end

   def status_message
@@ -286,6 +294,22 @@ class MiqReportResult < ApplicationRecord
     result_type.to_sym == :html ? html_rows : report_results
   end

+  # Attempt to get the associated MiqTask status and state as an aliased column
+  # of task_status and task_state respectively
+  def self.with_task_status_and_state
+    tasks_table = MiqTask.arel_table
+
+    select(
+      arel_table[Arel.star],
+      tasks_table[:status].as('task_status'),
+      tasks_table[:state].as('task_state')
+    ).joins(
+      arel_table.join(tasks_table, Arel::Nodes::OuterJoin)
+                .on(arel_table[:miq_task_id].eq(tasks_table[:id]))
+                .join_sources
+    )
+  end
+
   def self.counts_by_userid
     where("userid NOT LIKE 'widget%'").select("userid, COUNT(id) as count").group("userid")
       .collect { |rr| {:userid => rr.userid, :count => rr.count.to_i} }
diff --git a/app/models/miq_task.rb b/app/models/miq_task.rb
index dedd8a1..f43fda2 100644
--- a/app/models/miq_task.rb
+++ b/app/models/miq_task.rb
@@ -1,15 +1,7 @@
 class MiqTask < ApplicationRecord
+  include HumanStatus
+
   serialize :context_data
-  STATE_INITIALIZED = 'Initialized'.freeze
-  STATE_QUEUED      = 'Queued'.freeze
-  STATE_ACTIVE      = 'Active'.freeze
-  STATE_FINISHED    = 'Finished'.freeze
-
-  STATUS_OK         = 'Ok'.freeze
-  STATUS_WARNING    = 'Warn'.freeze
-  STATUS_ERROR      = 'Error'.freeze
-  STATUS_TIMEOUT    = 'Timeout'.freeze
-  STATUS_EXPIRED    = 'Expired'.freeze
   validates_inclusion_of :state,  :in => [STATE_INITIALIZED, STATE_QUEUED, STATE_ACTIVE, STATE_FINISHED]
   validates_inclusion_of :status, :in => [STATUS_OK, STATUS_WARNING, STATUS_ERROR, STATUS_TIMEOUT]

@@ -138,23 +130,6 @@ class MiqTask < ApplicationRecord
     update_attributes(:state => STATE_FINISHED)
   end

-  def human_status
-    case state
-    when STATE_INITIALIZED then "Initialized"
-    when STATE_QUEUED      then "Queued"
-    when STATE_ACTIVE      then "Running"
-    when STATE_FINISHED
-      case status
-      when STATUS_OK      then "Complete"
-      when STATUS_WARNING then "Finished with Warnings"
-      when STATUS_ERROR   then "Error"
-      when STATUS_TIMEOUT then "Timed Out"
-      else raise _("Unknown status of: %{task_status}") % {:task_status => status.inspect}
-      end
-    else raise _("Unknown state of: %{task_status}") % {:task_status => state.inspect}
-    end
-  end
-
   def results_ready?
     status == STATUS_OK && !task_results.blank?
   end
diff --git a/app/presenters/tree_builder_report_saved_reports.rb b/app/presenters/tree_builder_report_saved_reports.rb
index c4e0271..769bd74 100644
--- a/app/presenters/tree_builder_report_saved_reports.rb
+++ b/app/presenters/tree_builder_report_saved_reports.rb
@@ -36,7 +36,9 @@ class TreeBuilderReportSavedReports < TreeBuilderReportReportsClass
   end

   def x_get_tree_custom_kids(object, count_only, _options)
-    scope = MiqReportResult.with_current_user_groups_and_report(from_cid(object[:id].split('-').last))
+    report_id = from_cid(object[:id].split('-').last)
+    scope = MiqReportResult.with_current_user_groups_and_report(report_id)
+                           .with_task_status_and_state
     count_only ? scope.size : scope.order("last_run_on DESC").to_a
   end
 end

Alternative solutions or ideas welcome.  Comment when available.
/cc @kbrock

Basically covered by https://github.com/ManageIQ/manageiq/pull/11554, so closing


Cleaning Lady List Site

[x] domain - cleaningladylist.com
[x] Database structure
[ ] Refactor progress functionality
[ ] Login / Register
[x] Cleaning Lady list Form
[ ] Deployment -> Digital Ocean -> Docker - @TomasVotruba
[ ] Deployment automation - @TomasVotruba

Later

[ ] Generating badges (verified)
[ ] EasyAdmin - @TomasVotruba

Any works I can help on this TODO :)?

Hi, thanks for the offer!
Our main goal is to publish website online now, like we have for https://github.com/rectorphp/getrector.org
Currently I'm strugling with Docker deploy. If you check the failing CI on master, the first 2 workflows are failing for some reason. Could you help to make it green?

Hi, thanks for the offer!
Our main goal is to publish website online now, like we have for https://github.com/rectorphp/getrector.org
Currently I'm strugling with Docker deploy. If you check the failing CI on master, the first 2 workflows are failing for some reason. Could you help to make it green?

Sure. I will look at that and make PR :).

So little update. Deploy is now finished thanks to 1:1 mentoring with @JanMikes .
Took us 30 minutes to get it done. There were also wrong secret keys with SSH deploy and Docker build

Closing as MVP is done :+1:

🎉