ionic 4: Blank screen in simulator when using http-native

Ionic version:  (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[ ] 3.x
[x] 4.x
I'm submitting a ...  (check one with "x")
[x] bug report
[ ] feature request
Current behavior:
I'm getting a blank screen when I try to use the http-native.
Expected behavior:
The App should launch properly
Steps to reproduce:

Create a new ionic 4 project, ex: tabs
Follow the steps to add cordova-plugin-advanced-http described here: https://ionicframework.com/docs/native/http/
Launch the app in the simulator: ionic cordova emulate ios -lc
Result: blank screen

Error in Safari console:
TypeError: Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"]) is not a function. (In 'Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"])({ sync: true })', 'Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"])' is an instance of Object)
Related code:
``
import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { HTTP } from '@ionic-native/http';
@Component({
selector: 'app-page-about',
templateUrl: 'about.page.html',
styleUrls: ['about.page.scss']
})
export class AboutPage {
constructor(
private http: HTTP,
private platform: Platform,
) {
console.log('### 1 Vai chamar...');
this.platform.ready().then(() => {
  console.log('### 2 chamou!');
  this.http.get('http://ionic.io', {}, {})
  .then(data => {
    console.log('### 3 resultado:');
    console.log(data.status);
    console.log(data.data); // data received by server
    console.log(data.headers);
  })
  .catch(error => {
    console.log('### 4 babou!');
    console.log(error.status);
    console.log(error.error); // error message as string
    console.log(error.headers);
  });
});

}
}

Other information:
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
li packages: (/usr/local/lib/node_modules)

   @ionic/cli-utils  : 2.0.0-rc.6
   ionic (Ionic CLI) : 4.0.0-rc.6

global packages:

   cordova (Cordova CLI) : 8.0.0

local packages:

   @angular-devkit/core       : 0.6.0
   @angular-devkit/schematics : 0.6.0
   @angular/cli               : 6.0.1
   @ionic/schematics-angular  : 1.0.0-rc.6
   Cordova Platforms          : ios 4.5.4
   Ionic Framework            : @ionic/angular 4.0.0-alpha.7

System:

   Android SDK Tools : 25.2.5
   ios-deploy        : 1.9.2
   ios-sim           : 6.1.2
   NodeJS            : v8.11.2
   npm               : 5.6.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.3.1 Build version 9E501

Environment Variables:

   ANDROID_HOME : /usr/local/opt/android-sdk

same

Was this resolved yet? I only receive this error when i use ionic-native/google-plus. When i add google-plus to the constructor i get the same error.
Info:
@ionic/cli-utils  : 2.0.0-rc.6
ionic (Ionic CLI) : 4.0.0-rc.6
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@angular-devkit/core       : 0.6.0
@angular-devkit/schematics : 0.6.0
@angular/cli               : 6.0.1
@ionic/schematics-angular  : 1.0.0-rc.6
Cordova Platforms          : android 7.0.0
Ionic Framework            : @ionic/angular 4.0.0-alpha.7
System:
Android SDK Tools : 26.1.1
NodeJS            : v8.9.4
npm               : 6.1.0
OS                : Windows 10

@wilsolutions
Please add the HTTP in appModule provider...

same issue, adding http to provider still show same error

Uncaught TypeError: Object(...) is not a function
this plugin doesn't have /ngx folder so nothing works. Even Not using but importing makes cause like import { HTTP } from '@ionic-native/http';

Hi,
I have the same issues importing Ionic Firebase....
The project run fine when is empty (no plugin installed)
then just added ionic firebase and I have the same issues.
TypeError: Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"]) is not a function. (In 'Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"])()', 'Object(_ionic_native_core__WEBPACK_IMPORTED_MODULE_1__["Cordova"])' is an instance of Object)
On Chrome the error in console is:
index.js:530 Uncaught TypeError: Object(...) is not a function     at index.js:530     at<EMAIL_ADDRESS>(index.js:747)     at __webpack_require__ (bootstrap:81)     at Object../src/app/app.module.ts (app.component.ts:11)     at __webpack_require__ (bootstrap:81)     at Object../src/main.ts (environment.ts:15)     at __webpack_require__ (bootstrap:81)     at Object.0 (main.ts:12)     at __webpack_require__ (bootstrap:81)     at checkDeferredModules (bootstrap:43)
My Ionic info are:
Ionic:

   ionic (Ionic CLI)          : 4.1.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.3
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.7
   @ionic/schematics-angular  : 1.0.5

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Users/macsinergystudio/Library/Android/sdk)
   ios-deploy        : 2.0.0
   ios-sim           : 7.0.0
   NodeJS            : v8.11.4 (/usr/local/bin/node)
   npm               : 6.4.0
   OS                : macOS High Sierra
   Xcode             : Xcode 9.4.1 Build version 9F2000

I'm getting this error on ionic-native/facebook as well, looking into a solution... Hopefully I won't have to switch back to Ionic v3.

Well I've actually made some progress somehow in the past 6 minutes. Here's what I've discovered thus far:
Upgrading your package.json to be at least 5.0.0-beta.14 on packages like @ionic-native/facebook for example does resolve the error of including it in the file, and removes the Cordova undefined error.
However now I am getting a new error when attempting to pass the provider to the controllers constructor.
Error: Uncaught (in promise): Error: Can't resolve all parameters for HomePage: ([object Object], ?). syntaxError
Will update if I am able to resolve this, I also install ionic-native/core just to be safe incase that makes a difference, and upgraded Cordova to the latest versions.
Example of constructor:
constructor( 		private animationBuilder: AnimationBuilder, 		private fb: Facebook 	){ }

Alright I was able to resolve @ionic-native/facebook based on the following documentation. I'll also provide copies of my app.module.ts, home.page.ts, and package.json files. Please ask me any questions if you have them, and I'll see what I can help with.
App.module.ts:
`import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, RouteReuseStrategy, Routes } from '@angular/router';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { Facebook } from '@ionic-native/facebook/ngx';
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [BrowserModule, BrowserAnimationsModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
Facebook
],
bootstrap: [AppComponent]
})
export class AppModule {}
`
Home.page.ts
`import { Component, ViewChild, ElementRef } from '@angular/core';
import { trigger, state, style, transition, animate, AnimationBuilder, AnimationPlayer } from '@angular/animations';
import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook/ngx';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss']
})
export class HomePage {
@ViewChild('fadeIn') elementRef: ElementRef;
private player: AnimationPlayer;
constructor(
	private animationBuilder: AnimationBuilder,
	private fb: Facebook
){ }

ngAfterContentInit(){
	let self = this;
	setTimeout(function(){ self.startAnimation(); }, 500);
	// this.startAnimation();
}

startAnimation(){
	if (this.player){
		this.player.destroy();
	}

	let animationFactory;

	animationFactory = this.animationBuilder.build([
		style({ opacity: 0 }),
		animate(200, style({ opacity: 1 }))
	]);

	this.player = animationFactory.create(this.elementRef.nativeElement);
	this.player.play();
}

loginWithFacebook(){
	this.fb.login(['email', 'public_profile', 'profile_photo'])
		.then(
			(res: FacebookLoginResponse) => {
				console.log(JSON.stringify(res));
			})
		.catch(e => {
			console.error(e);
		});
}

loginWithGoogle(){

}

}
`
Package.json
{   "name": "CENSORED",   "version": "0.0.1",   "author": "Ionic Framework",   "homepage": "http://ionicframework.com/",   "scripts": {     "ng": "ng",     "start": "ng serve",     "build": "ng build",     "test": "ng test",     "lint": "ng lint",     "e2e": "ng e2e"   },   "private": true,   "dependencies": {     "@angular/animations": "^6.1.3",     "@angular/common": "~6.1.1",     "@angular/core": "~6.1.1",     "@angular/forms": "~6.1.1",     "@angular/http": "~6.1.1",     "@angular/platform-browser": "^6.1.3",     "@angular/platform-browser-dynamic": "~6.1.1",     "@angular/router": "~6.1.1",     "@ionic-native/core": "^5.0.0-beta.15",     "@ionic-native/facebook": "^5.0.0-beta.15",     "@ionic-native/splash-screen": "5.0.0-beta.14",     "@ionic-native/status-bar": "5.0.0-beta.14",     "@ionic/angular": "^4.0.0-beta.6",     "cordova-ios": "4.5.5",     "cordova-plugin-device": "^2.0.2",     "cordova-plugin-facebook4": "^2.3.0",     "cordova-plugin-ionic-keyboard": "^2.1.2",     "cordova-plugin-ionic-webview": "^2.1.0",     "cordova-plugin-splashscreen": "^5.0.2",     "cordova-plugin-statusbar": "^2.4.2",     "cordova-plugin-whitelist": "^1.3.3",     "core-js": "^2.5.3",     "rxjs": "6.2.2",     "zone.js": "^0.8.26"   },   "devDependencies": {     "@angular-devkit/architect": "~0.7.2",     "@angular-devkit/build-angular": "~0.7.2",     "@angular-devkit/core": "~0.7.2",     "@angular-devkit/schematics": "~0.7.2",     "@angular/cli": "6.1.5",     "@angular/compiler": "~6.1.1",     "@angular/compiler-cli": "~6.1.1",     "@angular/language-service": "~6.1.1",     "@ionic/ng-toolkit": "^1.0.0",     "@ionic/schematics-angular": "^1.0.0",     "@types/jasmine": "~2.8.6",     "@types/jasminewd2": "~2.0.3",     "@types/node": "~10.7.1",     "codelyzer": "~4.4.2",     "jasmine-core": "~2.99.1",     "jasmine-spec-reporter": "~4.2.1",     "karma": "~3.0.0",     "karma-chrome-launcher": "~2.2.0",     "karma-coverage-istanbul-reporter": "~2.0.0",     "karma-jasmine": "~1.1.1",     "karma-jasmine-html-reporter": "^0.2.2",     "protractor": "~5.4.0",     "ts-node": "~7.0.0",     "tslint": "~5.11.0",     "typescript": "~2.7.2"   },   "description": "An Ionic project",   "cordova": {     "plugins": {       "cordova-plugin-facebook4": {         "APP_ID": "CENSORED",         "APP_NAME": "CENSORED"       },       "cordova-plugin-whitelist": {},       "cordova-plugin-device": {},       "cordova-plugin-splashscreen": {},       "cordova-plugin-ionic-webview": {},       "cordova-plugin-ionic-keyboard": {},       "cordova-plugin-statusbar": {}     },     "platforms": [       "ios"     ]   } }
TL;DR:
Upgrade package.json to reflect beta ionic-native packages, and use ngx folder when including providers.

