PDF View Problems with 2.4dev

2021-02-11 Thread Richard Kimberly Heck
Hi, all,

I've been using current master for work lately, and I'm getting frequent
errors when viewing a fairly simple master-child document. The structure is:

TITLE ETC
INCLUDE CHILD, which has most of the content
BIBLIOGRAPHY

On viewing (usually, this is master-buffer-view, from the child), I
often get an "aux file not found" error. Re-doing the view usually
solves the problem.

Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Richard Kimberly Heck
On 2/11/21 11:19 PM, Thibaut Cuvelier wrote:
> On Thu, 11 Feb 2021 at 20:52, Thibaut Cuvelier  > wrote:
>
> On Thu, 11 Feb 2021 at 20:05, José Abílio Matos  > wrote:
>
> On Thursday, February 11, 2021 4:02:19 PM WET Yu Jin wrote:
> > Will be pointless imo, it's not the script's fault that
> python is not found.
> > The fault is to be searched in the part of code which adds
> the prefix path
> > to the environment, which part would that be? After all when
> installing,
> > the installer adds the prefix path to its environment too on
> runtime while
> > installing and then calls the script, it is successful then.
>
> Does Tools->Reconfigure works after adding the python path in
> the environment
> variable?
>
> I expect it to work. If it works that means that the
> configure.py changes are
> not the culprit.
>
>
> In my case, LyX can reconfigure once its PATH includes Python.
>
>
> I just checked that the situation is quite weird: in Tools >
> Preferences > Paths, I have "C:\Program Files\MiKTeX
> 2.9\miktex\bin\x64;$LyXDir\bin;$LyXDir\Python;$LyXDir\Python\Lib;$LyXDir\imagemagick;$LyXDir\ghostscript\bin",
> meaning that LyX should really consider its built-in version of
> Python, but (re)configure always fails if Python is not in the
> environment variable PATH does not contain Python before LyX starts.

Does it fail if you try to reconfigure once LyX has launched? If so, can
you please open View> Messages, then activate "Files Used By LyX", and
reconfigure? I see, at the top

00:43:30.779: python3 -tt "/usr/local/share/lyx/configure.py"
--binary-dir="/usr/local/bin/"

That is the command LyX is using to try to reconfigure.

Maybe we need also to check what the environment is at that point?

Riki

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Thibaut Cuvelier
On Thu, 11 Feb 2021 at 20:52, Thibaut Cuvelier  wrote:

> On Thu, 11 Feb 2021 at 20:05, José Abílio Matos  wrote:
>
>> On Thursday, February 11, 2021 4:02:19 PM WET Yu Jin wrote:
>> > Will be pointless imo, it's not the script's fault that python is not
>> found.
>> > The fault is to be searched in the part of code which adds the prefix
>> path
>> > to the environment, which part would that be? After all when installing,
>> > the installer adds the prefix path to its environment too on runtime
>> while
>> > installing and then calls the script, it is successful then.
>>
>> Does Tools->Reconfigure works after adding the python path in the
>> environment
>> variable?
>>
>> I expect it to work. If it works that means that the configure.py changes
>> are
>> not the culprit.
>>
>
> In my case, LyX can reconfigure once its PATH includes Python.
>

I just checked that the situation is quite weird: in Tools > Preferences >
Paths, I have "C:\Program Files\MiKTeX
2.9\miktex\bin\x64;$LyXDir\bin;$LyXDir\Python;$LyXDir\Python\Lib;$LyXDir\imagemagick;$LyXDir\ghostscript\bin",
meaning that LyX should really consider its built-in version of Python, but
(re)configure always fails if Python is not in the environment variable
PATH does not contain Python before LyX starts.
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: FindAdv, request for comments

2021-02-11 Thread Scott Kostyshak
On Thu, Feb 11, 2021 at 04:30:32PM +0100, Kornel Benko wrote:
> Am Wed, 10 Feb 2021 00:38:15 -0500
> schrieb Scott Kostyshak :

> > That is, without a unit test
> > framework and an extensive set of unit tests, I would be hesitant to
> > change anything.
> 
> Even with unit tests, you cannot be sure that the tests include all possible 
> cases.
> But I agree.

Good point. It would take a long time to build up an extensive set of tests.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Windows installer: add version in all shortcuts

