public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
@ 2021-04-28 18:30 vries at gcc dot gnu.org
  2021-04-28 18:32 ` [Bug testsuite/27788] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-04-28 18:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

            Bug ID: 27788
           Summary: FAIL: gdb.python/py-startup-opt.exp:
                    attr=dont_write_bytecode: testname: input 6: end
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

New FAIL:
...
FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input
6: end
...

In more detail:
...
(gdb) PASS: gdb.python/py-startup-opt.exp: attr=ignore_environment: testname:
input 6: end
python^M
>PASS: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 1: python
if hasattr(sys, 'flags') and getattr(sys.flags, 'dont_write_bytecode',
False):^M
>PASS: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 2: if hasattr(sys, 'flags') and getattr(sys.flags, 'dont_write_bytecode', False):
  print ("dont_write_bytecode is on")^M
>PASS: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 3:   print ("dont_write_bytecode is on")
else:^M
>PASS: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 4: else:
  print ("dont_write_bytecode is off")^M
>PASS: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 5:   print ("dont_write_bytecode is off")
end^M
dont_write_bytecode is on^M
(gdb) FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname:
input 6: end
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/27788] FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
  2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
@ 2021-04-28 18:32 ` vries at gcc dot gnu.org
  2021-04-29  8:14 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-04-28 18:32 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by:
...
$ ( unset PYTHONDONTWRITEBYTECODE;  ./test.sh )
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/27788] FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
  2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
  2021-04-28 18:32 ` [Bug testsuite/27788] " vries at gcc dot gnu.org
@ 2021-04-29  8:14 ` vries at gcc dot gnu.org
  2021-04-29  8:50 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-04-29  8:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrew.burgess at embecosm dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/27788] FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
  2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
  2021-04-28 18:32 ` [Bug testsuite/27788] " vries at gcc dot gnu.org
  2021-04-29  8:14 ` vries at gcc dot gnu.org
@ 2021-04-29  8:50 ` vries at gcc dot gnu.org
  2021-04-29  9:27 ` andrew.burgess at embecosm dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-04-29  8:50 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative patch:
...
diff --git a/gdb/testsuite/gdb.python/py-startup-opt.exp
b/gdb/testsuite/gdb.python/py-star
tup-opt.exp
index 842add30807..8315c3374d9 100644
--- a/gdb/testsuite/gdb.python/py-startup-opt.exp
+++ b/gdb/testsuite/gdb.python/py-startup-opt.exp
@@ -79,7 +79,10 @@ save_vars { env(TERM) } {
     setenv TERM ansi

     # Check the features are off by default.
-    test_python_settings "off"
+    save_vars { env(PYTHONDONTWRITEBYTECODE) } {
+       unset -nocomplain ::env(PYTHONDONTWRITEBYTECODE)
+       test_python_settings "off"
+    }

     # Create an empty directory we can use as HOME for some of the
     # tests below.  When we set XDG_CONFIG_HOME we still need to point
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/27788] FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
  2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-04-29  8:50 ` vries at gcc dot gnu.org
@ 2021-04-29  9:27 ` andrew.burgess at embecosm dot com
  2021-05-03 11:22 ` cvs-commit at gcc dot gnu.org
  2021-05-04  6:02 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: andrew.burgess at embecosm dot com @ 2021-04-29  9:27 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

--- Comment #3 from Andrew Burgess <andrew.burgess at embecosm dot com> ---
I just posted this possible fix:
  https://sourceware.org/pipermail/gdb-patches/2021-April/178329.html

This doesn't unset the environment variable.  

Given that (until Python 3.8) we can't control where .pyc files are placed, I
didn't think it was kind to unset the environment variable when the developer
clearly does not want .pyc files written to their file system.

But I'd be interested in hearing different opinions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/27788] FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
  2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-04-29  9:27 ` andrew.burgess at embecosm dot com
@ 2021-05-03 11:22 ` cvs-commit at gcc dot gnu.org
  2021-05-04  6:02 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-03 11:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

--- Comment #4 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Burgess <aburgess@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d389a1a7692d247b6153fc6a98ebc43d7070fc2e

commit d389a1a7692d247b6153fc6a98ebc43d7070fc2e
Author: Andrew Burgess <andrew.burgess@embecosm.com>
Date:   Thu Apr 29 10:11:35 2021 +0100

    gdb/testsuite: update expected results in gdb.python/py-startup-opt.exp

    The test gdb.python/py-startup-opt.exp checks the behaviour of GDB's:

      set python dont-write-bytecode on

    This flag (when on) stops Python creating .pyc files.  The test first
    checks that .pyc files will be created, then turns this option on and
    checks .pyc files will not be created.

    However, if the user has PYTHONDONTWRITEBYTECODE set in their
    environment then this will prevent Python from creating .pyc files, as
    such the first test, that .pyc files are being created, currently
    fails.

    We could unset PYTHONDONTWRITEBYTECODE, however, until Python 3.8
    there is no way to control where Python writes the .pyc files.  As the
    GDB developer clearly doesn't want .pyc files created in their
    file-system it feels wrong to silently unset this environment
    variable.

    My proposal then, is that we just spot when this environment variable
    is set and adjust the expected results.  My hope is that across all
    GDB developers some will be running with PYTHONDONTWRITEBYTECODE
    unset, so this feature will be fully tested at least some of the time.

    gdb/testsuite/ChangeLog:

            PR testsuite/27788
            * gdb.python/py-startup-opt.exp (test_python_settings): Change the
            expected results when environment variable PYTHONDONTWRITEBYTECODE
            is set.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug testsuite/27788] FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end
  2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-05-03 11:22 ` cvs-commit at gcc dot gnu.org
@ 2021-05-04  6:02 ` vries at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-04  6:02 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27788

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |11.1
         Resolution|---                         |FIXED

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Patch committed.  I've confirmed that the test-case passes again.  Marking
resolved-fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-04  6:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 18:30 [Bug testsuite/27788] New: FAIL: gdb.python/py-startup-opt.exp: attr=dont_write_bytecode: testname: input 6: end vries at gcc dot gnu.org
2021-04-28 18:32 ` [Bug testsuite/27788] " vries at gcc dot gnu.org
2021-04-29  8:14 ` vries at gcc dot gnu.org
2021-04-29  8:50 ` vries at gcc dot gnu.org
2021-04-29  9:27 ` andrew.burgess at embecosm dot com
2021-05-03 11:22 ` cvs-commit at gcc dot gnu.org
2021-05-04  6:02 ` vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).