Now I've got an issue where it's almost as if Cordova.js is not being loaded, but from what I've been reading that could be an active bug with Ionic's Livereloading running on the emulator not including the file or something.
Going to try it without live reload and see what happens, will update.

Alright, I was able to resolve this issue entirely for my codebase. I'll post a gist in a few hours containing a sample fix, it might not work for all ionic native packages however. Basically they require the beta build of each ionic native module, and must load it into the App Module as an import.

Did you post the gist? I'm having the same problem.

No I didn't get a chance to. I'll create a sample Github repo you can fork. What plugin specifically are you having trouble with?

NFC, Facebook, BarcodeScanner. Basically all the plugins I need. The error is the same:
TypeError: Object(ionic_native_core__WEBPACK_IMPORTED_MODULE_1_["Cordova"]) is not a function. (In 'Object(ionic_native_core__WEBPACK_IMPORTED_MODULE_1_["Cordova"])()', 'Object(ionic_native_core__WEBPACK_IMPORTED_MODULE_1_["Cordova"])' is an instance of Object)

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, RouteReuseStrategy, Routes } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

import { NFC, Ndef, NfcUtil } from '@ionic-native/nfc';
import { Facebook, FacebookLoginResponse } from '@ionic-native/facebook';
import { BarcodeScanner } from '@ionic-native/barcode-scanner';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(),
    AppRoutingModule
  ],
  providers: [
    NFC,
    Facebook,
    BarcodeScanner,
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

{
  "name": "app-beta",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^6.1.6",
    "@angular/core": "^6.1.6",
    "@angular/forms": "^6.1.6",
    "@angular/http": "^6.1.6",
    "@angular/platform-browser": "^6.1.6",
    "@angular/platform-browser-dynamic": "^6.1.6",
    "@angular/router": "^6.1.6",
    "@capacitor/android": "^1.0.0-beta.7",
    "@capacitor/cli": "^1.0.0-beta.7",
    "@capacitor/core": "^1.0.0-beta.7",
    "@capacitor/ios": "^1.0.0-beta.7",
    "@ionic-native/barcode-scanner": "^4.12.2",
    "@ionic-native/core": "5.0.0-beta.15",
    "@ionic-native/facebook": "^4.12.2",
    "@ionic-native/nfc": "^4.12.2",
    "@ionic-native/splash-screen": "5.0.0-beta.15",
    "@ionic-native/status-bar": "5.0.0-beta.15",
    "@ionic/angular": "^4.0.0-beta.7",
    "cordova-plugin-facebook4": "^2.3.0",
    "core-js": "^2.5.3",
    "phonegap-nfc": "^1.0.3",
    "phonegap-plugin-barcodescanner": "^8.0.0",
    "rxjs": "^6.3.1",
    "rxjs-compat": "^6.3.1",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.7.2",
    "@angular-devkit/build-angular": "~0.7.2",
    "@angular-devkit/core": "~0.7.2",
    "@angular-devkit/schematics": "~0.7.2",
    "@angular/cli": "6.1.5",
    "@angular/compiler": "^6.1.6",
    "@angular/compiler-cli": "^6.1.6",
    "@angular/language-service": "^6.1.6",
    "@ionic/ng-toolkit": "^1.0.0",
    "@ionic/schematics-angular": "^1.0.0",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^10.9.4",
    "codelyzer": "~4.4.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.0.3",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~2.9.2"
  },
  "description": "An Ionic project"
}

try using the ngx on all of the imports and make sure you are using beta versions
import { Camera } from '@ionic-native/camera/ngx';

    "@ionic-native/camera": "^5.0.0-beta.15",
    "@ionic-native/core": "^5.0.0-beta.17",

Also another important thing is to import them as a provider in Angular modules before using them in the app

This is related to Cordova Plugin / Ionic Native, so I close this here. If you need support, please use the ionic support forum


how to fix psych engine android error

Describe your problem here.
then i  join any song game give me this

in android
help i ported mod to mobile by myself
i run it in pc and didnt get the problom
Are you modding a build from source or with Lua?
Source
What is your build target?
Windows x64
Did you edit anything in this build? If so, mention or summarize your changes.
i add mobile controls

Android part isn't official.


Native assets support for MacOS and iOS

Support for FFI calls with @Native external functions through Native assets on MacOS and iOS. This enables bundling native code without any build-system boilerplate code.
For more info see:

https://github.com/flutter/flutter/issues/129757

Implementation details for MacOS and iOS.
Dylibs are bundled by (1) making them fat binaries if multiple architectures are targetted, (2) code signing these, and (3) copying them to the frameworks folder. These steps are done manual rather than via CocoaPods. CocoaPods would have done the same steps, but (a) needs the dylibs to be there before the xcodebuild invocation (we could trick it, by having a minimal dylib in the place and replace it during the build process, that works), and (b) can't deal with having no dylibs to be bundled (we'd have to bundle a dummy dylib or include some dummy C code in the build file).
The dylibs are build as a new target inside flutter assemble, as that is the moment we know what build-mode and architecture to target.
The mapping from asset id to dylib-path is passed in to every kernel compilation path. The interesting case is hot-restart where the initial kernel file is compiled by the "inner" flutter assemble, while after hot restart the "outer" flutter run compiled kernel file is pushed to the device. Both kernel files need to contain the mapping. In order to avoid running the dry-run that produces the mapping again in the "inner" invocation. It is passed from the outer to the inner invocation as an xcodeproperty.
The native assets mapping is always included for all target architectures so that we don't have to recompile the kernel if we target another architecture in subsequent flutter assemble runs.
Example vs template
Currently, the PR includes a new template that uses the new native assets in a package and has an app importing that.
Alternatively, we could include these in the examples rather than as a template.
Opinions?
Tests
This PR adds 3 new tests to cover the various use cases.

dev/devicelab/bin/tasks/native_assets_ios.dart

Runs an example app with native assets in all build modes, doing hot reload and hot restart in debug mode.

dev/devicelab/bin/tasks/native_assets_ios_simulator.dart

Runs an example app with native assets, doing hot reload and hot restart.

packages/flutter_tools/test/integration.shard/native_assets_test.dart

Runs (incl hot reload/hot restart), builds, builds frameworks for iOS, MacOS and flutter-tester.

Pre-launch Checklist

[x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
[x] I read the Tree Hygiene wiki page, which explains my responsibilities.
[x] I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
[x] I signed the CLA.
[x] I listed at least one issue that this PR fixes in the description above.
[x] I updated/added relevant documentation (doc comments with ///).
[x] I added new tests to check the change I am making, or this PR is test-exempt.
[x] All existing and new tests are passing.

Thanks @vashworth !
Some high level replies to your questions below.

Question: Is the template meant to be used by users or just added added for the sake of testing?

I'd like either a sample project or a template.
A template is more discoverable than a sample project. I worry that we will push users towards using the old (and when native assets are no longer experimental) FFI plugin template if we don't have a new template.
(A sample project could be in https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli/example, however having the Flutter app also there would mean we cannot unit test it on the CI of that repo.)
Maybe we can somehow get all the benefits of a template without all the machinery? Suggestions?

Seems to be this will only work with Option B for Add to App. Is this going to be a known limitation that you can only use native assets with Add to App if you do Option B?

I wasn't aware of the other options.
Maybe we can make the podhelper.rb also do copying. I had that in an earlier prototype I believe. (Though I'm not so fluent in Ruby so that was crashing when there were no native assets. And it requires us to pass some information somewhere.)

I didn’t see any macOS devicelab tests. Any reason why not? If not, add them?

All the MacOS tests are in test/integration.shard/native_assets_test.dart
Maybe that is the wrong place for tests that run a MacOS application? Should they be in a different place?
Also, currently that test also runs flutter build ios, but it fails on the CI:
02:57 +26 -1: test/integration.shard/native_assets_test.dart: flutter build ios with native assets release [E]
  Exception: flutter build failed: 1
  Error (Xcode): No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "S8QB4VV633" with a private key was found.

Maybe this is also a result of running a test on the wrong shard/bot? Should building ios apps also happen in the iOS device lab instead of on an ordinary MacOS machine?

@dcharkes I looked over the App to App solutions again, and I think it should work with your design actually. Option A adds script phases which call xcode_backend.sh, like a normal flutter project, so your code should be fine.
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/module/ios/library/Flutter.tmpl/podhelper.rb.tmpl#L92-L100
And looking closer at Option C, plugins still need to be embedded manually so the same would be true for native assets, so that also should be fine.
Therefore, I believe all three options should be compatible.
Also, here's an integration tests used in the tool for add to app (Looks like it uses Option A): https://github.com/flutter/flutter/tree/master/dev/integration_tests/ios_add2app_life_cycle
https://github.com/flutter/flutter/blob/5554b0eeb3780d3fac90370d75dc57893733ae71/dev/bots/test.dart#L762-L773
Looks like Option B is only tested by ensuring the frameworks are created and exist (https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart)

Therefore, I believe all three options should be compatible.

Great!

Also, here's an integration tests used in the tool for add to app (Looks like it uses Option A): https://github.com/flutter/flutter/tree/master/dev/integration_tests/ios_add2app_life_cycle

I'm not sure that this test is actually run, as it is broken for me locally. I've filed https://github.com/flutter/flutter/issues/131261 to follow up.

Looks like Option B is only tested by ensuring the frameworks are created and exist (https://github.com/flutter/flutter/blob/master/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart)

The PR has a test similar to that in test/integration.shard/native_assets_test.dart, see expectDylibIsBundledWithFrameworks.

I believe approach (1) might be better, because we'd actually be testing that flutter_tools invokes the dart path/to/some/build.dart of the various packages that have native assets that need to be build. With approach (2) we'd just be returning some boolean or a path to a native_assets.yaml which would not be catching many errors.

With approach (1) we'd have to mock a variety of process calls and create a bunch of files on these process calls (https://github.com/dart-lang/native/issues/90#issuecomment-1651352057). That would make these tests rather involved,  mimicking pub and other tools.
I'm not entirely sure where to put the mock boundary with approach (2). We could wrap both NativeAssetsBuilder and PackageConfig and make mocks for those. But that would also mean these would have to be passed around everywhere or be dependency injected through Environment. Passing around seems like a bad idea. But I also don't see any other examples of dependencies of flutter_tools being dependency injected. Do we have an example of mocking a dependency somewhere in flutter_tools? @stuartmorgan @vashworth.
Without mocking, the unit testing as requested is rather limited:

Add tests to ensure dry run happens in the following tests:

packages/flutter_tools/test/general.shard/ios/mac_test.dart
packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart
packages/flutter_tools/test/general.shard/hot_test.dart

These tests already cover the paths where there are no native assets, and all the extra code (a path to a yaml, a xcode property etc.) is null in that case.

Also, add unit tests for

packages/flutter_tools/lib/src/build_system/targets/native_assets.dart
packages/flutter_tools/lib/src/ios/native_assets.dart
packages/flutter_tools/lib/src/macos/native_assets.dart

I've added unit tests for these, but they can only unit test the behavior that does not actually invoke the package:native_assets_builder dependency, so the unit tests are rather limited.  (The integration tests for MacOS and iOS should cover all this behavior.)
For the add2app test alternative I've run into another existing issue. https://github.com/flutter/flutter/issues/112033
The three remaining things before this PR can be merged:

Unit tests - Blocked by how to mock package:native_assets_builder. I need some guidance/example of how to do this in flutter_tools.
Add2app integration test actually exercising the bundled libraries - blocked by https://github.com/flutter/flutter/issues/112033 and https://github.com/flutter/flutter/issues/80807. I'm not sure I know how to make progress here.
Code formatting - I'd rather do this as the final step.

I'm not entirely sure where to put the mock boundary with approach (2). We could wrap both NativeAssetsBuilder and PackageConfig and make mocks for those. But that would also mean these would have to be passed around everywhere or be dependency injected through Environment. Passing around seems like a bad idea. But I also don't see any other examples of dependencies of flutter_tools being dependency injected. Do we have an example of mocking a dependency somewhere in flutter_tools?

I'm not sure of any examples of mocking a dependency. @christopherfujino Do you know of any?

Add tests to ensure dry run happens in the following tests:
packages/flutter_tools/test/general.shard/ios/mac_test.dart
packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart
packages/flutter_tools/test/general.shard/hot_test.dart

What does dry-run mean in this context @vashworth? Tests which run with the memory file system and mock process run?
I believe I would need to either (1) address dart-lang/native#90, or (2) make the code in packages/flutter_tools/lib/src/macos/native_assets.dart and packages/flutter_tools/lib/src/ios/native_assets.dart sit inside a class, and create mocks for that class and add that class as a field to class BuildCommand and a bunch of other places.

Could we create a fake NativeAssetsBuildRunner that we pass to the command?
Also, I think you should create a wrapper class anyway that you pass in the logger, processManager, and fileSystem, so that for tests we can pass test instances. We're migrating the codebase off of using any more globals.* getters, and introducing new invocations is not allowed.

Add tests to ensure dry run happens in the following tests:
packages/flutter_tools/test/general.shard/ios/mac_test.dart
packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart
packages/flutter_tools/test/general.shard/hot_test.dart

What does dry-run mean in this context @vashworth? Tests which run with the memory file system and mock process run?
I believe I would need to either (1) address dart-lang/native#90, or (2) make the code in packages/flutter_tools/lib/src/macos/native_assets.dart and packages/flutter_tools/lib/src/ios/native_assets.dart sit inside a class, and create mocks for that class and add that class as a field to class BuildCommand and a bunch of other places.

Could we create a fake NativeAssetsBuildRunner that we pass to the command?
Also, I think you should create a wrapper class anyway that you pass in the logger, processManager, and fileSystem, so that for tests we can pass test instances. We're migrating the codebase off of using any more globals.* getters, and introducing new invocations is not allowed.

Okay, I'll give this a spin tomorrow. It does mean we have to add a NativeAssetsBuildRunner to every class/function (e.g. all the Commands for example) from main and where we pass it in tests and we want to exercise the mock. Without some kind of dependency injection (a la globals) that might be a lot of threading.
Thinking of it, the FakeResidentCompiler is a mock of an external dependency. This one is passed as a field of FlutterDevice.

Could we create a fake NativeAssetsBuildRunner that we pass to the command?
Also, I think you should create a wrapper class anyway that you pass in the logger, processManager, and fileSystem, so that for tests we can pass test instances. We're migrating the codebase off of using any more globals.* getters, and introducing new invocations is not allowed.

Done. This is a bit verbose though adding fields and arguments in methods/constructor calls. @christopherfujino is this the preferred way of doing this?
This does not enable testing the NativeAssets Target. The targets all have const constructors and all use the dependency injection through globals. The documentation on Target reads:
/// ## Unit testing
///
/// Most targets will invoke an external binary which makes unit testing
/// trickier. It is recommend that for unit testing that a Fake is used and
/// provided via the dependency injection system. a [Testbed] may be used to
/// set up the environment before the test is run. Unit tests should fully
/// exercise the rule, ensuring that the existing input and output verification
/// logic can run, as well as verifying it correctly handles provided defines
/// and meets any additional contracts present in the target.

If I'm not mistaken the only way to use those overrides from a context are through globals such as ProcessManager get processManager => context.get<ProcessManager>() ?? _kLocalProcessManager;. Any suggestions @christopherfujino on how to add unit tests for a target that needs to mock its dependencies?

packages/flutter_tools/test/general.shard/ios/mac_test.dart

I believe the tests should be in test/commands.shard/hermetic/build_ios_test.dart instead, no invocations of buildXcodeProject are tested in packages/flutter_tools/test/general.shard/ios/mac_test.dart. I've added a test in test/commands.shard/hermetic/build_ios_test.dart.

packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart

Done.

packages/flutter_tools/test/general.shard/hot_test.dart

I could only figure out how to do a hot restart in here. run isn't implemented in the fake
I also tried add a test to test/general.shard/resident_runner_test.dart (another place where HotRunner is constructed and run). I could only figure out how to run. For restart and reload I can't figure out what the fakeVmServiceHost expects. Maybe this test has the wrong fakes for just testing native assets. @vashworth what exactly would you like to seen unit tested for the hot runner? Is there already a similar test?

Also, add unit tests for
packages/flutter_tools/lib/src/build_system/targets/native_assets.dart

See discussion above about dependency injection.

packages/flutter_tools/lib/src/ios/native_assets.dart
packages/flutter_tools/lib/src/macos/native_assets.dart

Done.

@dcharkes If you want to try and add this, you can go for it. Alternatively, it looks like ios_host_app is also an Add to App integration test (used in module_test_ios.dart). Perhaps use that?

Originally posted in https://github.com/flutter/flutter/issues/131261#issuecomment-1650058595
It seems that we lose the NATIVE_ASSETS env var setting the path to native_assets.yaml for the kernel compilation in Build iOS Objective-C host app. This is seen by the flutter assemble call having -dNativeAssets=  and no NATIVE_ASSETS = ... in the preceding lines. It looks like there is no xcconfig because the  PACKAGE_CONFIG =  in the log lines of these non-flutter originated invocations is missing (which is ones of the other defines in the xcconfig file). Is it a constraint for add2app that it should work without our generated xcconfig? @vashworth

@dcharkes I looked over the App to App solutions again, and I think it should work with your design actually. Option A adds script phases which call xcode_backend.sh, like a normal flutter project, so your code should be fine.

It doesn't seem entirely true. I believe there is no xcconfig which would set the right environment variables.
If we can't pass information through xcconfig, we have some options:

Do a dry-run invocation inside KernelSnapshot to produce a native_assets.yaml there. The downdside of this is that a flutter run invocation will now do a dry run both in the "outer" run and "inner" assemble invocation. Also it does a non-dry-run in the "inner" invocation.
1.b. In addition keep passing native_assets.yaml in the xcconfig, and skip running in the KernelSnapshot if we already have one. (This requires us to pass an empty native_assets.yaml in projects without any native assets, instead of no native_assets.yaml that we do now.)
Make the KernelSnapshot target depend on the NativeAssets target and use the non-dry-run native_assets.yaml. The downside of this is that now KernelSnapshot caching doesn't work anymore. NativeAssets targets don't have caching.

I also tried add a test to test/general.shard/resident_runner_test.dart (another place where HotRunner is constructed and run). I could only figure out how to run. For restart and reload I can't figure out what the fakeVmServiceHost expects. Maybe this test has the wrong fakes for just testing native assets. @vashworth what exactly would you like to seen unit tested for the hot runner? Is there already a similar test?

Yeah, looks like resident_runner_test.dart is the right place. I was thinking test to ensure it's called and throws errors when expected. Looks like you already added a test that ensures it's called, but still need tests for when errors are thrown.

Is it a constraint for add2app that it should work without our generated xcconfig?

Oof, yes, add2app doesn't use a generated xcconfig.

Do a dry-run invocation inside KernelSnapshot to produce a native_assets.yaml there.

So I'm a little confused. With add2app (Option A), there is no "outer" run. Apps are built and run through Xcode. There is only the "inner" assemble command. I'm I misunderstanding something?
Perhaps, in the "inner" assemble command, if NATIVE_ASSETS is not provided, it's does a dry run and non-dry-run if applicable? And then for non-add2app scenarios, we always set NATIVE_ASSETS in the xcconfig and if there are none, we set to the a value like FALSE or NA and skip if it's that value.

Edit: A second issue seems to be that flutter clean removes the build folder

How does flutter clean come into play?

Edit: A second issue seems to be that flutter clean removes the build folder

How does flutter clean come into play?

That is the location the native_assets.yaml was in. So it's both deleted and the path is not being passed through xcconfig.

Is it a constraint for add2app that it should work without our generated xcconfig?

Oof, yes, add2app doesn't use a generated xcconfig.

Gotcha, yet another requirement gathered. 🙊

Do a dry-run invocation inside KernelSnapshot to produce a native_assets.yaml there.

So I'm a little confused. With add2app (Option A), there is no "outer" run. Apps are built and run through Xcode/Cocoapods. There is only the "inner" assemble command. Am I misunderstanding something?

Correct, we only have an "inner" assemble command.

Perhaps, in the "inner" assemble command, if NATIVE_ASSETS is not provided, it's does a dry run and non-dry-run if applicable? And then for non-add2app scenarios, we always set NATIVE_ASSETS in the xcconfig and if there are none, we set to the a value like FALSE or NA and skip if it's that value.

The approach I'm working on right now is

Make the KernelSnapshot target depend on the NativeAssets target and use the non-dry-run native_assets.yaml. The downside of this is that now KernelSnapshot caching doesn't work anymore. NativeAssets targets don't have caching.

This seems to work as intended almost all tests pass. As you can see in the latest failures on the CI there's one thing not working. Build caching does no longer work because the NativeAssets target hasn't implemented that.
I believe the right solution is to write out a deps file with the files that were read during compilation of native assets, so that the Flutter build system can skip the NativeAssets target if none of the files were changed. We already have tracking of which files were read during builds, but we need to make this list of files available to flutter_tools (https://github.com/dart-lang/native/issues/105).

@stuartmorgan @vashworth
The caching test seems to fail on the CI:
▌06:54:32▐ Testing macOS cache for dev/integration_tests/flutter_gallery...
RUNNING: cd dev/integration_tests/flutter_gallery; ../../../bin/flutter build macos --performance-measurement-file=perf.json --debug -v
[...]
ELAPSED TIME: 6.085s for ../../../bin/flutter build macos --performance-measurement-file=perf.json --debug -v in dev/integration_tests/flutter_gallery
╔═╡ERROR╞═══════════════════════════════════════════════════════════════════════
║ Not all build targets cached after second run.
║ The target performance data was: {"targets":[{"name":"gen_localizations","skipped":true,"succeeded":true,"elapsedMilliseconds":0},
║ {"name":"gen_dart_plugin_registrant","skipped":true,"succeeded":true,"elapsedMilliseconds":0},
║ {"name":"debug_macos_framework","skipped":true,"succeeded":true,"elapsedMilliseconds":0},
║ {"name":"debug_unpack_macos","skipped":true,"succeeded":true,"elapsedMilliseconds":263},
║ {"name":"native_assets","skipped":false,"succeeded":true,"elapsedMilliseconds":282},
║ {"name":"kernel_snapshot","skipped":false,"succeeded":true,"elapsedMilliseconds":1205},
║ {"name":"debug_macos_bundle_flutter_assets","skipped":true,"succeeded":true,"elapsedMilliseconds":658}]}
╚═══════════════════════════════════════════════════════════════════════════════

full log
However, locally these tests succeed:
$ cd /Users/dacoharkes/flt/engine/flutter  && SHARD=build_tests SUBSHARD=18_24 dart dev/bots/test.dart
▌11:01:05▐ STARTING ANALYSIS
▌11:01:05▐ SHARD=build_tests
▌11:01:05▐ SUBSHARD=18_24
▌11:01:05▐ Testing APK debug build for dev/integration_tests/flutter_gallery...
▌11:01:25▐ Testing APK cache for dev/integration_tests/flutter_gallery...
▌11:01:35▐ Testing APK release build for dev/integration_tests/flutter_gallery...
▌11:02:17▐ Testing APK cache for dev/integration_tests/flutter_gallery...
▌11:02:27▐ Testing IPA debug build for dev/integration_tests/flutter_gallery...
▌11:02:59▐ Testing IPA cache for dev/integration_tests/flutter_gallery...
▌11:03:07▐ Testing IPA release build for dev/integration_tests/flutter_gallery...
▌11:03:42▐ Testing IPA cache for dev/integration_tests/flutter_gallery...
▌11:03:49▐ Testing macOS debug build for dev/integration_tests/flutter_gallery...
▌11:04:15▐ Testing macOS cache for dev/integration_tests/flutter_gallery...
▌11:04:22▐ Testing macOS release build for dev/integration_tests/flutter_gallery...
▌11:05:06▐ Testing macOS cache for dev/integration_tests/flutter_gallery...
▌11:05:13▐ Test successful.

Any ideas or suggestions?

Add2app is now also fully supported and tested. (Using the native_assets.yaml that is created inside flutter assemble.) This also removed a bunch of code for flutter build because it now doesn't have to know about native assets at all. Only the backend flutter assemble+wrapper scripts and flutter run (for hot restart support) need to know about native assets. @vashworth could you review the PR again?

friendly ping @christopherfujino @vashworth @stuartmorgan

Have you looked into how to fix with G3 yet?

@iinozemtsev was so kind to make one! cl/563109654
I've added it in the FROB UI, but I didn't see anything happening. Should it show up in the UI?

Have you looked into how to fix with G3 yet?

@iinozemtsev was so kind to make one! cl/563109654 I've added it in the FROB UI, but I didn't see anything happening. Should it show up in the UI?

I see it in the FROB UI now, let's see if it passes this time

Have you looked into how to fix with G3 yet?

@iinozemtsev was so kind to make one! cl/563109654 I've added it in the FROB UI, but I didn't see anything happening. Should it show up in the UI?

I see it in the FROB UI now, let's see if it passes this time

UnusedValueUtils.kt:433:42: error: cannot find a parameter with this name: allowErrorTypes
        samType.asPsiType(psiTypeParent, allowErrorTypes = true) as? PsiClassType

The g3 error seems unrelated.

@vashworth Should the google testing take 2 hours to run?

@vashworth Should the google testing take 2 hours to run?

In FRoB, it says "Rebase required" - I've never seen that before but maybe try rebasing?

I would usually think that merging is not rebasing. I can try to just squash all commits, rebase on master as single commit and force push to "rebase". (But I believe force pushing to PRs under review is frowned upon as the diff is no longer visible.)

G3Fix failed to apply

cl/563109654 probably needs to be rebased as well.

I would usually think that merging is not rebasing. I can try to just squash all commits, rebase on master as single commit and force push to "rebase". (But I believe force pushing to PRs under review is frowned upon as the diff is no longer visible.)

You're right they're different, but in terms of FRoB, the difference doesn't matter.

Woohoo, all green!
@stuartmorgan waiting on approval from your side.


test trivy-vulnerability-scanner

tests are failing due to https://github.com/wmo-im/wis2box/issues/798


Overhead door compatability

I have a overhead door legacy 850 model 2029 and wondering if this would be compatible with that unit. I am not finding much online about it.
Thanks

Skimming the manual at https://www.overheaddoor.com/garage-door-opener-legacy-850 doesn't mention "Security+" at all.
Does the wall panel work as a simple dry-contact? What happens if you disconnect the wall panel and just short the wires - does that operate the garage door?
What voltage is there between the wires to the wall panel? What voltage on the wires to the obstruction sensors (when clean and when obstructed)?

It is not dry contact. I am not sure what the voltages are but I sure check.

I've done a fair bit of work recently on coding Arduinos for detecting pulse based serial data.  If yours has some kind of digital signal, especially if not encrypted, I think we can work on adding to the code base for ESPHome-ratgdo to support it.

This might be a long shot but is there something I can test here? I have no idea really what im doing when it comes to garage doors but im willing to give something a try and assist in anyway i can to get something working.

Closing due to lack of updates.


⚠ Bofrost.de has degraded performance

In 2cd3f24, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 1080 ms

Resolved: Bofrost.de performance has improved in e408b7f after 6 minutes.


Constant parameter type enums

The Tw2Variable prototype RegisterType is currently passed a number by Tw2Effects when BindParameters is called and there is an auto registered stage parameter. This Tw2Variable prototype however currently expects a tw2 parameter's constructor.
I've not seen any auto registered parameters so this is either redundant, or we're missing some enums.
Tw2Effect.prototype.BindParameters
...
 else if (constant.isAutoregister)
{
    // TODO: contant.type is a float, not a string..
    variableStore.RegisterType(name, constant.type);
    let param = variableStore._variables[name];
    let p = {};
    p.parameter = param;
    p.constantBuffer = stage.constantBuffer;
    p.offset = constant.offset;
    p.size = constant.size;
    stage.parameters.push(p);
}

Current Tw2VariableStore.prototype.RegisterType
/**
 * Registers a variable without a value
 * @param {string} name
 * @param {Function} type
 * @returns {Tw2Parameter}
 * @constructor
 */
Tw2VariableStore.prototype.RegisterType = function(name, type)
{
    return this._variables[name] = new type(name);
};

should be perhaps something like...
/**
 * Registers a variable without a value
 * @param {string} name
 * @param {number|Function} type
 * @returns {Tw2Parameter|null}
 */
Tw2VariableStore.prototype.RegisterType = function(name, type)
{
    if (type instanceof Number)
    {
        if (type in Tw2VariableStore.ConstantType)
        {
            return this._variables[name] = new  Tw2VariableStore.ConstantType[type](name);
        }
    }
    else if (type instanceof Function)
    {
        return this._variables[name] = new type(name);
    }
};

Hi
This code path is definitely not used. It was something for CQs. Although it may be used in the future. I'll clean it up when I have time.

Pretty sure this only causes errors for me, so you can probably safely ignore :P


Issue exposing service using Gateway

Describe the bug
Unable to expose running service using Gateway.  Want all the incoming traffic to be directed to the service by name frontend
As you can see in the list below I have service by name front-end running in the istio-system namespace.
$ kubectl get svc  -n istio-system
NAME                       TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                                                               AGE
backend                    ClusterIP      <IP_ADDRESS>   <none>           80/TCP                                                                5h
frontend                   ClusterIP      <IP_ADDRESS>    <none>           80/TCP                                                                5h
grafana                    ClusterIP      <IP_ADDRESS>   <none>           3000/TCP                                                              7d
istio-citadel              ClusterIP      <IP_ADDRESS>    <none>           8060/TCP,9093/TCP                                                     7d
istio-egressgateway        ClusterIP      <IP_ADDRESS>   <none>           80/TCP,443/TCP                                                        7d
istio-ingress              LoadBalancer   <IP_ADDRESS>   xx.xxx.9x.2x     80:32000/TCP,443:31999/TCP                                            7d
istio-ingressgateway       LoadBalancer   <IP_ADDRESS>    xx.xxx.1xx.1xx  80:31380/TCP,443:31390/TCP,31400:31400/TCP                            7d
istio-pilot                ClusterIP      <IP_ADDRESS>     <none>           15003/TCP,15005/TCP,15007/TCP,15010/TCP,15011/TCP,8080/TCP,9093/TCP   7d
istio-policy               ClusterIP      <IP_ADDRESS>   <none>           9091/TCP,15004/TCP,9093/TCP                                           7d
istio-sidecar-injector     ClusterIP      <IP_ADDRESS>   <none>           443/TCP                                                               7d
istio-statsd-prom-bridge   ClusterIP      <IP_ADDRESS>   <none>           9102/TCP,9125/UDP                                                     7d
istio-telemetry            ClusterIP      <IP_ADDRESS>   <none>           9091/TCP,15004/TCP,9093/TCP,42422/TCP                                 7d
prometheus                 ClusterIP      <IP_ADDRESS>     <none>           9090/TCP                                                              7d
servicegraph               ClusterIP      <IP_ADDRESS>    <none>           8088/TCP                                                              7d
tracing                    LoadBalancer   <IP_ADDRESS>   3x.2xx.xxx.xx   80:32700/TCP                                                          7d
zipkin                     ClusterIP      <IP_ADDRESS>    <none>           9411/TCP                                                              7d

The frontend service (Nginx serving web pages) is running and its healthy,  I verified using the port-forwarding of the service directly and then accessing it,
kubectl port-forward --namespace istio-system $(kubectl get pod --namespace istio-system --selector="app=frontend" --output jsonpath='{.items[0].metadata.name}') 8080:80

Here is the gateway configuration I've used,
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: my-gateway
spec:
  selector:
    istio: ingressgateway # use Istio default gateway implementation
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: frontend
spec:
  hosts:
  - "*"
  gateways:
  - my-gateway
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        port:
          number: 80
        host: frontend.istio-system.svc.cluster.local

Here is the yaml config for the front-end service,
apiVersion: v1
kind: Service
metadata:
  name: frontend
  labels:
    app: frontend
spec:
  selector:
    app: frontend
  ports:
  - port: 80
    targetPort: 80
    name: http
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: frontend
spec:
  selector:
    matchLabels:
      app: frontend
      tier: frontend
      track: stable
  replicas: 1
  template:
    metadata:
      labels:
        app: frontend
        tier: frontend
        track: stable
    spec:
      containers:
      - name: nginx
        image: "gcr.io/my-project/container:test"
        lifecycle:
          preStop:
            exec:
              command: ["/usr/sbin/nginx","-s","quit"]

Expected behavior
The Gateway to give access to the frontend service.
Steps to reproduce the bug
Use the configs above to reproduce.
Version
istio version: 0.8.0
Kubernetes version: v1.9.7-gke.3
Is Istio Auth enabled or not?
Auth not enabled
Environment
GKE

It'll be great if anyone could help me know whether my config's are right.

i am unsure about * hosts, have you tried hardcoding the host from which you expect the request?

@nmnellis : In this httpbin config https://istio.io/docs/tasks/traffic-management/ingress/ , they've used * for hosts.

ok the second thing to try is to exec onto the ingress gateway and do some local debugging,
kubectl exec -it -n istio-system <INGRESS_GATEWAY_POD> bash

# test endpoint
curl "localhost:80/status/200"

# view envoy configuration
curl "localhost:15000/config_dump" > config.json

In the envoy dump you should see your listener on 80 for *, you should also see your front-end application in the "clusters" section. In the routes section you should see / going to your front-end cluster


Enhance BuildRun CRD instance Status

Idea:
The current BuildRun CRD Status is depending on the tekton task .Status.Conditions.Reason for displaying whats the BuildRun status. A potential problem is that our CRD Status is then limited to only two values "Ready" and "Succeeded".
Solution:
It would be a good enhancement to actually leverage the failure status of the BuildRun with the error coming from the task generation, with this, we could then have for status the following values:

Ready if the CRD instance generate the tekton task
Customize error for a CRD instance where the tekton task failed.

This is coming from discussions with @zhangtbj

@zhangtbj I just realized the above is not true, actually the BuildRun is already inheriting the TaskRun status, for example:
$ kubectl -n build-examples get taskrun

NAME                              SUCCEEDED   REASON           STARTTIME   COMPLETIONTIME
buildpack-nodejs-buildrun-ndxqv   False       CouldntGetTask   4m46s

$ kubectl -n build-examples get buildrun
NAME                        SUCCEEDED   REASON           STARTTIME   COMPLETIONTIME
buildpack-nodejs-buildrun   False       CouldntGetTask   5m16s

can you add more comments on what would be the enhancement you have in mind?

Yes @qu1queee ,
But the end user cannot know what is wrong with our build from: this CouldntGetTask, in our system, we don't allow end user to view the taskrun status or description. So they don't know what they can do next.
I like the status like Build now:
xubin-test        example-build-kaniko                     False        none ClusterBuildStrategies found   ClusterBuildStrategy   kaniko              37s

The end user can know the exact reason directly, like generate task fail? clone git fail or push image fail.
I know it is hard to extract this kind of info from taskrun, But I think we can think about anddiscuss it first.

@zhangtbj yes, so im currently investigating this, I think indeed there is room for improvement.
For the Build is simple, while the REASON is just the errors that we throw when Build referenced resources validations failed. For the BuildRun is more complicated because we heavily rely on the TaskRun from Tekton.
However, I think we should not use the .Status.Conditions[].Reason of the TaskRun but rather the .Status.Conditions[].Message. The Message contains actually very good information on what step failed in the TaskRun or if all Tasks are running, see:
# A healthy TaskRun
$ kubectl -n build-examples get taskrun kaniko-golang-buildrun-fswg6
NAME                           SUCCEEDED   REASON      STARTTIME   COMPLETIONTIME
kaniko-golang-buildrun-fswg6   True        Succeeded   7m57s       4m45s
$ kubectl -n build-examples get taskrun kaniko-golang-buildrun-fswg6 -o json | jq .status.conditions[].message
"All Steps have completed executing"

# A failing TaskRun
$ kubectl -n build-examples get taskrun
NAME                           SUCCEEDED   REASON   STARTTIME   COMPLETIONTIME
kaniko-golang-buildrun-5pbkd   False       Failed   30s         21s
$ kubectl -n build-examples get taskrun kaniko-golang-buildrun-5pbkd -o json | jq .status.conditions[].message
"\"step-step-build-and-push\" exited with code 1 (image: \"gcr.io/kaniko-project/executor@sha256:66be3f60f22b571faa82e0aaeb94731217ba0c58ac4a3b062bc84c6d8d545213\"); for logs run: kubectl -n build-examples logs kaniko-golang-buildrun-5pbkd-pod-qf2gd -c step-step-build-and-push"

Opinions?

Yes, it is better.
But I think all of failure messages are xxx exited with code 1; for logs run: kubectl -n build-examples logs xxx
I have two concern:

It is too long if we show it in the command directly
It is also doesn't valuable for end user

I think we can investigate more, I can also help try more.
I am not sure if we can analyze the logs of the build pod and get the exact error.
Such as this one from my fail build pod:
error building image: error building stage: failed to execute command: starting command: fork/exec /bin/sh: operation not permitted
I think we or end user can know what is wrong directly.

FYI @qu1queee and @sbose78 ,
I think we can follow what I did in the PR: https://github.com/redhat-developer/build/pull/105
To update the buildRun SUCCEEDED and REASON for the basic failure in BuildRun controller logic, the result like this:
kubectl get br
NAME                        SUCCEEDED   REASON                                 STARTTIME   COMPLETIONTIME
buildpack-nodejs-buildrun   False       ServiceAccount "pipeline2" not found   23s

If then, we can show many failures, like:

fail to get taskrun
fail to retrieve sa
fail to retrieve build strategy
fail to SetControllerReference
fail to generate taskrun
fail to run taskrun

For the latest fail to run taskrun, I think we can just tell end user Failed to execute the TaskRun and don't analyze/show the detail error in taskrun. Then let admin help to check the error for end-user first.
If future, if we have enough time, we may can have the phase 2 to improve the failure for the taskrun execution.

@zhangtbj The list above looks good!

For example, this is the error message from my fail build pod by using kubectl -n build-examples logs xxx:
error building image: error building stage: failed to execute command: starting command: fork/exec /bin/sh: operation not permitted
I think we or end user can know what is wrong directly.

Yes this is the level of details our BuildRun status should have! In other words, the user should not have to navigate to multiple CRs to find out what's wrong.

If future, if we have enough time, we may can have the phase 2 to improve the failure for the taskrun execution.

This is going to be a continuous process, nevertheless we should identity key areas where we have ourselves faced issues, and ensure such areas are covered by good error messages.

Agree. This failure handle is also a high priority in this month for us.

I prefer to achieve the above basic failure list so that end user can know the basic failure first.

Then let us create another new issue to cover the another kind of failure: the level of details our BuildRun . I think we need a special func to analyze/support that. :)

If I understand correctly, we are fine using the TaskRun Message rather than the Reason, because of the verbosity it gives. Great!

@zhangtbj afaik this is done, pls close this


Double period issue with SES's SendRawEmail and dot-stuffing

To send an email through the SES SDK with an attachment, you must use the SendRawEmail function (can we please make this more developer-friendly in a future version??). In order to do so, you either hand-code a MIME message or rather convert a System.Net.Mail.MailMessage object to a MemoryStream. This has all been working fine, but I've encountered an issue. After much digging, I've been able to find the problem and replicate it, and it seems to be a by-product of SMTP dot-stuffing.
The issue is that in certain scenarios, when the MailMessage is converted to a raw MIME message, if a period in the message body is wrapped to the beginning of a line in the raw message then it is dot-stuffed (properly I assume). However, it doesn't seem to be handled either inside the SDK or on the SES side of things because the email comes through with double periods. This can be replicated via the following example console app code...
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Reflection;
using System.Text;
using Amazon;
using Amazon.Runtime;
using Amazon.SimpleEmail;
using Amazon.SimpleEmail.Model;
using MimeKit;

namespace SESMimeIssue
{
    class Program
    {
        const string _SESAccessKey = "foo";
        const string _SESSecretKey = "bar";
        const string _fromAddress =<EMAIL_ADDRESS>        const string _toAddress =<EMAIL_ADDRESS>
        static void Main(string[] args)
        {
            var to = new List<string> { _toAddress };
            var subject = "TEST MESSAGE";
            var message = $"This is a carefully crafted HTML email message body such that you should see a single period right here ->. However, you'll see two periods in the email instead of one period like originally given in the code.";

            var body = $"
Hello,

{message}

Sincerely,

Your Tester";

            var attachmentPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Test.txt");
            var result = SendEmail(to, subject, body, new List<string> { attachmentPath }, isHtml: true);
            Console.WriteLine(result ? "Successfully sent message" : "Failed to send message");

            if (Debugger.IsAttached)
            {
                Console.WriteLine("Press any key to continue...");
                Console.ReadLine();
            }
        }

        private static bool SendEmail(List<string> to, string subject, string body, List<string> attachmentFilePaths = null, bool isHtml = false)
        {
            var message = new MailMessage
            {
                From = new MailAddress(_fromAddress),
                Subject = subject,
                Body = body,
                IsBodyHtml = isHtml
            };

            foreach (var address in to)
            {
                message.To.Add(address.Trim());
            }

            if (attachmentFilePaths?.Any() == true)
            {
                foreach (var filePath in attachmentFilePaths)
                {
                    message.Attachments.Add(new Attachment(filePath));
                }
            }

            try
            {
                var creds = new BasicAWSCredentials(_SESAccessKey, _SESSecretKey);
                using (var client = new AmazonSimpleEmailServiceClient(creds, RegionEndpoint.USEast1))
                {
                    // Using this DOESN'T work as it doubles the period
                    var request = new SendRawEmailRequest { RawMessage = new RawMessage { Data = ConvertMailMessageToMemoryStream(message) } };
                    // Using this DOES work
                    //var request = new SendRawEmailRequest { RawMessage = new RawMessage { Data = ConvertMailMessageToMemoryStreamViaMimeKit(message) } };
                    Console.WriteLine($"RawMessage.Data...\r\n\r\n{Encoding.ASCII.GetString(request.RawMessage.Data.ToArray())}");

                    client.SendRawEmail(request);
                    return true;
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine($"AmazonSESHelper.SendEmail => Exception: {ex.Message}");
            }

            return false;
        }

        // From http://stackoverflow.com/questions/29532152/create-mime-mail-with-attachment-for-aws-ses-c-sharp/29533336#29533336
        private static MemoryStream ConvertMailMessageToMemoryStream(MailMessage message)
        {
            var stream = new MemoryStream();
            var assembly = typeof(SmtpClient).Assembly;
            var mailWriterType = assembly.GetType("System.Net.Mail.MailWriter");

            var mailWriterConstructor = mailWriterType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { typeof(Stream) }, null);
            var mailWriter = mailWriterConstructor.Invoke(new object[] { stream });

            var sendMethod = typeof(MailMessage).GetMethod("Send", BindingFlags.Instance | BindingFlags.NonPublic);
            sendMethod.Invoke(message, BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { mailWriter, true, true }, null);

            var closeMethod = mailWriter.GetType().GetMethod("Close", BindingFlags.Instance | BindingFlags.NonPublic);
            closeMethod.Invoke(mailWriter, BindingFlags.Instance | BindingFlags.NonPublic, null, new object[] { }, null);

            return stream;
        }

        private static MemoryStream ConvertMailMessageToMemoryStreamViaMimeKit(MailMessage message)
        {
            var stream = new MemoryStream();
            var mimeMessage = MimeMessage.CreateFromMailMessage(message);
            mimeMessage.WriteTo(stream);
            return stream;
        }
    }
}

The raw MIME message that gets outputted is...
X-Sender<EMAIL_ADDRESS>X-Receiver<EMAIL_ADDRESS>MIME-Version: 1.0
From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Date: 2 Dec 2016 11:45:36 -0500
Subject: TEST MESSAGE
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Hello,

This is a carefully crafted HTML email me=
ssage body such that you should see a single period right here ->=
.. However, you'll see two periods in the email i=
nstead of one period like originally given in the code.

Sincerely,

Your Tester

You can see the dot-stuffing (again, assuming that's proper per SMTP), but it doesn't get un-done after the send as can be seen when I receive the email...

I can get this to work if I add in @jstedfast's MimeKit (which is great) but that adds another dependency in all our apps, which is not my favorite thing to do.
I'm not sure whose problem this actually is...is it the SDK? is it on the SES receiving side? is the System.Net.Mail.MailWriter not supposed to dot-stuff?

The problem is that System.Net.Mail.MailWriter expects to send the message over SMTP which requires byte-stuffing the message as it gets serialized for transport over the TCP socket.
MIME messages saved to disk should not have the byte-stuffing.
There's 2 ways that SES can deal with this / make this easier:

Add a bool property on RawMessage that specifies that the message data has already been byte-stuffed.
Add a RawMessage or SendRawEmail() API that takes a System.Net.Mail.MailMessage object so that it can handle this more easily for developers using System.Net.Mail to construct their messages.

I'm not sure which would be easier for them to do.

Agreed @jstedfast. Thanks for taking the time to give some input. As for your suggestions...

Add a bool property on RawMessage that specifies that the message data has already been byte-stuffed.

I think this one would just confuse developers would have no idea what byte-stuffing/dot-stuffing is (I didn't before this issue). In addition, it would force developers who do know to remember to set this.

Add a RawMessage or SendRawEmail() API that takes a System.Net.Mail.MailMessage object so that it can handle this more easily for developers using System.Net.Mail to construct their messages.

I think this is the way to go and really wish this is what would have happened in the first place. Here was my initial developer experience with SES:

I need to send an email with an attachment. Oh, I can't do that with the normal SendEmail and have to use SendRawEmail. Ok then.
[Googles]...hmm, looks like SendRawEmail needs a MemoryStream with a raw MIME message that I have no clue how to concoct. Looks like my options are:
a. I can add in a library like MimeKit to convert a MailMessage to a MemoryStream. Works great, but adds a dependency to all our apps that email. Not cool.
b. I can add all this reflection jazz that some SO user posted. Seems to work, let's roll with that.

Of course, only come to find later this bug, which would be near impossible to know up front given the mess with reflection and the fact that it will only happen when a period lands on a wrapping break.
All that to say, if SendRawEmail had something like this, it would be very natural for a C# developer who is used to a MailMessage.

@sstevenkang I see the label, but do you have any thoughts or ETA on this? On my end, I have to move on this fairly quickly to rectify this issue and decide to either add in MimeKit or abandon SES.

It's very unlikely that this will be updated on the service side quickly, if at all. The approach I would recommend at this time is to add a dependency on MimeKit.

@normj Does the closing of this (and the "Service Issue" tag) mean that this was fixed on the service side of things?

Sorry I should have added a comment when I closed the issue. I was just trying to clear up issues that the SDK team can handle. Service issues are best handled through the service forums or AWS support.

Just had to send an email with attachment using aws-sdk-net and found this thread. I totally agree that there should be a better way of doing this through the client. I'm using templated emails everywhere, why having to use the raw methods when needing to send attachments, seems odd. I know that the client is mostly auto-generated, but overloads for SendEmail etc. could be written. Behind the cover, these would simply use the raw methods, hiding what goes on.
Don't expect anything, just wanted to add my thoughts :smile:

I am still seeing this as an issue, is there a place we can further request this feature from AWS? It appears 8 years later we still have the same impass... Unless I am missing updates?
Also, in case anyone else ends up here still, and the example from the OP is erroring out with null reference, see this stack overflow comment that points to the issue with updates made to the constructor over the years..
relevant updates to OP's code based on the stack overflow article:
var mailWriterConstructor = mailWriterType.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, null, new[] { typeof(Stream), typeof(bool) }, null);
var mailWriter = mailWriterConstructor.Invoke(new object[] { stream, true });


Make bin/activate be able to run from other shells

Describe the bug
Running bin/activate fails on shells that are not Bash.
To Reproduce
Steps to reproduce the behavior:

follow the instructions in README.md
get to the point where you need to execute source bin/activate and do that
See error

Error in terminal
bin/activate (line 74): Missing end to balance this if statement
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
^
from sourcing file bin/activate
        called on standard input

source: Error while reading file “bin/activate”

This happens on Fish Shell, but I expect the same would be true in some others as well.
Expected behavior
To be fair, the bin/activate file does state it requires to be ran from Bash. But I see no reason for this.
Wouldn’t a hashbang to explicitly demand bash solve this issue, e.g. as #!/usr/bin/env bash or just #!/bin/bash
Environment you are running Tern on
Enter all that apply

Output of 'tern --version' – did not get to that part. I am trying to install from commit 68cb1250db29dfc33c5e93b0ad63b9955845b6c2
Operating System: Ubuntu 18.04.3 LTS
Python version 3.6.8
local laptop install

Hi @silverhook, I'm sorry to hear you are having trouble getting your virtual environment to activate with your Fish Shell!
I looked around for others having the same issue and found this reference. Looks like there is an activation script especially for the Fish shell. Please try to run:
source bin/activate.fish
I think this issue you raised is good justification to perhaps make a small edit to our documentation to specify that the directions to activate a virtual environment we have there are specificailly for bash. I will do that now and then close out this issue. Please let me know if you have any further questions.

@rnjudge Thanks, this fixed this issue for me.
One small typo creaped into https://github.com/vmware/tern/pull/485 though – there should be a space between source and bin/activate.fish (and the same with csh).
Also, I apologise for the late reply …life happens, sometimes in an ugly way.


Change MadNLP behavior to not delete the entries inside the options' Dict

Right now, we pass the options to MadNLP as a Dict madnlp_options. The problem is that MadNLP deletes the entries in madnlp_options, requiring us to use copy to keep the initial settings in memory. Ideally, MadNLP should not delete the entries in madnlp_options

Solve by #191


Tests fail on OTP 26

For some reason the tests are failing when run on OTP 26. Here's output from a test run on Elixir 1.14.5-otp-26 with Erlang 26.0.2:
  1) test Test that request/unrequest/list_requests work (Scenic.ViewPort.InputTest)
     test/scenic/view_port/input_test.exs:91
     Assertion with == failed
     code:  assert Input.fetch_requests(vp) == {:ok, [:key, :cursor_pos, :codepoint]}
     left:  {:ok, [:cursor_pos, :codepoint, :key]}
     right: {:ok, [:key, :cursor_pos, :codepoint]}
     stacktrace:
       test/scenic/view_port/input_test.exs:98: (test)

....

  2) test Test that capture/release/list_captures work (Scenic.ViewPort.InputTest)
     test/scenic/view_port/input_test.exs:48
     Assertion with == failed
     code:  assert Input.fetch_captures(vp) == {:ok, [:key, :cursor_pos, :codepoint]}
     left:  {:ok, [:cursor_pos, :codepoint, :key]}
     right: {:ok, [:key, :cursor_pos, :codepoint]}
     stacktrace:
       test/scenic/view_port/input_test.exs:55: (test)

.......................................................................................................................................................................

  3) test press_out releases and ends editing (Scenic.Component.Input.TextFieldTest)
     test/scenic/component/input/text_field_test.exs:105
     Assertion with == failed
     code:  assert Input.fetch_captures!(vp) == {:ok, [:codepoint, :cursor_button, :key]}
     left:  {:ok, [:key, :codepoint, :cursor_button]}
     right: {:ok, [:codepoint, :cursor_button, :key]}
     stacktrace:
       test/scenic/component/input/text_field_test.exs:108: (test)

.......

  4) test press_in captures and starts editing (Scenic.Component.Input.TextFieldTest)
     test/scenic/component/input/text_field_test.exs:95
     Assertion with == failed
     code:  assert Input.fetch_captures!(vp) == {:ok, [:codepoint, :cursor_button, :key]}
     left:  {:ok, [:key, :codepoint, :cursor_button]}
     right: {:ok, [:codepoint, :cursor_button, :key]}
     stacktrace:
       test/scenic/component/input/text_field_test.exs:99: (test)

However scenic appears to run just fine on Elixir 1.14.5 and OTP 26.

Weird. It's shifted right and wrapped by 1.

Closing this for now, since we test against 26 in CI and it's been green.


Hard links implementation

In some situations it's very useful to have hard links in FUSE based file system.
This change will allow the hard links creation.
The change contains very minimal piece of code required to make OpLink operation possible:

new CreateLinkOp struct is introduced and CreateLink call is added to FileSystem interface,
code for serialization and deserialization is implemented for the new operation.

Thanks for this. Could you please add a test to the samples/ directory, with similar coverage to what already exists for symlinks?

Thanks for the suggestion.
Some test cases are added. There are following changes in the samples/ directory:

CreateLink operation is implemented in memfs.
Test cases are added to check: (1) hard link creation, (2) hard link creation over existing file, (3) hard link deletion, (4) reading file content from linked file, (5) parallel creation of hard links.
Existing negative test case for hard link is removed.

Is this test coverage ok?

Thanks!


use the same constants value for managed gateway label name

Please provide a description of this PR:
updated reference missed in earlier PR's

/test release-notes


Update travis tests to catch route errors

Overview
Currently, the travis test passes even if some routes are non-functional.
E.g.

git checkout 317b8c18
docker-compose -f local.yml build
sh tests/test_docker.sh  # tests should pass
docker-compose -f local.yml up
open http://<IP_ADDRESS>:8001/  # page should error

Expected Behavior
Travis should test all navigable routes and ensure that they properly function.
Technical details
At a minimum, the following home pages should be tested:

http://<IP_ADDRESS>:8000/
http://<IP_ADDRESS>:8001/
http://<IP_ADDRESS>:8080/

The appropriate routes for each home page should be tested as well.
e.g., http://<IP_ADDRESS>:8000/api and http://<IP_ADDRESS>:8001/classify/predict

This feature should be implemented in the tests/test_docker.sh file.

Acceptance criteria

[ ] The travis test should fail if any of the service routes produces an error.

NOTE: All PRs must follow the standard PR checklist.

Hi Reubano,
What are you looking for when you say that the pages should be "tested"? In other words, what qualifies as "tested"? Also, what is a "travis test"
From what I can see:
http://<IP_ADDRESS>:8000/ - Has a 404 page not found error
http://<IP_ADDRESS>:8001/ - Gets a "ERR_CONNECTION_REFUSED" error
http://<IP_ADDRESS>:8080/ - This page loads and it seems you can see a drill down of a set of related fil
As an fyi: I am trying to get my feet wet with this process, so some of the asks may seem basic, but I am just trying to understand how to view and make changes where applicable.

Hi @adrianjoseph these are the travis tests. It runs the tests in this file. So by "the pages should be tested", I mean that if you checkout commit 317b8c18, the travis tests should fail since not all the routes work. Does that make sense?

I'm still not clear on why we would want a gigantic integration test instead of testing the services individually?

@isms mind giving an example of the sort of "individual service test" you mean? One way to speed things up could be reducing the TIMEOUT.

@reubano It seems like this is essentially testing Docker by seeing if the services specified in docker-compose.yml show up, no? In each case you could write a simple unit (or functional) test for the service in question to make sure it's working (e.g. not 404, not ERR_CONNECTION_REFUSED).
This is not a good way to test whether each of the services are working as designed (except for painfully indirectly by spinning up all the services), only that they're all configured to see each other via Compose which, well, is not very useful given that Compose is mostly mocking things out for a developer to use locally.
Can somebody explain to me what problem this solves that can't be better solved with more focused tests?


Webinar attendees limit for M365 Business Standard/Premium

Here a limit for webinar attendees is not specified.
On https://www.microsoft.com/en-us/microsoft-365/blog/2021/05/11/introducing-webinars-in-microsoft-teams-easy-professional-webinars-to-engage-customers/ it says "Microsoft 365 Business Standard and Microsoft 365 Business Premium plans will include all the features above for up to 300 attendees. "
Also, on the plans comparison pricing page it says there's a 300 limit for meetings, while here it says 1000.

What is the real limit for webinars in M365 Business? It should be clarified on the docs

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: 905e2c09-ef3e-07cc-0809-6ff171157c47
Version Independent ID: c0d33162-183d-fff8-32e9-a999f391ea51
Content: Limits and specifications for Microsoft Teams - Microsoft Teams
Content Source: Teams/limits-specifications-teams.md
Service: msteams
GitHub Login: @MicrosoftHeidi
Microsoft Alias: heidip

To make it easier for you to submit feedback on articles on learn.microsoft.com, we're transitioning our feedback system from GitHub Issues to a new experience.
As part of the transition, this GitHub Issue will be moved to a private repository. We're moving Issues to another repository so we can continue working on Issues that were open at the time of the transition. When this Issue is moved, you'll no longer be able to access it.
If you want to provide additional information before this Issue is moved, please update this Issue before December 15th, 2023.
With the new experience, you no longer need to sign in to GitHub to enter and submit your feedback. Instead, you can choose directly on each article's page whether the article was helpful. Then you can then choose one or more reasons for your feedback and optionally provide additional context before you select Submit.
Here's what the new experience looks like.
Note: The new experience is being rolled out across learn.microsoft.com in phases. If you don't see the new experience on an article, please check back later.
First, select whether the article was helpful:

Then, choose at least one reason for your feedback and optionally provide additional details about your feedback:

Article was helpful
Article was unhelpful

Finally, select Submit and you're done!


How to build cmdstan against system libraries?

Summary:
Please provide a short couple sentence summary.
How to build cmdstan against system libraries by writing a make/local?
Description:
Describe the issue as clearly as possible.
I want to build cmdstan against these system libraries:
 'gtest' 'benchmark' 'sundials' 'boost' 'eigen' 'tbb'  'stanmath`
 'python-cpplint' 'opencl-headers' 'rapidjson' 'cli11'

I write a local file  like this, and put it in make stan/make  to overwrite the library path
MATH = /usr/include/stan/
BOOST = /usr/include/boost
EIGEN = /usr/include/eigen3
OPENCL = /usr/include/CL
TBB = /usr/include/tbb
SUNDIALS = /usr/include/sundials
BENCHMARK = /usr/include/benchmark
GTEST = /usr/include/gtest
CPPLINT = /usr/lib/python3.10/site-packages/
RAPIDJSON = /usr/include/rapidjson/
CLI11 = /usr/include/CLI/

But when I run make build I get the error
--- Compiling the main object file. This might take up to a minute. ---
g++    -c -o src/cmdstan/main.o src/cmdstan/main.cpp
src/cmdstan/main.cpp:1:10: fatal error: cmdstan/command.hpp: No such file or directory
1 | #include <cmdstan/command.hpp>
|          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [make/program:14: src/cmdstan/main.o] Error 1

However, when I remove the local file and rerun make build. It works.
Reproducible Steps:
Please report steps to reproduce the issue. If it's not possible to reproduce, please include a description of how you discovered the issue.
If you have a reproducible example, please include it.
Current Output:
The current output. Knowing what is the current behavior is useful.
Expected Output:
Describe what you expect the output to be. Knowing the correct behavior is also very useful.
Additional Information:
Provide any additional information here.
Current Version:
v2.29.2

@sukanka, thanks for writing up the issue!
Before getting into the technical issues, could I ask why you want to do this? It's not really the supported use-case for CmdStan (and really the rest of Stan) because there's a lot of chance for version mismatch that could cause compilation issues and runtime issues.
On to the technical issues:

does CmdStan build without modification?
is that the actual output from make build? It seems to be missing ALL the includes. I'm not even sure how that could happen.
did you modify anything else other than make/local? That could explain question 2.
rather than replacing everything, can we try replacing one library at a time? I feel like you'll run into a version mismatch where it won't compile soon, but it's easier to diagnose when only changing one thing at a time.

Thanks for your reply! I'm running archlinux, I'm afraid that if cmdstand is build against the old dependencies (shipped with the released tarball), it will fail to run in the future (as the other libraries will be updated). But currently, it runs just fine.
My system has the following libs:
boost 1.78.0-1
eigen 3.4.0-1
tbb 2021.5.0-1
opencl-headers 2:2022.01.04-1
...

For the technical issues:

Sure, and it runs just fine, no coredumps.
It is all the output. The command stopped there. I also wondered why it didn't find the headers. The headers are just there.
No. Only make/local is changed.
Thanks for you suggestion! It helps a lot! I just add

RAPIDJSON = /usr/include/rapidjson/
CLI11 = /usr/include/CLI/

to make/local and run make build -j14. It stopped with
src/cmdstan/stansummary.cpp:11:10: Fatal error：CLI11/CLI11.hpp：No such file or directory
11 | #include <CLI11/CLI11.hpp>

But I noticed there is only CLI.hpp. So it is the problem of archlinux it self.
➜  ~ ls  /usr/include/CLI/
App.hpp  ConfigFwd.hpp  Error.hpp         Formatter.hpp  Option.hpp  StringTools.hpp  TypeTools.hpp   Version.hpp
CLI.hpp  Config.hpp     FormatterFwd.hpp  Macros.hpp     Split.hpp   Timer.hpp        Validators.hpp

and I noticed there is some log containing  /usr/include/rapidjson/.
Therefore, the above local file works.
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I /usr/include/rapidjson/ -I /usr/include/CLI/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_6.0.0/include -I stan/lib/stan_math/lib/sundials_6.0.0/src/sundials    -DBOOST_DISABLE_ASSERTS          -c -fvisibility=hidden -o bin/cmdstan/stansummary.o

After changing CLI11 to CLI and rerun make build I find some errors like
src/cmdstan/stansummary.cpp: In function 'int main(int, const char**)':
src/cmdstan/stansummary.cpp:52:17: error: no matching function for call to 'CLI::App::add_option(const char [14], int&, const char [32], bool)'
52 |   app.add_option("--sig_figs,-s", sig_figs, "Significant figures, default 2.",
|   ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53 |                  true)
|                  ~~~~~

So the API in CLI11 has changed. Maybe I should write a patch for it.

But when I add a local file to the make/ directory inside stan_math and run make build(in the source directory of cmdstan)
It seems that it still uses the bundled libraries
g++ -std=c++1y -pthread -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2020.3/include    -O3 -I src -I stan/src -I /usr/include/rapidjson/ -I /usr/include/CLI/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_6.0.0/include -I stan/lib/stan_math/lib/sundials_6.0.0/src/sundials    -DBOOST_DISABLE_ASSERTS                -Wl,-L,"/tmp/makepkg/stanc/src/cmdstan-2.29.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/tmp/makepkg/stanc/src/cmdstan-2.29.2/stan/lib/stan_math/lib/tbb"      bin/cmdstan/print.o        -Wl,-L,"/tmp/makepkg/stanc/src/cmdstan-2.29.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"/tmp/makepkg/stanc/src/cmdstan-2.29.2/stan/lib/stan_math/lib/tbb"   -o bin/print

I'm running archlinux, I'm afraid that if cmdstand is build against the old dependencies (shipped with the released tarball), it will fail to run in the future (as the other libraries will be updated).

I think the direction is backward! If you're only using what's in CmdStan without external dependencies, then it'll always build... even if system libraries change. The only time this wouldn't be true is if the compiler ends up not supporting the C++ code that particular version of CmdStan uses.
Does that make sense?

Maybe you are correct. Well, this issue can be closed now. I will open another issue  to ask  for updating the  dependecies if someday the excutable built against these dependencies  crashes with a coredump.  Thanks for your opinions and patience.

@sukanka, thanks! Closing the issue. If you do need more help, please reach out.


error unsupported argument

rescources = [
An argument name “rescources” not expected here
An argument name “principal” not expected here

You've misspelled resources.

my bad typo error.
please find my code and error .
resource "aws_ram_resource_share" "prdem_ram_glue_share" {
count = "${var.stage}" != "dev" ? 1 : 0
name  = "${var.name}-glue-shares"
resources = [
{
name         = "Glue Tables"
resource_arns = [
"${var.stage}_xxxxxxxi",
"${var.stage}_xxxxxxxx",
"${var.stage}_xxxxxxxx"
]
},
{
  name         = "Glue Databases"
  resource_arns = [
    "glue.xxxxxxx.${var.stage}"
  ]

}

]
principals = [
"${var.account_id}"
]
permission_arns = [
"arn:aws:ram::aws:permission/AWSRAMPermissionGlueDatabaseReadWriteForTable",
"arn:aws:ram::aws:permission/AWSRAMPermissionGlueDatabaseReadWrite"
]
}

Error: Unsupported argument
983 | │
984 | │   on modules/glue/main.tf line 578, in resource "aws_ram_resource_share" "prdem_ram_glue_share":
985 | │  578:   resources = [
986 | │
987 | │ An argument named "resources" is not expected here.
988 | ╵
989 | ╷
990 | │ Error: Unsupported argument
991 | │
992 | │   on modules/glue/main.tf line 597, in resource "aws_ram_resource_share" "prdem_ram_glue_share":
993 | │  597:   principals = [
994 | │
995 | │ An argument named "principals" is not expected here.

I don't see anywhere in that code where you are using this module. Are you sure you opened an issue on the correct repo?
It looks like you might be trying to use the native terraform resource, instead. If you want to use this module, please see the tests directory for some example configurations.

The same problem

@foolishhare See the tests directory for examples of how to use this module. All tests are functional and create fully working implementations.


[MERGE AFTER #2007] Use ament for autoware_build_flags

Status
PRODUCTION / DEVELOPMENT
Description
Replace catkin with ament_cmake for autoware_build_flags for future ROS2 transitioning (#2013).
Related PRs
#2007

Gitlab CI pipeline:
https://gitlab.com/maximosipov/autoware/pipelines/48953685


Created a cooldown system for commands (per user per cmd)

As of right now I have left all the method overrides for cooldown per function at 0 meaning that they have no cooldown, please feel free to put whatever cooldowns you want per function.
If you want to change the message given or change something about the embed, its right before the return statement above the run call in Manager class

aight sure

Alright I kept it in manager just for ease of access to the maps but instead put it once outside of the scope of else if for the guild/user commands, tested and works fine


Xamarin

Docs Build status updates of commit 3b6f790:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

.openpublishing.publish.config.json
:white_check_mark:Succeeded

breadcrumb/toc.yml
:white_check_mark:Succeeded

docfx.json
:white_check_mark:Succeeded

tutorials/xamarin.yml
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


Update common files and generated files

Please provide a description for what this PR is for.
And to help us figure out who should review this PR, please
put an X in all the areas that this PR affects.
[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

@howardjohn: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

e2e-simpleTests-distroless_istio
c3023385d55b453622a03f83c2e985ef00ff2d52
link
/test e2e-simpleTests-distroless_istio

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.


Switch from bzImage to kernel for kernel image

This was too architecture specific previously.
Signed-off-by: Justin Cormack<EMAIL_ADDRESS>

How are we going to handle the transition? Could we check for bzImage for sometime if kernel is not there? At least for a while?

Yeah, I was thinking I would break it but maybe I will put a transition in.

Ok reworked to support both kernel and bzImage for now, and also to not require tar in the kernel image.

did you forget to push?

Yes, well I forgot the force as I had rebased

updated


Add the send-request event

This adds a send-request event which will allow an event handler to return a response and short circuit botocore's default HTTP stack.
This also adds a test utility to stub the HTTP layer and replaces quite a few places where we were patching out internal methods.

Codecov Report

Merging #1556 into develop will increase coverage by 0.79%.
The diff coverage is 93.93%.

@@             Coverage Diff             @@
##           develop    #1556      +/-   ##
===========================================
+ Coverage    91.13%   91.93%   +0.79%
===========================================
  Files           50       50
  Lines         9028     9047      +19
===========================================
+ Hits          8228     8317      +89
+ Misses         800      730      -70

Impacted Files
Coverage Δ

botocore/endpoint.py
98.46% <100%> (+0.06%)
:arrow_up:

botocore/awsrequest.py
98.29% <93.33%> (+5.82%)
:arrow_up:

botocore/utils.py
97.44% <0%> (+0.18%)
:arrow_up:

botocore/credentials.py
98.8% <0%> (+0.39%)
:arrow_up:

botocore/hooks.py
96.38% <0%> (+0.4%)
:arrow_up:

botocore/handlers.py
97.13% <0%> (+0.47%)
:arrow_up:

botocore/httpsession.py
92.3% <0%> (+0.64%)
:arrow_up:

botocore/compat.py
93.92% <0%> (+25.41%)
:arrow_up:

Continue to review full report at Codecov.

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


Enforce 512KB event size limit for Pagerduty events

PagerDuty will soon start enforcing a size limit of 512KB on all events. To prevent sending events that are larger than that, this PR implements the proposal that was decided in this issue https://github.com/prometheus/alertmanager/issues/2178
The size of events are checked after they are encoded into json. If the size is above 512KB, the custom details (or details for v1 events) are replaced with an error message.
This was my first time writing Go so the code may not be the best :)

Hi @simonpasquier, do you mind taking a look when you have time? Thanks.

I think pagerduty has enforced this payload limit. Any chance of reviewing and merging this PR. Thank you @shamilpd for the work.

Thanks for the PR and sorry for the late review!

@simonpasquier  Thank you for the review! I have made the changes you asked for.

Hello @simonpasquier @roidelapluie Can we move forward and merge this PR?
We (PagerDuty) are planning to start enforcing this limit sometime in the summer.

I am happy to merge this, I have posted one last question/comment.

Also, should we really fail at the client side? Can't we still send the request anyway and see what happens?

@roidelapluie Well the client-side failing is only happening if the message is still too large after truncation (replacing custom details). If a request was still sent to PagerDuty, it would return a 400 and the client would fail anyway. The difference here is ease of visibility. By failing in the client, it should be a lot easier to see why it failed.
As for the case of whether to do truncation at all, we need to bias towards not dropping as many events as possible since a dropped event means someone potentially doesn't get paged. This would upset our customers.

Thank you @roidelapluie @simonpasquier for reviewing this again!
I have made the requested changes: removed the recursion and added a warning log.

@roidelapluie  Is there anything I can do to move forward with this or are we ready to merge?

Thanks for your work!


Fix object deserialization

Closes #320

for regular types, it is not necessary to specify the type (in fact the subtype). The issue is only for dwa deserialization because this DataWithAxes type exists in various flavor (in particular the DataActuator that is important for the DAQ_Move)

Ok I think I misled you. Our programs should be self aware of what type of object is to be expected. For instance a data_ready signal will convey a dte hence you should use a dte_deserialization method. The same applies for other objects. the method object_deserialization is only meant to be used within dte_deserialization od dwa_deserailization
Does that solves your issues? If yes I will add some docstrings and tests for that (and maybe make the object_deserialization a private method)

to be even more precise:
the method object_deserialization is to be used only where type_and_object_serialization has been used in Serializer, that is in:

list_serialization: because we don't know what could be in the list
dwa_serialization: because the field extra_attributes could contains anything