From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 295563858D1E; Thu, 22 Dec 2022 01:01:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 295563858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-x231.google.com with SMTP id c129so693127oia.0; Wed, 21 Dec 2022 17:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=V8cHh+n5PdDELK3+qUTJE/usc1FrqtnfTDT9LAyQyL8=; b=AAivRPT78kiOWy+W4xgScz+1nbDG7T04+gvRe6F6Yi9HZYMAYaFmDPi8ZqdHwfJQGp sxLuRtBywnLXID3dsYiLvHibYfTMIXvgCghfdHYbQSBAdPflOZsPP5H3yOItnuJEZhyA sIKhrCSl2Gubzrzxg6e19AdnLPkW6YG+tkENDuKQl/7KxZBw9aLNXMFL5QlfYHT9Ogwi WnibPC/zf+Potm3GwGRo+f0Ncqq2v/RzbP7WlZmA4B2vIjKRp17a9KbaPHvfxrXj0gun wJl3OAfmUHUCb2ExRm+ceL76klGEOJPSTejXRooW5a/oRRmMZ1xX42Osu5jRFMRoPuT8 CPTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V8cHh+n5PdDELK3+qUTJE/usc1FrqtnfTDT9LAyQyL8=; b=qTST213AVRacU8fg+DAd5Ze+qeBa4tNqNPOmD4+2pX6sZtorB+6PxrcigMET6Iraj7 iZOO/RN8/oCzr7Rxf5tlkwh6xd7SSGb2JyFsGmXcONnJ9FtWr2jYNs02jOdRYTEhmLhM mYidVVXExHk5qvOwwRvltHGzcG8WFJIakd0mLjBNRV9ePTADk1U7AcJwe82MlBvYfTFU pT715knLQOHLGKgn9vQOr+kBKd/v9p1ftRPcANqURb+44t7eorLUkKbQ9dgNZhhDUNGp GlpTPJfy/VzDSxd087U+3GHYlHCzuzTug+HpogtRsjva4l7iW4IqlpWPbmPBvBAF0APT /srQ== X-Gm-Message-State: AFqh2kqx/tvnoImv26+5VLSXX7YKQ9ddzhwyH4fsJdSDhGQMy8WIzALH kfK8RxcSk9q9pmBoB89HiiNy5HI9uMUrT/eaHpY= X-Google-Smtp-Source: AMrXdXv7t6wMqv+psM00z0NAfFmoUG6FdD5E42D+jVd+Fy6aF+/26vr/8T5ZpQm5kCsLXCV0UZs8E2TasheWaXS1vhI= X-Received: by 2002:aca:705:0:b0:35a:56f5:8631 with SMTP id 5-20020aca0705000000b0035a56f58631mr66925oih.152.1671670912386; Wed, 21 Dec 2022 17:01:52 -0800 (PST) MIME-Version: 1.0 References: <639FE88D.7090408@gmail.com> <7cb45ab2-cc6e-c502-5592-51ffabcbc6f8@codeweavers.com> In-Reply-To: <7cb45ab2-cc6e-c502-5592-51ffabcbc6f8@codeweavers.com> From: NightStrike Date: Wed, 21 Dec 2022 20:01:48 -0500 Message-ID: Subject: Re: testsuite under wine To: Jacek Caban Cc: jcb62281@gmail.com, fortran@gcc.gnu.org, Eric Pouech , "gcc@gcc.gnu.org" , dejagnu@gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Dec 21, 2022 at 12:38 PM Jacek Caban wrote: > > Hi all, > > > I'm responsible for Wine changes that cause your problems. I'm also > CCing Eric, who is Wine console expert, maybe he has better ideas. Eric, > see [1] if you're interested in the context. > > > Recent Wine versions implement Windows pseudo-consoles, see [2] for a > bit more details. It's generally Microsoft's semi-recent API that's > intended to be more compatible with POSIX than what was present in > previous versions of Windows. In theory, with that implemented, we could > just plug tty fds that we get from Unix and have Unix consoles working > using those Windows APIs. In practice, it's not quite as good as > promised and we need some tweaks to make it work nicely. We could > improve those tweaks, but there are architectural limitations that will > come to play sooner or later. > > > > I think that the long-term solution is that Wine should properly honor > > the TERM environment variable and not produce escape codes that the > > declared terminal does not support. > > > I think that it would not be enough. The way Windows consoles work is > that we manage complete internal screen buffer and emit output that > synchronizes the buffer with Unix terminal inside conhost.exe process. > It means that its output heavily processed and may be very different > from what application writes to its console handle. While escape codes > discussed in this thread are the most prominent difference (and that > part could, in theory, be improved on our side), there are more > differences. For example, if application writes "\rA\rB\rC", conhost > will process it, update its internal buffer which changes just one > character and cursor position, and emit sequence to update it in Unix > terminal, which could be just "\rC" (or even "C" if cursor was already > at the beginning of the line). Another example would be long lines: > conhost will emit additional EOLs instead of depending on embedder to > wrap the line. I'm not really familiar with DejaGnu, but if you want to > match application output, that's probably not what you're looking for. > > > The reason the previous workaround of compiling Wine without ncurses > worked is that if made Wine treat tty stdin/stdout in a way very similar > to regular pipes, so no extra processing was performed. This was more of > a side effect than a design choice. It should be possible to provide > some way to achieve that with the new Wine architecture. I'm attaching > an example of Wine patch that would allow it. With that patch, you may > disable conhost.exe (via winecfg or WINEDLLOVERRIDES=conhost.exe=d > environment variable) and achieve something similar to previous workaround. > > > Long term, I think that it would be best to get rid of console behaviour > expectations by using Windows build of DejaGnu. My understanding is that > it requires Cygwin, so the stack would be: Windows DejaGnu on Cygwin on > Wine on Linux. This would make all similar mismatches in expectations > non-existent. Cygwin is tricky to run on Wine, there are a few known > problems like [3], but we're getting there. > > > Jacek > > > [1] https://gcc.gnu.org/pipermail/fortran/2022-December/058645.html > > [2] > https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/ > > [3] https://bugs.winehq.org/show_bug.cgi?id=47808 First, a big giant thank you for this patch. I confirmed that I can use this to replace the "return immediately from init_console" hack, and it applies cleanly to 7.20. Second, the problems with extra \r's still remain, but I think we've generally come to think that that part isn't Wine and is instead either the testsuite or deja. So I'll keep those replies to Jacob's previous message.