Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
L!εsAμεr
@liesauer
can i set Context.StringEncoding in the csproj?
Jakub Míšek
@jakubmisek
@liesauer Nope, StringEncoding is a manner of run time, while csproj is purely compile time which produces a generic DLL that can run on various run times under various settings.
Calvin Baart
@calvinbaart
Seems that with the upgrade to dotnet core 3.0 the laravel travis builds were broken so that should be fixed now. Seems that the issues causing the most errors at this moment are:
Jakub Míšek
@jakubmisek
@calvinbaart thanks! peachpiecompiler/peachpie#549 has been fixed, the others are in progress. We might add some debug assertions so peachpiecompiler/peachpie#252 will fail instead of silent pass through ..
Calvin Baart
@calvinbaart

@jakubmisek I’m getting this error now: PHPUnit\Framework\WrappedException: System.ArgumentException: Enum underlying type and the object must be same type or object must be a String. Type passed in was 'System.Int64'; the enum underlying type was 'System.Int32'.
1961 at System.RuntimeType.IsEnumDefined(Object value)
1962 at System.Enum.IsDefined(Type enumType, Object value)
1963 at Peachpie.Library.PDO.PDO.setAttribute(Int32 attribute, PhpValue value)
1964 at Doctrine.DBAL.Driver.PDOConnection.__construct(PhpValue dsn, PhpValue user, PhpValue password, PhpValue options) in /home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:line 29

The only setAttribute the constructor does is for the statement class and the errmode. I’m guessing the errmode causes this exception

Jakub Míšek
@jakubmisek
thanks @calvinbaart , fixed!
Dani Llewellyn
@diddledani
lots of work occuring on a Sunday :-)
Calvin Baart
@calvinbaart
That fixed about 200 errors :)
Tests: 3953, Assertions: 7237, Errors: 791, Failures: 137, Warnings: 3, Skipped: 86.
->
Tests: 3953, Assertions: 7770, Errors: 587, Failures: 154, Warnings: 3, Skipped: 86.
Jakub Míšek
@jakubmisek
:)
Jakub Míšek
@jakubmisek

@calvinbaart commit peachpiecompiler/peachpie@874376a fixes variables not being passed by reference. So few more tests should pass now.

Also I see there is a lot of syntax errors in SQL queries?

Then some exceptions when reflecting closure's parameter I guess?

Feel free to post new issues :) we are getting closer to 1.0 release and it would be cool to have laravel at least partially working

Calvin Baart
@calvinbaart
@jakubmisek I think some of the SQL syntax errors are caused by invalid function of some of their helper functions (they
Use a lot of references in their helper functions)
I'll try to investigate some of them tonight
Calvin Baart
@calvinbaart

@jakubmisek I think something is going wrong with default arguments but I can't seem to figure out a small test case. Looking at this error for example:

7) Illuminate\Tests\Database\DatabaseEloquentBelongsToManyChunkByIdTest::testBelongsToChunkById
Illuminate\Database\QueryException: SqliteException: SQLite Error 1: 'near "from": syntax error'. (SQL: select  from "users" limit 1)
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Connection.php:625
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Connection.php:335
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Query/Builder.php:2142
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Query/Builder.php:2128
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Query/Builder.php:2572
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Query/Builder.php:2127
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Eloquent/Builder.php:520
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Eloquent/Builder.php:505
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel/src/Illuminate/Database/Concerns/BuildsQueries.php:143
/home/travis/build/calvinbaart/laravel-peachpie-sample/Laravel.Tests/tests/Database/DatabaseEloquentBelongsToManyChunkByIdTest.php:56

The code that errors out (DatabaseEloquentBelongsToManyChunkByIdTest.php:56) will be:

$user = BelongsToManyChunkByIdTestTestUser::query()->first();

Where first is defined as:

    public function first($columns = ['*'])
    {
        return $this->take(1)->get($columns)->first();
    }

When placing a print_r in first to check $columns I get no results (null). (PHP correctly echoes the ['*'] default parameter). Changing it to this however:

    public function first($columns = ['*'])
    {
        echo print_r(func_get_args(), true) . "\r\n";
        return $this->take(1)->get($columns)->first();
    }

Fixes it. It correctly gets the default value for $columns this time. The first method is in a trait used by the Builder class (returned instance of the query method).

ILSpy only shows this for the method first in the Builder class:

public virtual PhpValue first([DefaultValue(Type = DefaultValueAttribute.DefaultValueType.PhpArray, SerializedValue = new byte[]
{
    97,
    58,
    49,
    58,
    123,
    105,
    58,
    48,
    59,
    115,
    58,
    49,
    58,
    34,
    42,
    34,
    59,
    125
})] PhpValue columns)
{
    return <>trait_BuildsQueries.first(columns);
}

When using the func_get_args print_r ILSpy shows this (this version works):