2021-02-11 Thread Thibaut Cuvelier
Hi Eugene,

I proposed in another discussion to add the version in all shortcuts
created by the installer, for specifically the case where the user has
several versions of LyX (or just updated, in which case there will be a
delay before the new shortcut gets into the search cache of the Start menu).

Here is the patch I propose. I am by no means a NSIS expert, I don't know
if this will work, but I think there is a probability that it does.

What do you think of this?
Thibaut Cuvelier
Index: development/Win32/packaging/installer/src/main.nsh
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===
diff --git a/development/Win32/packaging/installer/src/main.nsh b/development/Win32/packaging/installer/src/main.nsh
--- a/development/Win32/packaging/installer/src/main.nsh	(revision 6f4bc061788c08fde3738dc3800fc35845ee6ff3)
+++ b/development/Win32/packaging/installer/src/main.nsh	(date 1613080716757)
@@ -913,9 +913,9 @@
   !insertmacro MUI_STARTMENU_WRITE_BEGIN startmenuPage # This macro also assures that the folder is not empty for us
 SetOutPath "$INSTDIR\bin" # Need to set this so that the shortcut to lyx.exe is executed in the bin folder
 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
-CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LyX.lnk" "$INSTDIR\bin\LyX.exe" "" "" "" "" "" "LyX - The Document Processor" # Last parameter is the comment of the shortcut
+CreateShortCut "$SMPROGRAMS\$StartMenuFolder\LyX ${APP_VERSION}.lnk" "$INSTDIR\bin\LyX.exe" "" "" "" "" "" "LyX - The Document Processor" # Last parameter is the comment of the shortcut
 SetOutPath $INSTDIR
-CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall LyX.lnk" "$INSTDIR\Uninstall-LyX.exe"
+CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall LyX ${APP_VERSION}.lnk" "$INSTDIR\Uninstall-LyX.exe"
 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\LyX Website.url" "InternetShortcut" "URL" "https://www.lyx.org/;
 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\LyX Wiki.url" "InternetShortcut" "URL" "https://wiki.lyx.org;
   !insertmacro MUI_STARTMENU_WRITE_END
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Thibaut Cuvelier
On Thu, 11 Feb 2021 at 22:09, Richard Kimberly Heck 
wrote:

> On 2/11/21 4:04 PM, José Abílio Matos wrote:
> > On Thursday, February 11, 2021 7:53:36 PM WET Thibaut Cuvelier wrote:
> >> I would guess it is os::find_python_binary. But it has not been touched
> in a
> >> long time.
> >>
> >> It's highly likely that it does. On Windows, the first thing this
> function
> >> checks is `py -3`, but I haven't seen any py binary in a long time
> >> (although I've been using the Anaconda Python distribution for quite
> some
> >> time).
> > Since we require python to run maybe it would make sense to add the
> > information that comes from os::find_python to "Help -> About LyX".
> >
> > What do you think? (this is meant to every one not just Thibaut) :-)
>
> I think that's a good idea. I can do it later tonight unless someone
> beats me to it.
>
> We need a couple other fixes to the dialog, too, anyway.
>

+1 for the idea too. It might also be good to show all the versions of
anything (not purely TeX-based) that LyX might use and that has been
discovered by configure.py. It might also be useful to indicate which
version was chosen, i.e. bundled or no (e.g., the bundled Python or Perl).
For TeX stuff, maybe Tools > TeX Information is enough? I frankly have no
idea…
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Thibaut Cuvelier
On Thu, 11 Feb 2021 at 22:03, Yu Jin  wrote:

> Am Do., 11. Feb. 2021 um 20:53 Uhr schrieb Thibaut Cuvelier <
> tcuvel...@lyx.org>:
>
>> On Thu, 11 Feb 2021 at 20:05, Richard Kimberly Heck 
>> wrote:
>>
>>> On 2/11/21 11:02 AM, Yu Jin wrote:
>>>
>>> Am Do., 11. Feb. 2021 um 00:02 Uhr schrieb Richard Kimberly Heck <
>>> rikih...@lyx.org>:
>>>
 On 2/10/21 4:28 PM, Yu Jin wrote:

 Am Mi., 10. Feb. 2021 um 20:23 Uhr schrieb Richard Kimberly Heck <
 rikih...@lyx.org>:

> On 2/10/21 2:14 PM, Thibaut Cuvelier wrote:
>
> On Wed, 10 Feb 2021 at 18:34, José Abílio Matos 
> wrote:
>
>> On Wednesday, February 10, 2021 12:48:17 PM WET Thibaut Cuvelier
>> wrote:
>> > @José : reconfiguring LyX does not solve the problem. It really
>> looks like
>> > it cannot find Python.
>>
>> We did not change the python detection code since alpha-1... :-(
>>
>
> However, this must be the cause of the problems. I just tried adding
> Python to the PATH environment variable, and everything worked perfectly.
>
> Maybe LyX is tricked in some way by the python.exe that Microsoft puts
> in the PATH? (It's not a real Python, just something that tells you how to
> install it.) With this, you can start "a Python executable", but it will
> not execute any script (I believe it always returns an error code).
>
> That may be. Where do we record what Python we found?
>
> If so, then the solution would be to try running some simple Python
> file using whatever we find and see if that works. E.g. run the program
> "1;".
>
 I have contributed some lines to python recognition on windows (
 https://www.lyx.org/trac/ticket/11712): But because of what was
 written by Thibaut (adding Python to PATH), it  looks to me that the
 failure is not in this function but in rather LyX failing to add path
 prefix. I can also reproduce this btw. I have checked the path prefix in
 the settings, all is done right there. But even if I add python dir to
 PATH, it then will not find other dependencies (imagemagik and 
 ghostscript).

 I would try reverting all the changes to configure.py since alpha 1 and
 see if that fixes the problem. We did not get this report with alpha 1.
 These are:

 f7beed1e
 e95513c8
 9d4ffac7
 e3fe4d65
 daa6f143
 c0fe2522
 af49df00
 738dccbf

 If that helps, then add them back one at a time and find the culprit.

>>> Will be pointless imo, it's not the script's fault that python is not
>>> found. The fault is to be searched in the part of code which adds the
>>> prefix path to the environment, which part would that be?
>>> After all when installing, the installer adds the prefix path to its
>>> environment too on runtime while installing and then calls the script, it
>>> is successful then.
>>>
>>> I would guess it is os::find_python_binary. But it has not been touched
>>> in a long time.
>>>
>> It's highly likely that it does. On Windows, the first thing this
>> function checks is `py -3`, but I haven't seen any py binary in a long time
>> (although I've been using the Anaconda Python distribution for quite some
>> time).
>>
> py is py.exe, which is the python launcher on windows, ask google. How can
> it be broken if it does find python after adding the python dir to PATH?
>

Google is not always right: I don't have such a thing on my machines.
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Richard Kimberly Heck

On 2/11/21 4:04 PM, José Abílio Matos wrote:

On Thursday, February 11, 2021 7:53:36 PM WET Thibaut Cuvelier wrote:

I would guess it is os::find_python_binary. But it has not been touched in a
long time.

It's highly likely that it does. On Windows, the first thing this function
checks is `py -3`, but I haven't seen any py binary in a long time
(although I've been using the Anaconda Python distribution for quite some
time).

Since we require python to run maybe it would make sense to add the
information that comes from os::find_python to "Help -> About LyX".

What do you think? (this is meant to every one not just Thibaut) :-)


PS For now, I think enabling debug info for 'file' will show what Python 
is being called.


Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Richard Kimberly Heck

On 2/11/21 4:04 PM, José Abílio Matos wrote:

On Thursday, February 11, 2021 7:53:36 PM WET Thibaut Cuvelier wrote:

I would guess it is os::find_python_binary. But it has not been touched in a
long time.

It's highly likely that it does. On Windows, the first thing this function
checks is `py -3`, but I haven't seen any py binary in a long time
(although I've been using the Anaconda Python distribution for quite some
time).

Since we require python to run maybe it would make sense to add the
information that comes from os::find_python to "Help -> About LyX".

What do you think? (this is meant to every one not just Thibaut) :-)


I think that's a good idea. I can do it later tonight unless someone 
beats me to it.


We need a couple other fixes to the dialog, too, anyway.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread José Abílio Matos
On Thursday, February 11, 2021 7:53:36 PM WET Thibaut Cuvelier wrote:
> I would guess it is os::find_python_binary. But it has not been touched in a
> long time.
> 
> It's highly likely that it does. On Windows, the first thing this function
> checks is `py -3`, but I haven't seen any py binary in a long time
> (although I've been using the Anaconda Python distribution for quite some
> time).

