Re: setup 2.888 crashes on --prune-install

2018-02-26 Thread Jon Turney

On 24/02/2018 14:58, Jon Turney wrote:

On 20/02/2018 18:33, Andrew Schulman wrote:




[...]

Problem 1/97


!


Augmented Transaction List:
    0   erase    base 0.0-0


!!

Yeah, that's not working right... :(

I fixed the crash problem in 2.889, but there's other things wrong here: 
for starters, the default solution we are picking aren't the best.


Attached is a patch which tries to improve the default solution 
selection (although this could be still better, and of course a UI to 
actually let solutions be chosen would also be good)


From f6903b67f3728f9c77eb4a2942fe3eb7268737f2 Mon Sep 17 00:00:00 2001
From: Jon Turney 
Date: Wed, 21 Feb 2018 16:28:48 +
Subject: [PATCH setup] Improve default solution selection

Pick a solution which looks like it removes non-lock tasks from the task
list.  This kind of works because lock tasks are usually created from a
default keep choice, rather than from an explicit selection, although really
we need to track somehow if the task was created from a user choice and use
that as the criteria here...
---
 libsolv.cc | 37 ++---
 libsolv.h  |  1 +
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/libsolv.cc b/libsolv.cc
index 32d60e6..140ace9 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -922,8 +922,8 @@ void SolverSolution::applyDefaultProblemSolutions()
   int pcnt = solver_problem_count(solv);
   for (Id problem = 1; problem <= pcnt; problem++)
 {
-  int scnt = solver_solution_count(solv, problem);
-  solver_take_solution(solv, problem, scnt, );
+  int default_soln = guessDefaultSolution(problem);
+  solver_take_solution(solv, problem, default_soln, );
 }
 
   // re-solve
@@ -937,6 +937,36 @@ SolverSolution::transactions() const
   return trans;
 }
 
+// pick a default solution
+Id SolverSolution::guessDefaultSolution(Id problem) const
+{
+  int scnt = solver_solution_count(solv, problem);
+
+  // search backwards for the first solution which only consists of
+  // SOLVER_SOLUTION_JOB solution elements pointing to SOLVER_INSTALL or
+  // SOLVER_ERASE jobs (i.e. only removes install or erase tasks from task 
list)
+  for (Id solution = scnt; solution > 0; solution--)
+{
+  Id p, rp, element;
+  element = 0;
+  while ((element = solver_next_solutionelement(solv, problem, solution, 
element, , )) != 0)
+{
+  if (p != SOLVER_SOLUTION_JOB)
+break;
+
+  Id j = job.elements[rp-1] & SOLVER_JOBMASK;
+  if (!(j == SOLVER_INSTALL || j == SOLVER_ERASE))
+break;
+}
+
+  if (element == 0)
+return solution;
+}
+
+  // failing that, pick the last solution
+  return scnt;
+}
+
 // Construct a string reporting the problems and solutions
 std::string
 SolverSolution::report() const
@@ -959,10 +989,11 @@ SolverSolution::report() const
   r += "\n";
 
   int scnt = solver_solution_count(solv, problem);
+  Id default_soln_id = guessDefaultSolution(problem);
   for (Id solution = 1; solution <= scnt; solution++)
 {
   r += "Solution " + std::to_string(solution) + "/" + 
std::to_string(scnt);
-  if (solution == scnt) r += " (default)";
+  if (solution == default_soln_id) r += " (default)";
   r += "\n";
 
   Id p, rp, element;
diff --git a/libsolv.h b/libsolv.h
index 6a6e0b3..3066fea 100644
--- a/libsolv.h
+++ b/libsolv.h
@@ -266,6 +266,7 @@ class SolverSolution
   bool solve();
   void tasksToJobs(SolverTasks , updateMode update, Queue );
   void solutionToTransactionList();
+  Id guessDefaultSolution(Id problem) const;
 
   SolverPool 
   Solver *solv;
-- 
2.16.2



Re: setup 2.888 crashes on --prune-install

2018-02-24 Thread Jon Turney

On 20/02/2018 18:33, Andrew Schulman wrote:

When I run setup-x86_64.exe or setup-x86.exe with --prune-install as shown
below, it crashes. An error dialog pops up saying "setup-x86.exe has
stopped working". No other debug information appears on the console - the
whole session is shown below.

When I run the same command without --prune-install, it completes normally.

Poor setup seems to be having trouble solving all of the dependencies. Not
surprising, as my installation is old and crufty. Of course that's what I
was hoping --prune-install would help to dig me out of.



Thanks for reporting this problem.


c:\Users\x\Downloads\utilities\cygwin32>setup-x86.exe --no-shortcuts
--quiet-mode --prune-install --packages
atool,autoconf,automake,autossh,bc,bind-utils,byacc,bzr,curl,cygport,discus,dos2unix,doxygen,emacs,file,fish,flexdll,gcc-core,gcc-g++,gettext-devel,git,gnupg2,gsl-devel,help2man,lftp,libargp,libargp-devel,libcrypt-devel,libgd-devel,libiconv,libintl-devel,libncurses-devel,libneon-devel,libpcre2-devel,libpng-devel,libreadline-devel,libwrap-devel,libX11-devel,links,lndir,m4,make,multitail,ncurses,nosleep,ocaml,ocaml-camlp4,openssh,openssl-devel,orpie,p7zip,par2,patch,patchutils,pdftk,perl,pinentry,pinfo,pkg-config,procps-ng,psmisc,readline,rebase,robodoc,rsync,screen,sitecopy,sng,socat,stow,stunnel,time,tree,unison2.27,unison2.32,unison2.40,unison2.45,unison2.48,unison2.49,unison2.51,util-linux,wget,zip,


[...]

Problem 1/97


!


Augmented Transaction List:
0   erasebase 0.0-0


!!

Yeah, that's not working right... :(

I fixed the crash problem in 2.889, but there's other things wrong here: 
for starters, the default solution we are picking aren't the best.


Re: setup 2.888 crashes on --prune-install

2018-02-20 Thread Andrew Schulman
> Andrew Schulman writes:
> > When I run setup-x86_64.exe or setup-x86.exe with --prune-install as shown
> > below, it crashes. An error dialog pops up saying "setup-x86.exe has
> > stopped working". No other debug information appears on the console - the
> > whole session is shown below.
> 
> That option, as I originally implemented it, should actually leave your
> system exactly with those packages requested, without diving into
> dependencies.  In other words, that list should be self-contained, like
> you'd get from copying an existing installation from a different
> machine.  From what you were saying I guess that you rather want to use
> --delete-orphans.

Thanks. Yes, --delete-orphans is what I wanted.

And sadly I just found out that pdftk is gone :(

Andrew



Re: setup 2.888 crashes on --prune-install

2018-02-20 Thread Achim Gratz
Andrew Schulman writes:
> When I run setup-x86_64.exe or setup-x86.exe with --prune-install as shown
> below, it crashes. An error dialog pops up saying "setup-x86.exe has
> stopped working". No other debug information appears on the console - the
> whole session is shown below.

That option, as I originally implemented it, should actually leave your
system exactly with those packages requested, without diving into
dependencies.  In other words, that list should be self-contained, like
you'd get from copying an existing installation from a different
machine.  From what you were saying I guess that you rather want to use
--delete-orphans.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds


setup 2.888 crashes on --prune-install

2018-02-20 Thread Andrew Schulman
When I run setup-x86_64.exe or setup-x86.exe with --prune-install as shown
below, it crashes. An error dialog pops up saying "setup-x86.exe has
stopped working". No other debug information appears on the console - the
whole session is shown below.

When I run the same command without --prune-install, it completes normally.

Poor setup seems to be having trouble solving all of the dependencies. Not
surprising, as my installation is old and crufty. Of course that's what I
was hoping --prune-install would help to dig me out of.

Andrew

c:\Users\x\Downloads\utilities\cygwin32>setup-x86.exe --no-shortcuts
--quiet-mode --prune-install --packages
atool,autoconf,automake,autossh,bc,bind-utils,byacc,bzr,curl,cygport,discus,dos2unix,doxygen,emacs,file,fish,flexdll,gcc-core,gcc-g++,gettext-devel,git,gnupg2,gsl-devel,help2man,lftp,libargp,libargp-devel,libcrypt-devel,libgd-devel,libiconv,libintl-devel,libncurses-devel,libneon-devel,libpcre2-devel,libpng-devel,libreadline-devel,libwrap-devel,libX11-devel,links,lndir,m4,make,multitail,ncurses,nosleep,ocaml,ocaml-camlp4,openssh,openssl-devel,orpie,p7zip,par2,patch,patchutils,pdftk,perl,pinentry,pinfo,pkg-config,procps-ng,psmisc,readline,rebase,robodoc,rsync,screen,sitecopy,sng,socat,stow,stunnel,time,tree,unison2.27,unison2.32,unison2.40,unison2.45,unison2.48,unison2.49,unison2.51,util-linux,wget,zip,

Starting cygwin install, version 2.888
User has backup/restore rights
Current Directory: C:\Users\x\Downloads\utilities\cygwin32
Could not open service McShield for query, start and stop. McAfee may not
be installed, or we don't have access.
root: C:\cygwin32 system
Selected local directory: C:\Users\x\Downloads\utilities\cygwin32
net: Direct
site: http://mirrors.xmission.com/cygwin/
solving: 699 tasks, update: no, use test packages: no
Augmented Transaction List:
   0   erase_update-info-dir 03000-1
   1   erase   aria2 1.32.0-1
   2   eraseautomake 10-1
   3   erase automake1.4 1.4p6-11
   4   erase automake1.5 1.5-11
   5   erase automake1.6 1.6.3-12
   6   erase automake1.7 1.7.9-11
   7   erase automake1.8 1.8.5-11
   8   erase  bind-utils 9.11.2-2.P1
   9   erasecompface 1.5.2-12
  10   erasecurl 7.56.1-1
  11   erase cvs 1.11.23-2
  12   erasediffstat 1.61-1
  13   erase doxygen 1.8.14-2
  14   erase   emacs 25.3-1
  15   erase  fontconfig 2.12.4-1
  16   erase gcc-g++ 6.4.0-5
  17   erase   gettext-devel 0.19.8.1-2
  18   erase   ghostscript-fonts-std 20170801-4
  19   erase   gnupg 1.4.22-1
  20   erasegraphviz 2.40.1-3
  21   erase gsl 2.3-2
  22   erase   gsl-devel 2.3-2
  23   erase   inetutils 1.9.1-2
  24   erase  ipcalc 0.41-1
  25   erase libEGL1 17.3.3-1
  26   erase  libGL1 17.3.3-1
  27   eraselibXpm-devel 3.5.12-1
  28   eraselibbind9_140 9.10.4-4.P4
  29   erase libclang3.8 3.8.1-1
  30   erase libclang4.0 4.0.1-1
  31   eraselibcord1 7.6.4-1
  32   erase libdialog13 1.3-2.20160828
  33   erase   libdns166 9.11.0-3.P5
  34   erase libfontconfig-devel 2.12.4-1
  35   erase   libgccpp1 7.6.4-1
  36   erase   libgcj-common 5.4.0-1
  37   erase libgd-devel 2.2.5-1
  38   erase libgnutls28 3.3.27-1
  39   erase libgsl0 1.16-2
  40   erase  libguile17 1.8.8-3
  41   eraselibicu56 56.1-1
  42   eraselibicu57 57.1-1
  43   eraselibicu59 59.1-1
  44   erase   libirs141 9.10.4-4.P4
  45   erase