public virtual PhpValue first(params PhpValue[] <arguments>)
{
    return <>trait_BuildsQueries.first(<arguments>);
}
Jakub Míšek
@jakubmisek
@calvinbaart awesome! you are right - default parameters with arrays in a trait method will be the cause of this ... I'll try to prepare a test case
Calvin Baart
@calvinbaart
Great :) Just ran a new test and it seems that all the relation errors are gone! (They are all replaced by the default arguments error though). So I think we are almost there for a functional Eloquent ORM
Jakub Míšek
@jakubmisek
@calvinbaart thanks :) default arguments have been "redesigned" and fixed just now, I hope it helps
Calvin Baart
@calvinbaart
Jakub Míšek
@jakubmisek
nice, this never worked .. at least now it throws an exception
Calvin Baart
@calvinbaart
@jakubmisek after the fix for #570 I tried building again but that resulted in a Stack Overflow during compilation: https://travis-ci.com/calvinbaart/laravel-peachpie-sample/builds/133804194 I then tried building in Debug mode instead to hopefully get some more info and that resulted in this error: https://travis-ci.com/calvinbaart/laravel-peachpie-sample/builds/133907933 (I don't think that assertion is related to the Stack overflow though)
Jakub Míšek
@jakubmisek
Thanks @calvinbaart the assertion might be cause of it, but who knows :) will try to fix it and try your project
Dani Llewellyn
@diddledani
in PeachPied.WordPress.AspNetCore/RequestDelegateExtension.cs there's a reference to WP as a type both in code an documentation comments. VS complains that the type is undefined. This type is defined in the WordPress PHP code IIRC. Is there something we can do to let VS know about it for better "go to definition" and such?
Dani Llewellyn
@diddledani
no idea what this one is doing:
Severity    Code    Description    Project    File    Line    Suppression State    Suppression State
Error    PHP1018    Class 'WPMailSMTP\MailCatcher' doesn't implement abstract method System\IDisposable::Dispose()    net.WordPress.plugin.wp-mail-smtp    C:\Users\yabea\source\repos\diddledan\bowlhat-wpdotnet\net.WordPress.plugin.wp-mail-smtp\wp-content\plugins\wp-mail-smtp\src\MailCatcher.php    16
Dani Llewellyn
@diddledani
this is the most reduced I can make that failure - it's got a copy of WPDotNet rather than relying on the -beta8 release because it only fails with master: https://github.com/diddledan/WPDotNet-PP-0.9.500-Inheritance-Test/tree/master/Inheritence%20Test
Jakub Míšek
@jakubmisek
@diddledan once you compile the WP project, the reference to WP class will be resolved
@diddledan hmm the error might be caused by mismatch in PeachPie versions
Jakub Míšek
@jakubmisek
@calvinbaart getting stack overflow in my test case as well, traits need some fixes when they are compiled in a separate assembly and referenced
Calvin Baart
@calvinbaart
Great that you found it! In the future should I just create a ticket on github for it? (I'm a bit weary to create github issue's without providing any information)
Jakub Míšek
@jakubmisek
@calvinbaart if you'd know the issue :) create a ticket please, but this one was pretty tough ...the latest commit peachpiecompiler/peachpie@e7c7d08 fixes several issues with traits being used from within a compiled library
Calvin Baart
@calvinbaart
@jakubmisek Yea, it's more that build issues just saying "Stack overflow" will be quite hard to create a proper ticket for. Seems that I'm still getting the Stack Overflow with the latest commit: https://travis-ci.com/calvinbaart/laravel-peachpie-sample/builds/134230099
Jakub Míšek
@jakubmisek
@calvinbaart thanks, so there is more occurances of the issue, will be fixed!
Jakub Míšek
@jakubmisek
@calvinbaart assertion was fixed, now getting the stackoverflow as well :)
Jakub Míšek
@jakubmisek
got the test case :/
trait A {
    function foo($a = XXX) {
    }
}

trait B {
    use A;
}
Calvin Baart
@calvinbaart
Traits cause all kind of fun issues don't they?
Jakub Míšek
@jakubmisek
@calvinbaart yep laughing all the day
@calvinbaart ok the laravel-sample project compiles for me now :)
Calvin Baart
@calvinbaart
nice! I'll start a new build on Travis
Jakub Míšek
@jakubmisek
@calvinbaart I see a few new issues, will try to make tests for them a fix
Jakub Míšek
@jakubmisek
@calvinbaart the compile issue should be fixed now, please try again :)
Calvin Baart
@calvinbaart
@jakubmisek Started: https://travis-ci.com/calvinbaart/laravel-peachpie-sample/builds/134558814 I didn't even notice the previous failure yet so that was a quick fix :)
Jakub Míšek
@jakubmisek
thanks :)
Jakub Míšek
@jakubmisek
ok it broke something else :) at least I have a test case
Calvin Baart
@calvinbaart
I also removed a few patches a few days ago because (in theory) they shouldn't be needed anymore. We'll need to see how that works out (only impacts the actual tests though)
Jakub Míšek
@jakubmisek
I'm trying it locally and actually not applying those patches at all .. but it is good to remove them slowly :)
Jakub Míšek
@jakubmisek
@calvinbaart few other fixes for the latest issue commited :)
Calvin Baart
@calvinbaart
It goes a bit further now but skips almost all the tests....I'll have to look into that when I'm home
(Perhaps I should also set up the automated testing for PHPUnit so that we can verify if PHPUnit itself functions correctly)
Jakub Míšek
@jakubmisek
finaly it compiles ...