Bug 268605

Summary: ports-mgmt/pkg_replace: update to 20230101
Product: Ports & Packages Reporter: Ken DEGUCHI <kdeguchi>
Component: Individual Port(s)Assignee: Li-Wen Hsu <lwhsu>
Status: Closed FIXED    
Severity: Affects Only Me CC: junchoon, lwhsu
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/kdeguchi/pkg_replace/releases/tag/20221228
Attachments:
Description Flags
Update to pkg_replace-20221228
kdeguchi: maintainer-approval+
Update to pkg_replace-20230101
kdeguchi: maintainer-approval+
Debug log (stderr only)
none
Update to pkg_replace-20230102
none
Update to pkg_replace-20230103
kdeguchi: maintainer-approval+
Partial error log with "-RR"
none
Output of `pkg query '%o:%n-%v'`
none
Related error log for ---> Installing 'ruby30-(null)' from 'ruby30-(null)'
none
Update to pkg_replace-20230104
kdeguchi: maintainer-approval+
Debug log around "parameter not set"
none
Update to pkg_replace-20230105 (Quick fix error message)
kdeguchi: maintainer-approval+
Error log with 20230105 none

Description Ken DEGUCHI 2022-12-28 01:14:51 UTC
Created attachment 239073 [details]
Update to pkg_replace-20221228

pkg_replace-20221228

*More strictly dependencies checking for "-dd" or "-RR" option.
*Speedup checking dependencies about "-dd", "-RR" option by parallel execution.
*Add "--nocleandeps" option. Don't clean PKG_REPLACE_DB_DIR directory.
*If "-N" only set, don't install binary packages.
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2022-12-29 08:51:45 UTC
Thanks for the patch, if possible, please set your name in https://bugs.freebsd.org/bugzilla/userprefs.cgi?tab=account so we can use that in the `git commit --author`
Comment 2 Ken DEGUCHI 2023-01-01 09:51:29 UTC
Created attachment 239171 [details]
Update to pkg_replace-20230101

*Fix bug "-x" option with "-dd" ("-RR") option.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-01-02 02:34:12 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=99b701071bc58c2d156483ef343989d902908fea

commit 99b701071bc58c2d156483ef343989d902908fea
Author:     Ken DEGUCHI <kdeguchi@sz.tokoha-u.ac.jp>
AuthorDate: 2023-01-02 02:31:23 +0000
Commit:     Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2023-01-02 02:33:42 +0000

    ports-mgmt/pkg_replace: Update to 20230101

    Release note: https://github.com/kdeguchi/pkg_replace/releases/tag/20221228

    PR:             268605

 ports-mgmt/pkg_replace/Makefile | 2 +-
 ports-mgmt/pkg_replace/distinfo | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 4 Tomoaki AOKI 2023-01-02 09:08:20 UTC
Not sure from which revision this started happening, unfortunately, installing new port using -N option fails. Dependencies are installed successfully.

 *Sorry, I've tested only for updating before.


# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -W -w -RR -N ports-mgmt/porttools && portsclean -C 
--->  Loading /usr/local/etc/pkg_replace/pkg_replace.conf
--->  '-dd' or '-RR' option set, this mode is slow!
--->  Installing 'porttools-1.10' from 'ports-mgmt/porttools'
--->  Building 'ports-mgmt/porttools' with make flags:  DISABLE_VULNERABILITIES=yes 

  (snip)

===>  Staging for porttools-1.10
===>   porttools-1.10 depends on executable: portlint - not found

===>  License ITOJUN accepted by the user
===>   portlint-2.20.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by portlint-2.20.0 for building
===>  Extracting for portlint-2.20.0
===>  Patching for portlint-2.20.0
===>  Configuring for portlint-2.20.0
===>  Staging for portlint-2.20.0
===>   portlint-2.20.0 depends on package: perl5>=5.32.r0<5.33 - found
===>   Generating temporary packing list

  (snip)

===>  Installing for portlint-2.20.0
===>  Checking if portlint is already installed
===>   Registering installation for portlint-2.20.0 as automatic
Installing portlint-2.20.0...
===>   porttools-1.10 depends on executable: portlint - found
===>   Returning to build of porttools-1.10
===>   porttools-1.10 depends on executable: ydiff - not found

===>  License BSD3CLAUSE accepted by the user
===>   ydiff-1.2,1 depends on file: /usr/local/sbin/pkg - found

  (snip)

====> Compressing man pages (compress-man)
===>  Installing for ydiff-1.2,1
===>  Checking if ydiff is already installed
===>   Registering installation for ydiff-1.2,1 as automatic
Installing ydiff-1.2,1...
===>   porttools-1.10 depends on executable: ydiff - found
===>   Returning to build of porttools-1.10
===>   porttools-1.10 depends on executable: sudo - found
===>   porttools-1.10 depends on executable: git - found
===>   Generating temporary packing list

  (snip)

mkdir -p /usr/ports/ports-mgmt/porttools/work/stage/usr/local/share/doc/porttools
install  -m 0644 LICENSE NEWS README.md THANKS /usr/ports/ports-mgmt/porttools/work/stage/usr/local/share/doc/porttools
====> Compressing man pages (compress-man)
--->  Installing 'ports-mgmt/porttools'
cd: ports-mgmt/porttools: No such file or directory
** Fix the problem and try again.
--->  ** [1/1] - 0 done, 0 ignored, 0 skipped, 1 failed
--->  Listing the results (+:done / -:ignored / !:failed)
        ! ports-mgmt/porttools (install error)
Comment 5 Tomoaki AOKI 2023-01-02 09:16:04 UTC
Created attachment 239198 [details]
Debug log (stderr only)

Uploaded debug log. Dependencies are already installed.

# pkg_replace -c -v -m 'DISABLE_VULNERABILITIES=yes' -RR -W -w -N --debug ports-mgmt/porttools 2>/var/tmp/pkg_replace_20230102_porttools.log && portsclean -C
Comment 6 Tomoaki AOKI 2023-01-02 12:51:28 UTC
Another problem.
If I remember correctly, I've never encountered this with 20221222.

Sorry, debug log of 2nd run (1st run didn't have --debug set) is too large to upload even if compressed with xz. (3716296 bytes, 618824493 bytes uncompressed.)

Error message of 1st run was as follows. Mixed stdout and stderr.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k
--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies../usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
.........................................done.
make: don't know how to make config-conditional. Stop)

make: stopped in /usr/ports
** Command failed (exit code 1): make_config_conditional 
** Fix the problem and try again.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.--->  Executing make config-conditional: rust-1.66.0                            --->  Executing make config-conditional: plasma5-plasma-workspace-wallpapers-5.2--->  Executing make config-conditional: plasma5-polkit-kde-agent-1-5.24.7      --->  Executing make config-conditional: plasma5-plasma-browser-integration-5.24--->  Executing make config-conditional: plasma5-plasma-desktop-5.24.7          --->  Skipping 'compizconfig-python-0.8.4_9' (-> compizconfig-python-0.8.4_9) - ignored
--->  Executing make config-conditional: libappindicator-12.10.1.2010202007061.0--->  Executing make config-conditional: libbdplus-0.2.0                        ** 'www/linux-flashplayer' has removed from ports tree:3.82_1
**     Has expired: Deprecated by upstream (2020-12-31)
** Skipping 'linux-flashplayer-32.0.0.465' - removed.
** 'www/nspluginwrapper' has removed from ports tree:.1.0            
**     Has expired: Abandonware, last release in 2011 and upstream is dead. NPAPI plugins are now obsolete and depends on deprecated library GTK 2 (2022-06-30)
** Skipping 'nspluginwrapper-1.4.4_7' - removed.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
--->  Installing 'ruby30-(null)' from 'ruby30-(null)'
/usr/local/sbin/pkg_replace: 1: parameter not set
Comment 7 Ken DEGUCHI 2023-01-02 13:19:14 UTC
Created attachment 239211 [details]
Update to pkg_replace-20230102

(In reply to Tomoaki AOKI from comment #5)

Thanks for your report.
I have released "pkg_replace-20230102".

*Fix bug about getting ports directory.

Please try this version.
Comment 8 Ken DEGUCHI 2023-01-02 13:21:38 UTC
(In reply to Tomoaki AOKI from comment #6)

These bugs may be fixed.
Comment 9 Tomoaki AOKI 2023-01-02 22:12:32 UTC
(In reply to Ken DEGUCHI from comment #7)

Thanks!
The first problem ("cd" problem on fresh install with "-N") is fixed now.

But the second one ("/usr/local/sbin/pkg_replace: 1: parameter not set" on fetch with "-a -PP -F -k") still persists.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k
--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies../usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
.........................................done.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
make: don't know how to make config-conditional. Stop)

make: stopped in /usr/ports
** Command failed (exit code 1): make_config_conditional 
** Fix the problem and try again.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.--->  Executing make config-conditional: rust-1.66.0                            --->  Executing make config-conditional: plasma5-plasma-workspace-wallpapers-5.2--->  Executing make config-conditional: plasma5-polkit-kde-agent-1-5.24.7      --->  Executing make config-conditional: plasma5-plasma-browser-integration-5.24--->  Executing make config-conditional: plasma5-plasma-desktop-5.24.7          --->  Skipping 'compizconfig-python-0.8.4_9' (-> compizconfig-python-0.8.4_9) - ignored
--->  Executing make config-conditional: libappindicator-12.10.1.2010202007061.0--->  Executing make config-conditional: libbdplus-0.2.0                        ** 'www/linux-flashplayer' has removed from ports tree:3.82_1
**     Has expired: Deprecated by upstream (2020-12-31)
** Skipping 'linux-flashplayer-32.0.0.465' - removed.
** 'www/nspluginwrapper' has removed from ports tree:.1.0            
**     Has expired: Abandonware, last release in 2011 and upstream is dead. NPAPI plugins are now obsolete and depends on deprecated library GTK 2 (2022-06-30)
** Skipping 'nspluginwrapper-1.4.4_7' - removed.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
--->  Installing 'ruby30-(null)' from 'ruby30-(null)'
/usr/local/sbin/pkg_replace: 1: parameter not set
Comment 10 Ken DEGUCHI 2023-01-03 00:11:39 UTC
Created attachment 239218 [details]
Update to pkg_replace-20230103

(In reply to Tomoaki AOKI from comment #9)

Thanks for your report.

I found the bug about checking installed packages and
released pkg_replace-20230103. Please try this version.
Comment 11 Tomoaki AOKI 2023-01-03 02:06:07 UTC
(In reply to Ken DEGUCHI from comment #10)

Thanks!
Unfortunately, the second problem still persists.

But confirmed that this happenes only with "-RR" option.
With single "-R" and without "-R" don't exposed the problem.
Comment 12 Ken DEGUCHI 2023-01-03 02:59:20 UTC
(In reply to Tomoaki AOKI from comment #11)

I expect that there is probably a dependency problem with the package (e.g., a has dependency looping or has been removed from the ports tree). "-RR" option does not work well when there is a dependency problem.
Comment 13 Tomoaki AOKI 2023-01-03 04:34:25 UTC
(In reply to Ken DEGUCHI from comment #12)

Possibly.
I have some locked, orphaned ports, so there can be some missing-links.

FYI: Tried `portupgrade -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -R -F -k` and didn't exposed unexpected errors.

What (expectedly) failed were...
 *Ports that are marked as BROKEN or IGNORE.
 *Deleted ports (patch to restore, `git stash` before `git pull && make index`
  and `git stash apply` afterwards). So not included in INDEX.
Comment 14 Ken DEGUCHI 2023-01-03 06:16:21 UTC
(In reply to Tomoaki AOKI from comment #13)

Perhaps, assuming binary packages, "-R" option is all that is needed.
As a solution, it would be better to declare the failing package name to pkg_replace.conf with IGNORE.


"-R" and "-RR" options execute the following.

As common to "-R" and "-RR" options:
Getting RUN_DEPENDS and LIB_DEPENDS of pkgname. 

`pkg query '%dn-%dv' pkgname`

Only "-RR" option:
Getting more dependencies of pkgname.

`cd portdirectory_of_pkgname && make -V BUILD_DEPENDS -V PATCH_DEPENDS
 -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS`

Thus the INDEX file is not referenced.
Comment 15 Tomoaki AOKI 2023-01-03 08:59:07 UTC
Created attachment 239226 [details]
Partial error log with "-RR"

Just FYI, maybe insufficient.
  *Redirected stderr with "--debug" and "-a -RR -F -k".
  *Include 3 lines starting with "+ get_strict_depend_pkgs"
  *Around first found "/usr/local/sbin/pkg_replace: 1: parameter not set" line.

Maybe because of multi process approach, includes some lines
with "+ get_strict_depend_pkgs" in the middle.

The original log is sized 617976657 bytes.
Comment 16 Ken DEGUCHI 2023-01-03 09:58:22 UTC
(In reply to Tomoaki AOKI from comment #15)

What is the result of executing the following command?

`pkg query '%o:%n-%v'`

If there is a problem within this result, I think
the result of the "-RR" run will be wrong.

I am interested in the following result of your comment #9.
--->  Installing 'ruby30-(null)' from 'ruby30-(null)'
Comment 17 Tomoaki AOKI 2023-01-03 11:02:01 UTC
Created attachment 239228 [details]
Output of `pkg query '%o:%n-%v'`

Redirected output from `pkg query '%o:%n-%v'`.

Should be exitted without error, as just after the command,

% echo $?
0
Comment 18 Tomoaki AOKI 2023-01-03 11:08:06 UTC
Created attachment 239229 [details]
Related error log for --->  Installing 'ruby30-(null)' from 'ruby30-(null)'

Related error log for --->  Installing 'ruby30-(null)' from 'ruby30-(null)'

Possibly insufficient. Searched 'ruby30-(null)' from EOF and copied maybe-related part through EOF.
This is done as the mentioned stdout message was the last part of output on error case.
Comment 19 Ken DEGUCHI 2023-01-03 12:06:47 UTC
(In reply to Tomoaki AOKI from comment #18)

Thanks for the information.

I have looked into it, but do not know the cause of these errors.

"/usr/local/sbin/pkg_replace: 1: parameter not set" is expected
because the package name (or origin, ports directory) is not passed properly.

I believe "ruby30-(null)" is caused by an incorrect package dependency.

I do not know any more.
Comment 20 Tomoaki AOKI 2023-01-03 13:51:40 UTC
(In reply to Ken DEGUCHI from comment #19)

FYI: lang/ruby30 is actually installed as shown in uploaded output from `pkg query '%o:%n-%v'`.

As portupgrade -R/-r usually does overkill (same as -RR/-dd on pkg_replace?), I've tried `portupgrade -c -v -m 'DISABLE_VULNERABILITIES=yes' -R -r -f lang/ruby30`.
The build/install itself went fine, but didn't help.

Maybe updating manpage to warn not to use -RR in conjunction with -a would be sufficient for now.

 *I've use the combination in order to fetch all indirect dependencies,
  not to start fetching on build time. Sometimes it causes hours for broken fetch,
  or stop for config screen of unfetched/unconfigured (new) dependencies.
  I don't want seeing config screen or never ending fetch in the morning for heavy
  builds started just before sleep...
  Usually, portupgrade does a good job, but it dislikes FLAVORs, thus failing.
Comment 21 Ken DEGUCHI 2023-01-04 00:10:41 UTC
Created attachment 239243 [details]
Update to pkg_replace-20230104

(In reply to Tomoaki AOKI from comment #20)

I think 'ruby30-(null)' is a package name starting with ruby30.
From the results of `pkg query %o:%n-%v`, I assume it is one of
the following two packages.

 databases/ruby-bdb:ruby30-bdb-0.6.6_8
 devel/ruby-gems:ruby30-gems-3.3.26

I still found something that seemed wrong in the code, so it
may not fix these error, but I made a few fixes in case it
was not good enough.

I also added a note on the man page about using the "-dd", "-RR" option.

Thanks for your advice, it is very helpful.
Comment 22 Tomoaki AOKI 2023-01-04 03:19:22 UTC
(In reply to Ken DEGUCHI from comment #21)

Thanks!
Some proposal for wording on manpage (checked -dd, -RR part only).

Config file may not be updated to merge upstream changes if already modified locally.
So sample config file would be better as it should be always up-to-date just after upgrading.

Second paragraph would better slightly modified for grammer fix.

What about the sample below?

     -dd, -RR
              Strictly checking dependencies more than -d, -R, e.g. build
              dependencies.  However, this mode is slow.  So, pkg_replace
              creates temporary files in the PKG_REPLACE_DB_DIR directory to
              run as fast as possible.  See config file,  pkg_replace.conf.sample.
              If you set --nocleandeps, pkg_replace does not clean this
              directory.

              This option may fail when there are dependency problems (e.g.,
              packages have looped dependencies, packages removed from
              the ports tree).  Especially, be careful when using -a option
              at the same time.
Comment 23 Tomoaki AOKI 2023-01-04 03:33:32 UTC
Maybe found the cause of the problem.
Something in pkg database would be somehow broken.

databases/ruby-bdb is installed as below (portupgrade-devel requires it).

% pkg version -o -v | rg 'ruby'
lang/ruby30                        =   up-to-date with index
databases/ruby-bdb                 =   up-to-date with index
devel/ruby-gems                    =   up-to-date with index
textproc/rubygem-asciidoctor       =   up-to-date with index
www/rubygem-hpricot                =   up-to-date with index
devel/rubygem-mustache             =   up-to-date with index
textproc/rubygem-psych             =   up-to-date with index
textproc/rubygem-rdiscount         =   up-to-date with index
devel/rubygem-rdoc                 =   up-to-date with index
textproc/rubygem-ronn              =   up-to-date with index
devel/rubygem-stringio             =   up-to-date with index


But doesn't appear below.

% pkg query %ro lang/ruby30
textproc/rubygem-asciidoctor
devel/rubygem-rdoc
textproc/rubygem-psych
devel/rubygem-stringio
textproc/rubygem-ronn
devel/rubygem-mustache
textproc/rubygem-rdiscount
www/rubygem-hpricot
ports-mgmt/portupgrade-devel
devel/ruby-gems


But it should be depending on lang/ruby30 as below.

% pushd /usr/ports/databases/ruby-bdb ; make -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/databases/ruby-bdb ~ /usr/ports
rubygem-rdoc>=0.a:devel/rubygem-rdoc /usr/local/bin/ruby30:lang/ruby30
/usr/local/bin/ruby30:lang/ruby30

/usr/local/bin/ruby30:lang/ruby30
/usr/local/sbin/pkg:ports-mgmt/pkg
~ /usr/ports

Will report back after forcibly updating databases/ruby-bdb.
Comment 24 Tomoaki AOKI 2023-01-04 05:46:47 UTC
After forcibly updating databases/ruby-bdb, it appears normally.

% pkg query %ro lang/ruby30    
databases/ruby-bdb
textproc/rubygem-asciidoctor
devel/rubygem-rdoc
textproc/rubygem-psych
devel/rubygem-stringio
textproc/rubygem-ronn
devel/rubygem-mustache
textproc/rubygem-rdiscount
www/rubygem-hpricot
ports-mgmt/portupgrade-devel
devel/ruby-gems

And command below finishes successfully, although the error message "/usr/local/sbin/pkg_replace: 1: parameter not set" still appears.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k
--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies../usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
...........................................done.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0

  (snip)

--->  ** [2184/2185] - 2 done, 2180 ignored, 2 skipped, 0 failed
** No need to replace 'zsh-navigation-tools-2.2.7'. (specify -f to force)
--->  ** [2185/2185] - 2 done, 2181 ignored, 2 skipped, 0 failed
--->  Listing the results (*:skipped)
        * linux-flashplayer-32.0.0.465 (removed)
        * nspluginwrapper-1.4.4_7 (removed)
Comment 25 Ken DEGUCHI 2023-01-04 07:33:26 UTC
(In reply to Tomoaki AOKI from comment #24)

Can you upload a debug log of about 1000 lines before and after "/usr/local/sbin/pkg_replace: 1: parameter not set" ?

Probably, I can find out something.
Comment 26 Tomoaki AOKI 2023-01-04 08:46:48 UTC
Created attachment 239250 [details]
Debug log around "parameter not set"

Debug log around "/usr/local/sbin/pkg_replace: 1: parameter not set", before and after (around) 1000 lines. Archived as .txz format.
Using pkg_replace 20230104. This is the only part including it today.
Comment 27 Ken DEGUCHI 2023-01-04 11:00:25 UTC
(In reply to Tomoaki AOKI from comment #26)

I checked the log and found "py27-setuptools-(null)".
I assume this is due to broken packages dependency
in your environment.

Currently, at the time of checking the "-RR" option,
pkg_replace has also checked those excluded by "-x". 
Excluding this may work, but it will take some time
to fix the program.

However, I think the program works reasonably well.
Comment 28 Tomoaki AOKI 2023-01-04 11:56:36 UTC
(In reply to Ken DEGUCHI from comment #27)

Very, very possibly.
Maybe caused by this resurrected port, x11-wm/compizconfig-python.
It was installed BEFORE it was removed from ports tree.
I've locked it and resurrected it in conjunction with related ports.

% pkg query %ro py27-setuptools44-44.1.1
lang/cython
devel/py-future
devel/py-six
% pkg query %ro py27-cython-0.29.32
x11-wm/compizconfig-python
% pkg query %ro py27-future-0.18.2
% pkg query %ro py27-six-1.16.0
% pushd /usr/ports/x11-wm/compizconfig-python ; make -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/x11-wm/compizconfig-python ~
/usr/local/libdata/pkgconfig/compiz.pc:x11-wm/compiz  /usr/local/libdata/pkgconfig/libcompizconfig.pc:x11-wm/libcompizconfig  py27-pyrex>0:devel/pyrex@py27 gmake>=4.3:devel/gmake pkgconf>=1.3.0_1:devel/pkgconf /usr/local/bin/python2.7:lang/python27          /usr/local/libdata/pkgconfig/ice.pc:x11/libICE /usr/local/libdata/pkgconfig/sm.pc:x11/libSM /usr/local/libdata/pkgconfig/x11.pc:x11/libX11 /usr/local/libdata/pkgconfig/xcomposite.pc:x11/libXcomposite /usr/local/libdata/pkgconfig/xdamage.pc:x11/libXdamage /usr/local/libdata/pkgconfig/xext.pc:x11/libXext /usr/local/libdata/pkgconfig/xfixes.pc:x11/libXfixes /usr/local/libdata/pkgconfig/xinerama.pc:x11/libXinerama /usr/local/libdata/pkgconfig/xrandr.pc:x11/libXrandr



/usr/local/sbin/pkg:ports-mgmt/pkg
~

Found that devel/pyrex@py27 is missing.
It is also deleted, but cython seems to be compatible with it, and if I recall correctly, I've once edited x11-wm/compizconfig-python/Makefile and contents on files/ directory to fit with it and reinstalled, but possibly somehow overwritten with old backup package.

I'll retry rbuilding/reinstalling cython-depending x11-wm/compizconfig-python and see what's happen.
Comment 29 Tomoaki AOKI 2023-01-04 12:10:20 UTC
Another thing to mention.

devel/py-setuptools is now only for python 3.7+, and older version, devel/py-setuptools44 is kept only for python 2.7.

Actually, py27- versions of lang/cython, devel/py-future and devel/py-six depends on devel/py-setuptools44, not devel/py-setuptools, according to `pkg query %ro`.
Comment 30 Tomoaki AOKI 2023-01-04 12:19:41 UTC
After rebuilding devel/py-setuptools44 with FLAVOR=py27 and cython-depending x11-wm/compizconfig-python,

% pushd /usr/ports/x11-wm/compizconfig-python ; make -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/x11-wm/compizconfig-python ~
/usr/local/libdata/pkgconfig/compiz.pc:x11-wm/compiz  /usr/local/libdata/pkgconfig/libcompizconfig.pc:x11-wm/libcompizconfig  py27-cython>0:lang/cython@py27 gmake>=4.3:devel/gmake pkgconf>=1.3.0_1:devel/pkgconf /usr/local/bin/python2.7:lang/python27          /usr/local/libdata/pkgconfig/ice.pc:x11/libICE /usr/local/libdata/pkgconfig/sm.pc:x11/libSM /usr/local/libdata/pkgconfig/x11.pc:x11/libX11 /usr/local/libdata/pkgconfig/xcomposite.pc:x11/libXcomposite /usr/local/libdata/pkgconfig/xdamage.pc:x11/libXdamage /usr/local/libdata/pkgconfig/xext.pc:x11/libXext /usr/local/libdata/pkgconfig/xfixes.pc:x11/libXfixes /usr/local/libdata/pkgconfig/xinerama.pc:x11/libXinerama /usr/local/libdata/pkgconfig/xrandr.pc:x11/libXrandr



/usr/local/sbin/pkg:ports-mgmt/pkg
~

But pkg_replace works as previous report.
Works fine except for the "parameter not set" issue.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k
--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies../usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
...........................................done.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0

  (snip)

--->  ** [2184/2185] - 2 done, 2180 ignored, 2 skipped, 0 failed
** No need to replace 'zsh-navigation-tools-2.2.7'. (specify -f to force)
--->  ** [2185/2185] - 2 done, 2181 ignored, 2 skipped, 0 failed
--->  Listing the results (*:skipped)
        * linux-flashplayer-32.0.0.465 (removed)
        * nspluginwrapper-1.4.4_7 (removed)
Comment 31 Ken DEGUCHI 2023-01-04 13:18:33 UTC
(In reply to Tomoaki AOKI from comment #30)

Thanks!

I found the cause of the error.

If there is a package that is needed but not installed
(e.g., "py27-setuptools-(null)" in the debug log), 
"/usr/local/sbin/pkg_replace: 1: parameter not set"
message appears. Because `pkg query` does not know the
origin of the package.

I will modify the program so that it does not check for
dependencies when packages like "py27-setuptools-(null)"
are present.
Comment 32 Tomoaki AOKI 2023-01-04 13:36:12 UTC
(In reply to Ken DEGUCHI from comment #31)

The origin of py27-setuptools* should be devel/py-setuptools44, but unfortunately, MOVED has no way to handle these case, if I understand correctly.

If MOVED can accept entries with FLAVOR something like

devel/py-setuptools@py27|devel/py-setuptools44@py27|any-actual-date|py27 variant of py-setuptool sticks old version, so create and move to it.

pkg and any other ports updating tools would be able to handle it correctly.
Comment 33 Tomoaki AOKI 2023-01-04 17:09:45 UTC
Possibly found one more hint.

*Without FLAVOR setting:

% pushd /usr/ports/devel/py-setuptools ; make -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/devel/py-setuptools ~
/usr/local/bin/python3.9:lang/python39



/usr/local/sbin/pkg:ports-mgmt/pkg
~
% pushd /usr/ports/devel/py-setuptools44 ; make -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/devel/py-setuptools44 ~
/usr/local/bin/python2.7:lang/python27



/usr/local/sbin/pkg:ports-mgmt/pkg
~
% pushd /usr/ports/lang/cython ; make -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/lang/cython ~
py39-setuptools>=63.1.0:devel/py-setuptools@py39 /usr/local/bin/python3.9:lang/python39



/usr/local/sbin/pkg:ports-mgmt/pkg
~


*With FLAVOR=py27: devel/py-setuptools should be erroneous here.

% pushd /usr/ports/devel/py-setuptools ; make FLAVOR=py27 -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd  
/usr/ports/devel/py-setuptools ~
/usr/local/bin/python2.7:lang/python27



/usr/local/sbin/pkg:ports-mgmt/pkg
~
% pushd /usr/ports/devel/py-setuptools44 ; make FLAVOR=py27 -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/devel/py-setuptools44 ~
/usr/local/bin/python2.7:lang/python27



/usr/local/sbin/pkg:ports-mgmt/pkg
~
% pushd /usr/ports/lang/cython ; make FLAVOR=py27 -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/lang/cython ~
py27-setuptools44>0:devel/py-setuptools44@py27 /usr/local/bin/python2.7:lang/python27



/usr/local/sbin/pkg:ports-mgmt/pkg
~


*With FLAVOR=py39: devel/py-setuptools44 should be erroneous here.

% pushd /usr/ports/devel/py-setuptools ; make FLAVOR=py39 -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd  
/usr/ports/devel/py-setuptools ~
/usr/local/bin/python3.9:lang/python39



/usr/local/sbin/pkg:ports-mgmt/pkg
~
% pushd /usr/ports/devel/py-setuptools44 ; make FLAVOR=py39 -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/devel/py-setuptools44 ~
/usr/local/bin/python3.9:lang/python39



/usr/local/sbin/pkg:ports-mgmt/pkg
~
% pushd /usr/ports/lang/cython ; make FLAVOR=py39 -V BUILD_DEPENDS -V PATCH_DEPENDS -V FETCH_DEPENDS -V EXTRACT_DEPENDS -V PKG_DEPENDS ; popd
/usr/ports/lang/cython ~
py39-setuptools>=63.1.0:devel/py-setuptools@py39 /usr/local/bin/python3.9:lang/python39



/usr/local/sbin/pkg:ports-mgmt/pkg
~
Comment 34 Ken DEGUCHI 2023-01-04 21:43:41 UTC
(In reply to Tomoaki AOKI from comment #32 and comment #33)

Please try:
`pkg_replace ..other_options.. py27-setuptools=/usr/ports/devel/py-setuptools44`

Maybe it will work.

But I think the best way to do this is as you commented in comment #32.
Comment 35 Ken DEGUCHI 2023-01-04 22:02:54 UTC
(In reply to Ken DEGUCHI from comment #34)

Oh, it was a little different, so I am correcting it.

"-a" does not set.

`pkg_replace ..other_options.. py27-setuptools=/usr/ports/devel/py-setuptools44 \*`
Comment 36 Ken DEGUCHI 2023-01-05 00:41:16 UTC
Created attachment 239268 [details]
Update to pkg_replace-20230105 (Quick fix error message)

Quick fix error message like "pkg_replace: 1: parameter not set".
No such message will appear. However, this is not an essential solution.

I am going to try to figure out how to handle the current situation
for the ports that have different origins depending on FLAVOR.
Comment 37 Tomoaki AOKI 2023-01-05 02:19:06 UTC
(In reply to Ken DEGUCHI from comment #35)

Tried with 20230104.

# pkg_replace -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k py27-setuptools=/usr/ports/devel/py-setuptools44 \* 
--->  '-dd' or '-RR' option set, this mode is slow!
** No such file or package installed: py27-setuptools, please try -N option
Checking dependencies./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
...........................................done.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0

   (snip)

** No need to replace 'zeitgeist-1.0.4'. (specify -f to force)
--->  ** [2184/2185] - 2 done, 2180 ignored, 2 skipped, 0 failed
** No need to replace 'zsh-navigation-tools-2.2.7'. (specify -f to force)
--->  ** [2185/2185] - 2 done, 2181 ignored, 2 skipped, 0 failed
--->  Listing the results (*:skipped)
        * linux-flashplayer-32.0.0.465 (removed)
        * nspluginwrapper-1.4.4_7 (removed)


As actually-installed is py27-setuptools44-44.1.1, tried below, too.

# pkg_replace -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k py27-setuptools44=/usr/ports/devel/py-setuptools44 \*--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
...........................................done.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0

   (snip)

** No need to replace 'zeitgeist-1.0.4'. (specify -f to force)
--->  ** [2184/2185] - 2 done, 2180 ignored, 2 skipped, 0 failed
** No need to replace 'zsh-navigation-tools-2.2.7'. (specify -f to force)
--->  ** [2185/2185] - 2 done, 2181 ignored, 2 skipped, 0 failed
--->  Listing the results (*:skipped)
        * linux-flashplayer-32.0.0.465 (removed)
        * nspluginwrapper-1.4.4_7 (removed)


To be sure, excluded "-x py27-\*" option.

# pkg_replace -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x vscode\* -RR -F -k py27-setuptools=/usr/ports/devel/py-setuptools44 \*          
--->  '-dd' or '-RR' option set, this mode is slow!
** No such file or package installed: py27-setuptools, please try -N option
Checking dependencies./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
./usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
...........................................done.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
make: don't know how to make config-conditional. Stopols-(null)

make: stopped in /root
** Command failed (exit code 1): make_config_conditional 
** Fix the problem and try again.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0
--->  Executing make config-conditional: plasma5-plasma-workspace-wallpapers-5.2--->  Executing make config-conditional: plasma5-polkit-kde-agent-1-5.24.7      --->  Executing make config-conditional: plasma5-plasma-browser-integration-5.24--->  Executing make config-conditional: plasma5-plasma-desktop-5.24.7          --->  Skipping 'compizconfig-python-0.8.4_9' (-> compizconfig-python-0.8.4_9) - ignored
--->  Executing make config-conditional: libappindicator-12.10.1.2010202007061.0--->  Executing make config-conditional: libbdplus-0.2.0                        ** 'www/linux-flashplayer' has removed from ports tree:3.82_1
**     Has expired: Deprecated by upstream (2020-12-31)
** Skipping 'linux-flashplayer-32.0.0.465' - removed.
** 'www/nspluginwrapper' has removed from ports tree:.1.0            
**     Has expired: Abandonware, last release in 2011 and upstream is dead. NPAPI plugins are now obsolete and depends on deprecated library GTK 2 (2022-06-30)
** Skipping 'nspluginwrapper-1.4.4_7' - removed.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
--->  Installing 'py27-setuptools-(null)' from 'py27-setuptools-(null)'
/usr/local/sbin/pkg_replace: 1: parameter not set



I'll try 20230105 late today, maybe in the evening or night.
Comment 38 Tomoaki AOKI 2023-01-05 09:54:48 UTC
Tried 20230105.

*With "-x py27-\*", worked as expected.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x py27-\* -x vscode\* -RR -F -k--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies............................................done.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0

   (snip)

* No need to replace 'zeitgeist-1.0.4'. (specify -f to force)
--->  ** [2184/2185] - 2 done, 2180 ignored, 2 skipped, 0 failed
** No need to replace 'zsh-navigation-tools-2.2.7'. (specify -f to force)
--->  ** [2185/2185] - 2 done, 2181 ignored, 2 skipped, 0 failed
--->  Listing the results (*:skipped)
        * linux-flashplayer-32.0.0.465 (removed)
        * nspluginwrapper-1.4.4_7 (removed)


*Without "-x py27-\*", unfortunately didn't successfully finish.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x vscode\* -RR -F -k 
--->  '-dd' or '-RR' option set, this mode is slow!
Checking dependencies............................................done.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
make: don't know how to make config-conditional. Stopols-(null)

make: stopped in /usr/ports
** Command failed (exit code 1): make_config_conditional 
** Fix the problem and try again.
--->  Executing make config-conditional: py39-sphinxcontrib-serializinghtml-1.1.
--->  Executing make config-conditional: rust-1.66.0
--->  Executing make config-conditional: plasma5-plasma-workspace-wallpapers-5.2--->  Executing make config-conditional: plasma5-polkit-kde-agent-1-5.24.7      --->  Executing make config-conditional: plasma5-plasma-browser-integration-5.24--->  Executing make config-conditional: plasma5-plasma-desktop-5.24.7          --->  Skipping 'compizconfig-python-0.8.4_9' (-> compizconfig-python-0.8.4_9) - ignored
--->  Executing make config-conditional: libappindicator-12.10.1.2010202007061.0--->  Executing make config-conditional: libbdplus-0.2.0                        ** 'www/linux-flashplayer' has removed from ports tree:3.82_1
**     Has expired: Deprecated by upstream (2020-12-31)
** Skipping 'linux-flashplayer-32.0.0.465' - removed.
** 'www/nspluginwrapper' has removed from ports tree:.1.0            
**     Has expired: Abandonware, last release in 2011 and upstream is dead. NPAPI plugins are now obsolete and depends on deprecated library GTK 2 (2022-06-30)
** Skipping 'nspluginwrapper-1.4.4_7' - removed.
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
/usr/local/sbin/pkg_replace: 1: parameter not set
--->  Installing 'py27-setuptools-(null)' from 'py27-setuptools-(null)'
/usr/local/sbin/pkg_replace: 1: parameter not set
Comment 39 Tomoaki AOKI 2023-01-05 12:59:24 UTC
Created attachment 239279 [details]
Error log with 20230105

Partial debug log with 20230105 of below around "/usr/local/sbin/pkg_replace: 1: parameter not set". The full log reached to 1.0GB.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x vscode\* -RR -F -k --debug > /var/tmp/pkg_replace_fetchall_stdout_20230105.log 2> /var/tmp/pkg_replace_fetchall_20230105.log
Comment 40 Ken DEGUCHI 2023-01-05 13:29:35 UTC
(In reply to Tomoaki AOKI from comment #39)

Is your desired outcome acceptable with "-x py27-\*"?

This error occurs because one of the packages not present in the
current ports tree depends on "py27-setuptools-(null)", but it
does not exist.

I don't know if this is possible, but something like the following
command would solve the problem.

`pkg set -o devel/py-setuptools@py27:devel/py-setuptools44 "one_of_packages"`

I would like to reflect this in the ports tree. What do you think?

Thank you.
Comment 41 Tomoaki AOKI 2023-01-05 14:03:48 UTC
(In reply to Ken DEGUCHI from comment #40)

Mandating "-x py27-\*" option is acceptable for me, as
 *This kickes out only a few ports, and basically distfiles are fetched
  for default python FLAVOR. Just set to avoid duplicated downloads.
  The only exception should be devel/py-setuptools44 and manually resurrected ones.

 *When I was mainly using portupgrade, trying to build multiple FLAVORs
  of the same origin often caused problems (portupgrade dislikes FLAVOR).
  So I've habitally built non-default FLAVORs by manually invoking something
  like `make FLAVOR=py27 deinstall reinstall clean`.

I don't know if including FLAVOR to MOVED / `pkg set` or not, but it would be nice (if it's possible) for ports-mgmt/* ports.
Comment 42 Tomoaki AOKI 2023-01-05 14:05:39 UTC
(In reply to Tomoaki AOKI from comment #39)

Additional note. The following case went fine just now.

# pkg_replace -a -c -m 'WITH+="NVIDIA,NVIDIA_GL" DISABLE_VULNERABILITIES=yes' -x vscode\* -R -F -k
Comment 43 Ken DEGUCHI 2023-01-05 20:27:44 UTC
(In reply to Tomoaki AOKI from comment #42)

Thanks for your comments.

I will try to reflect new version of pkg_replace to the ports tree.