Since we require python to run maybe it would make sense to add the 
information that comes from os::find_python to "Help -> About LyX".

What do you think? (this is meant to every one not just Thibaut) :-)

Best regards,
-- 
José Abílio


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Yu Jin
Am Do., 11. Feb. 2021 um 20:53 Uhr schrieb Thibaut Cuvelier <
tcuvel...@lyx.org>:

> On Thu, 11 Feb 2021 at 20:05, Richard Kimberly Heck 
> wrote:
>
>> On 2/11/21 11:02 AM, Yu Jin wrote:
>>
>> Am Do., 11. Feb. 2021 um 00:02 Uhr schrieb Richard Kimberly Heck <
>> rikih...@lyx.org>:
>>
>>> On 2/10/21 4:28 PM, Yu Jin wrote:
>>>
>>> Am Mi., 10. Feb. 2021 um 20:23 Uhr schrieb Richard Kimberly Heck <
>>> rikih...@lyx.org>:
>>>
 On 2/10/21 2:14 PM, Thibaut Cuvelier wrote:

 On Wed, 10 Feb 2021 at 18:34, José Abílio Matos 
 wrote:

> On Wednesday, February 10, 2021 12:48:17 PM WET Thibaut Cuvelier wrote:
> > @José : reconfiguring LyX does not solve the problem. It really
> looks like
> > it cannot find Python.
>
> We did not change the python detection code since alpha-1... :-(
>

 However, this must be the cause of the problems. I just tried adding
 Python to the PATH environment variable, and everything worked perfectly.

 Maybe LyX is tricked in some way by the python.exe that Microsoft puts
 in the PATH? (It's not a real Python, just something that tells you how to
 install it.) With this, you can start "a Python executable", but it will
 not execute any script (I believe it always returns an error code).

 That may be. Where do we record what Python we found?

 If so, then the solution would be to try running some simple Python
 file using whatever we find and see if that works. E.g. run the program
 "1;".

>>> I have contributed some lines to python recognition on windows (
>>> https://www.lyx.org/trac/ticket/11712): But because of what was written
>>> by Thibaut (adding Python to PATH), it  looks to me that the failure is not
>>> in this function but in rather LyX failing to add path prefix. I can also
>>> reproduce this btw. I have checked the path prefix in the settings, all is
>>> done right there. But even if I add python dir to PATH, it then will not
>>> find other dependencies (imagemagik and ghostscript).
>>>
>>> I would try reverting all the changes to configure.py since alpha 1 and
>>> see if that fixes the problem. We did not get this report with alpha 1.
>>> These are:
>>>
>>> f7beed1e
>>> e95513c8
>>> 9d4ffac7
>>> e3fe4d65
>>> daa6f143
>>> c0fe2522
>>> af49df00
>>> 738dccbf
>>>
>>> If that helps, then add them back one at a time and find the culprit.
>>>
>> Will be pointless imo, it's not the script's fault that python is not
>> found. The fault is to be searched in the part of code which adds the
>> prefix path to the environment, which part would that be?
>> After all when installing, the installer adds the prefix path to its
>> environment too on runtime while installing and then calls the script, it
>> is successful then.
>>
>> I would guess it is os::find_python_binary. But it has not been touched
>> in a long time.
>>
> It's highly likely that it does. On Windows, the first thing this function
> checks is `py -3`, but I haven't seen any py binary in a long time
> (although I've been using the Anaconda Python distribution for quite some
> time).
>
py is py.exe, which is the python launcher on windows, ask google. How can
it be broken if it does find python after adding the python dir to PATH?
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Yu Jin
Am Do., 11. Feb. 2021 um 20:05 Uhr schrieb José Abílio Matos <
jama...@lyx.org>:

> On Thursday, February 11, 2021 4:02:19 PM WET Yu Jin wrote:
> > Will be pointless imo, it's not the script's fault that python is not
> found.
> > The fault is to be searched in the part of code which adds the prefix
> path
> > to the environment, which part would that be? After all when installing,
> > the installer adds the prefix path to its environment too on runtime
> while
> > installing and then calls the script, it is successful then.
>
> Does Tools->Reconfigure works after adding the python path in the
> environment
> variable?
>
As written before, after adding, python is found, so the script actually
starts, but it does not find other binaries (ghostscript and imagemagick)
which are also in the path prefix.

>
> I expect it to work. If it works that means that the configure.py changes
> are
> not the culprit.
>
> Eugene, could it be some change in the windows installer between alpha 1
> and
> alpha 2?
>

There were no changes in the installer.

Again, imo the part which adds path prefix (see attachment) to the runtime
environment must be broken.
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Thibaut Cuvelier
On Thu, 11 Feb 2021 at 20:05, Richard Kimberly Heck 
wrote:

> On 2/11/21 11:02 AM, Yu Jin wrote:
>
> Am Do., 11. Feb. 2021 um 00:02 Uhr schrieb Richard Kimberly Heck <
> rikih...@lyx.org>:
>
>> On 2/10/21 4:28 PM, Yu Jin wrote:
>>
>> Am Mi., 10. Feb. 2021 um 20:23 Uhr schrieb Richard Kimberly Heck <
>> rikih...@lyx.org>:
>>
>>> On 2/10/21 2:14 PM, Thibaut Cuvelier wrote:
>>>
>>> On Wed, 10 Feb 2021 at 18:34, José Abílio Matos  wrote:
>>>
 On Wednesday, February 10, 2021 12:48:17 PM WET Thibaut Cuvelier wrote:
 > @José : reconfiguring LyX does not solve the problem. It really looks
 like
 > it cannot find Python.

 We did not change the python detection code since alpha-1... :-(

>>>
>>> However, this must be the cause of the problems. I just tried adding
>>> Python to the PATH environment variable, and everything worked perfectly.
>>>
>>> Maybe LyX is tricked in some way by the python.exe that Microsoft puts
>>> in the PATH? (It's not a real Python, just something that tells you how to
>>> install it.) With this, you can start "a Python executable", but it will
>>> not execute any script (I believe it always returns an error code).
>>>
>>> That may be. Where do we record what Python we found?
>>>
>>> If so, then the solution would be to try running some simple Python file
>>> using whatever we find and see if that works. E.g. run the program "1;".
>>>
>> I have contributed some lines to python recognition on windows (
>> https://www.lyx.org/trac/ticket/11712): But because of what was written
>> by Thibaut (adding Python to PATH), it  looks to me that the failure is not
>> in this function but in rather LyX failing to add path prefix. I can also
>> reproduce this btw. I have checked the path prefix in the settings, all is
>> done right there. But even if I add python dir to PATH, it then will not
>> find other dependencies (imagemagik and ghostscript).
>>
>> I would try reverting all the changes to configure.py since alpha 1 and
>> see if that fixes the problem. We did not get this report with alpha 1.
>> These are:
>>
>> f7beed1e
>> e95513c8
>> 9d4ffac7
>> e3fe4d65
>> daa6f143
>> c0fe2522
>> af49df00
>> 738dccbf
>>
>> If that helps, then add them back one at a time and find the culprit.
>>
> Will be pointless imo, it's not the script's fault that python is not
> found. The fault is to be searched in the part of code which adds the
> prefix path to the environment, which part would that be?
> After all when installing, the installer adds the prefix path to its
> environment too on runtime while installing and then calls the script, it
> is successful then.
>
> I would guess it is os::find_python_binary. But it has not been touched in
> a long time.
>
It's highly likely that it does. On Windows, the first thing this function
checks is `py -3`, but I haven't seen any py binary in a long time
(although I've been using the Anaconda Python distribution for quite some
time).
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Thibaut Cuvelier
On Thu, 11 Feb 2021 at 20:05, José Abílio Matos  wrote:

> On Thursday, February 11, 2021 4:02:19 PM WET Yu Jin wrote:
> > Will be pointless imo, it's not the script's fault that python is not
> found.
> > The fault is to be searched in the part of code which adds the prefix
> path
> > to the environment, which part would that be? After all when installing,
> > the installer adds the prefix path to its environment too on runtime
> while
> > installing and then calls the script, it is successful then.
>
> Does Tools->Reconfigure works after adding the python path in the
> environment
> variable?
>
> I expect it to work. If it works that means that the configure.py changes
> are
> not the culprit.
>

In my case, LyX can reconfigure once its PATH includes Python.
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Richard Kimberly Heck

On 2/11/21 11:02 AM, Yu Jin wrote:
Am Do., 11. Feb. 2021 um 00:02 Uhr schrieb Richard Kimberly Heck 
mailto:rikih...@lyx.org>>:


On 2/10/21 4:28 PM, Yu Jin wrote:

Am Mi., 10. Feb. 2021 um 20:23 Uhr schrieb Richard Kimberly Heck
mailto:rikih...@lyx.org>>:

On 2/10/21 2:14 PM, Thibaut Cuvelier wrote:

On Wed, 10 Feb 2021 at 18:34, José Abílio Matos
mailto:jama...@lyx.org>> wrote:

On Wednesday, February 10, 2021 12:48:17 PM WET Thibaut
Cuvelier wrote:
> @José : reconfiguring LyX does not solve the problem.
It really looks like
> it cannot find Python.

We did not change the python detection code since
alpha-1... :-(


However, this must be the cause of the problems. I just
tried adding Python to the PATH environment variable, and
everything worked perfectly.

Maybe LyX is tricked in some way by the python.exe that
Microsoft puts in the PATH? (It's not a real Python, just
something that tells you how to install it.) With this, you
can start "a Python executable", but it will not execute any
script (I believe it always returns an error code).


That may be. Where do we record what Python we found?

If so, then the solution would be to try running some simple
Python file using whatever we find and see if that works.
E.g. run the program "1;".

I have contributed some lines to python recognition on windows
(https://www.lyx.org/trac/ticket/11712
): But because of what was
written by Thibaut (adding Python to PATH), it  looks to me that
the failure is not in this function but in rather LyX failing to
add path prefix. I can also reproduce this btw. I have checked
the path prefix in the settings, all is done right there. But
even if I add python dir to PATH, it then will not find other
dependencies (imagemagik and ghostscript).


I would try reverting all the changes to configure.py since alpha
1 and see if that fixes the problem. We did not get this report
with alpha 1. These are:

f7beed1e
e95513c8
9d4ffac7
e3fe4d65
daa6f143
c0fe2522
af49df00
738dccbf

If that helps, then add them back one at a time and find the culprit.

Will be pointless imo, it's not the script's fault that python is not 
found. The fault is to be searched in the part of code which adds the 
prefix path to the environment, which part would that be?
After all when installing, the installer adds the prefix path to its 
environment too on runtime while installing and then calls the script, 
it is successful then.


I would guess it is os::find_python_binary. But it has not been touched 
in a long time.


Riki


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread José Abílio Matos
On Thursday, February 11, 2021 4:02:19 PM WET Yu Jin wrote:
> Will be pointless imo, it's not the script's fault that python is not found.
> The fault is to be searched in the part of code which adds the prefix path
> to the environment, which part would that be? After all when installing,
> the installer adds the prefix path to its environment too on runtime while
> installing and then calls the script, it is successful then.

Does Tools->Reconfigure works after adding the python path in the environment 
variable?

I expect it to work. If it works that means that the configure.py changes are 
not the culprit.

Eugene, could it be some change in the windows installer between alpha 1 and 
alpha 2?

Best regards,
-- 
José Abílio


-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: 2.4 alpha2 failing on windows 10

2021-02-11 Thread Yu Jin
Am Do., 11. Feb. 2021 um 00:02 Uhr schrieb Richard Kimberly Heck <
rikih...@lyx.org>:

> On 2/10/21 4:28 PM, Yu Jin wrote:
>
> Am Mi., 10. Feb. 2021 um 20:23 Uhr schrieb Richard Kimberly Heck <
> rikih...@lyx.org>:
>
>> On 2/10/21 2:14 PM, Thibaut Cuvelier wrote:
>>
>> On Wed, 10 Feb 2021 at 18:34, José Abílio Matos  wrote:
>>
>>> On Wednesday, February 10, 2021 12:48:17 PM WET Thibaut Cuvelier wrote:
>>> > @José : reconfiguring LyX does not solve the problem. It really looks
>>> like
>>> > it cannot find Python.
>>>
>>> We did not change the python detection code since alpha-1... :-(
>>>
>>
>> However, this must be the cause of the problems. I just tried adding
>> Python to the PATH environment variable, and everything worked perfectly.
>>
>> Maybe LyX is tricked in some way by the python.exe that Microsoft puts in
>> the PATH? (It's not a real Python, just something that tells you how to
>> install it.) With this, you can start "a Python executable", but it will
>> not execute any script (I believe it always returns an error code).
>>
>> That may be. Where do we record what Python we found?
>>
>> If so, then the solution would be to try running some simple Python file
>> using whatever we find and see if that works. E.g. run the program "1;".
>>
> I have contributed some lines to python recognition on windows (
> https://www.lyx.org/trac/ticket/11712): But because of what was written
> by Thibaut (adding Python to PATH), it  looks to me that the failure is not
> in this function but in rather LyX failing to add path prefix. I can also
> reproduce this btw. I have checked the path prefix in the settings, all is
> done right there. But even if I add python dir to PATH, it then will not
> find other dependencies (imagemagik and ghostscript).
>
> I would try reverting all the changes to configure.py since alpha 1 and
> see if that fixes the problem. We did not get this report with alpha 1.
> These are:
>
> f7beed1e
> e95513c8
> 9d4ffac7
> e3fe4d65
> daa6f143
> c0fe2522
> af49df00
> 738dccbf
>
> If that helps, then add them back one at a time and find the culprit.
>
Will be pointless imo, it's not the script's fault that python is not
found. The fault is to be searched in the part of code which adds the
prefix path to the environment, which part would that be?
After all when installing, the installer adds the prefix path to its
environment too on runtime while installing and then calls the script, it
is successful then.
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: FindAdv, request for comments

2021-02-11 Thread Kornel Benko
Am Wed, 10 Feb 2021 00:38:15 -0500
schrieb Scott Kostyshak :

> On Mon, Jan 25, 2021 at 02:02:09PM +0100, Kornel Benko wrote:
> > Problems with FindAdv and search with not ignored format
> > 
> > What we have now is something 'neither fish nor fowl'.
> > 
> > For instance for the search of characters with a specific size
> > we use strings/regexes wrapped with the size-spec. All is nice, until the 
> > size is the
> > default in the document. In that case the wrapping has no effect (because 
> > the text
> > created by latex output does not contain this info)
> > 
> > Same is valid for language, color, family, series, shape, etc.
> > Also we don't have the options to exclude characters with specific features 
> > from
> > search. (like search for words which are not part of a Latin sequence)
> > 
> > I am not sure, if investing more into this (without creating a nex 
> > export-type for
> > search (ala Docbook)) would get better sollutions.
> > 
> > Comment are appreciated.  
> 
> I use Advanced Find about once a week and for those times it is just the
> right tool for the job. However, when I use it with certain combinations
> of regexes and settings, I do not not just use it without thinking about
> it and assuming that it does what I intended. I use it to do the
> find/replace or whatever I'm doing, and then I look at "git diff" of the
> document I modified to do a quick double-check, and then I do a manual
> search to see if I missed anything else. As long as I proceed with that
> caution, it's a helpful tool to me personally. And thinking about it
> more, when I do a regex find/replace in Vim I also always proceed with
> caution and do double-checking. I think this indicates that I really
> don't trust myself to get the regex right the first time.

This is excellent procedure.

> I don't know how to answer your questions since I don't know the code.
> But I feel it will be impossible to fix everything for it. Also, I think
> that this is a good example where having unit tests would be
> considerably better than the autotests.

Maybe, but still there has to be someone creating the tests.

> That is, without a unit test
> framework and an extensive set of unit tests, I would be hesitant to
> change anything.

Even with unit tests, you cannot be sure that the tests include all possible 
cases.
But I agree.

> But that's just because the code looks scary to me.
> Also, I haven't tried the autotests in a while so maybe those work
> better than I remember.

I corrected some of the findadv tests, so they should work.
OTOH, they are way slower than the unit tests from Yuriy.

> I guess what I'm saying is I'm glad you spent a
> good chunk of time on it and fixed a bunch of issues all at once because
> I think whoever edits the code really needs to get a feeling for it.
> This part of the code does not seem like an area where one can casually
> drop in and fix individual bugs from time to time without unit tests
> that would check that nothing else is broken.
> 
> In any case, thanks a lot for bravely tackling the code and improving
> it! I've been using it on master and it is more accurate and faster than
> before. My "trust" of it has definitely increased.

Thanks :)

> Scott

Kornel



pgpmsmAGmlBvV.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Use C++ testing framework

2021-02-11 Thread Kornel Benko
Am Thu, 11 Feb 2021 13:54:23 +0200
schrieb Yuriy Skalko :

> > Compiles fine.
> > Test is very fast (no options used)
> > 
> > Is that the expected output?
> > ...
> > [doctest] doctest version is "2.4.5"
> > [doctest] run with "--help" for options
> > ===
> > [doctest] test cases:  14 |  14 passed | 0 failed | 0 skipped
> > [doctest] assertions: 108 | 108 passed | 0 failed |
> > [doctest] Status: SUCCESS!
> > 
> > 
> > Kornel  
> 
> Thanks for a quick try, Kornel.
> 
> Yes, this is an expected output. It is pretty fast now and I hope it 
> will remain fast with more tests. Now most time is spent by LyX startup 
> (loading layouts etc).
> 
> I presume you'll be interested in trying it to test Advanced Search. The 
> src/test/issues/12069.cpp can be used as a sample.
> 

Yes, but later.
(I have my own unit test for this, without the need to compile lyx,
so the new tests will not help me much ATM. But it is good idea for later)

> Yuriy

Kornel



pgpJdAmdhHS47.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Use C++ testing framework

2021-02-11 Thread Yuriy Skalko

Compiles fine.
Test is very fast (no options used)

Is that the expected output?
...
[doctest] doctest version is "2.4.5"
[doctest] run with "--help" for options
===
[doctest] test cases:  14 |  14 passed | 0 failed | 0 skipped
[doctest] assertions: 108 | 108 passed | 0 failed |
[doctest] Status: SUCCESS!


Kornel


Thanks for a quick try, Kornel.

Yes, this is an expected output. It is pretty fast now and I hope it 
will remain fast with more tests. Now most time is spent by LyX startup 
(loading layouts etc).


I presume you'll be interested in trying it to test Advanced Search. The 
src/test/issues/12069.cpp can be used as a sample.



Yuriy
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Use C++ testing framework

2021-02-11 Thread Kornel Benko
Am Thu, 11 Feb 2021 11:35:10 +0200
schrieb Yuriy Skalko :

> > I'm all for focusing on 2.4.0 release. So I'll not push yet my commits into 
> > newly
> > created branch features/unit-test-adoption.  
> 
> 
> After some time-out I've pushed my work on unit testing into 
> unit-test-adoption branch in features repository. So if you have some 
> free time and are interested, please try it.
> 
> Here are some notes:
> 
> * Now it supports CMake only
> * I've added a short section documenting this in Development manual
> * There are several changes that makes testing easier/possible:
>  - (Inset...) made several virtual methods public (as in base class 
> Inset) that wrongly were private in several derived classes
>  - (lyxfind) made public findOne function to get rid of messagebox 
> displaying
>  - (ExternalTransforms) throw an exception instead of direct output 
> to lyxerr stream to get clean console output when running tests
> 
> 
> Yuriy

Compiles fine.
Test is very fast (no options used)

Is that the expected output?
...
[doctest] doctest version is "2.4.5"
[doctest] run with "--help" for options
===
[doctest] test cases:  14 |  14 passed | 0 failed | 0 skipped
[doctest] assertions: 108 | 108 passed | 0 failed |
[doctest] Status: SUCCESS!


Kornel


pgp0OAkcsyOc6.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Use C++ testing framework

2021-02-11 Thread Yuriy Skalko

I'm all for focusing on 2.4.0 release. So I'll not push yet my commits into 
newly created branch features/unit-test-adoption.



After some time-out I've pushed my work on unit testing into 
unit-test-adoption branch in features repository. So if you have some 
free time and are interested, please try it.


Here are some notes:

* Now it supports CMake only
* I've added a short section documenting this in Development manual
* There are several changes that makes testing easier/possible:
- (Inset...) made several virtual methods public (as in base class 
Inset) that wrongly were private in several derived classes
- (lyxfind) made public findOne function to get rid of messagebox 
displaying
- (ExternalTransforms) throw an exception instead of direct output 
to lyxerr stream to get clean console output when running tests



Yuriy
--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel