Bug#1061148: apt: option -a has several meanings and is unusable

2024-01-26 Thread Vincent Lefevre
On 2024-01-19 18:38:06 +0100, David Kalnischkies wrote:
> On Fri, Jan 19, 2024 at 05:10:40PM +0100, Vincent Lefevre wrote:
> > The -a=... version is not documented in the manual, only -a alone,
> 
> Compare -t, which also doesn't say -t=foo. Probably mostly due to -t foo
> working as well or just because the manpages like their inconsistencies
> and would deserve some love, but who has the time to not just complain
> but also actually write all of it…

This is not the same thing. The -t option is listed only with an
argument, while there is a -a option *without* an argument:

  apt-get [-asqdyfmubV] ... [-a=architecture] ...
^ here

Perhaps this is a mistake...

> (reordered for posterity)
> 
> >-a, --host-architecture
> >This option controls the architecture packages are built for by
> >apt-get source --compile and how cross-builddependencies are
> >satisfied.
> > 
> > There are 2 verbs "controls" and "are built". And I don't see how
> > to parse "for by".
> 
> A package is "built for" the given (with -a) host architecture by
> "apt-get source --compile" – aka its instructed to cross-compile
> a package for the given host architecture instead of doing a "normal"
> compile where host and build architecture are the same.

OK, it took me some time to find how this sentence should be parsed.
In particular, I thought that this description was for the -a version
without an argument (see above), and the sentence couldn't have any
sense as a consequence.

BTW, in the option listing, whether an option takes an argument is
generally indicated. For instance, in the cp man page:

   -S, --suffix=SUFFIX
  override the usual backup suffix

And simpler sentences would be easier to understand, with the context
given first. For instance, something like

  With "apt-get source --compile", packages are built for the
  given architecture instead of [...]

Or more explicitly:

-a, --host-architecture=ARCH
  With "apt-get source --compile", packages are built for
  architecture ARCH instead of [...]

> So, "apt-get source -b -a armhf foo" will (simplified) build a
> "foo_armhf.deb" on your (likely amd64) machine to be used on another
> (probably less powerful) armhf machine. Similar for build-dep, just
> that this won't build anything but interprets certain dependencies
> differently.

If build-dep is also concerned by this option, this should be said.

> >By default is it not set which means that the host
> >architecture is the same as the build architecture (which is
> >defined by APT::Architecture). Configuration Item:
> >APT::Get::Host-Architecture.
> 
> > In the next sentence: "is it". Should this be
> > "it is"? The comma is missing before "which".
> 
> Perhaps it should, "is it not" has the hint of a question. In German
> I would write such a sentence without a comma as the added phrase isn't
> [that] optional, but not sure if a German – or English – teacher would
> actually agree on me claiming "definition phrase", which are not
> separated by commas in both languages. Could easily be done without
> a which if we were really trying.

Here, "which means..." relates to an entire statement ("it is not set"),
so that a comma is needed. See

  https://guinlist.wordpress.com/tag/clause-referring-which/

"2. Relating to an Entire Statement
[...]
(c) Octavian defeated his enemies in battle, which enabled him to
become Roman Emperor.

/Which/ here refers to what /Octavian/ did, not the /battle/.

In this usage, /which/ is always needed instead of /who/ or /that/, it
always follows a comma, and it has a singular verb after it. [...]"
^^

Or this (in French):

  
https://www.anglaisfacile.com/exercices/exercice-anglais-2/exercice-anglais-26463.php

(this is the case where "which" is translated in French by "ce que"
or "ce qui", instead of just "que" or "qui" when "which" relates to
a noun).

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1061148: apt: option -a has several meanings and is unusable

2024-01-19 Thread David Kalnischkies
On Fri, Jan 19, 2024 at 05:10:40PM +0100, Vincent Lefevre wrote:
> The -a=... version is not documented in the manual, only -a alone,

Compare -t, which also doesn't say -t=foo. Probably mostly due to -t foo
working as well or just because the manpages like their inconsistencies
and would deserve some love, but who has the time to not just complain
but also actually write all of it…


(reordered for posterity)

>-a, --host-architecture
>This option controls the architecture packages are built for by
>apt-get source --compile and how cross-builddependencies are
>satisfied.
> 
> There are 2 verbs "controls" and "are built". And I don't see how
> to parse "for by".

A package is "built for" the given (with -a) host architecture by
"apt-get source --compile" – aka its instructed to cross-compile
a package for the given host architecture instead of doing a "normal"
compile where host and build architecture are the same.

So, "apt-get source -b -a armhf foo" will (simplified) build a
"foo_armhf.deb" on your (likely amd64) machine to be used on another
(probably less powerful) armhf machine. Similar for build-dep, just
that this won't build anything but interprets certain dependencies
differently.

Using the option properly requires preparations that would fill their
own manpage to explain properly and its certainly not APTs place to do
that as it is just a tiny cog in the cross-machinery.


> Still, I don't see what this option does.

So, long story short: You would if you would need that option, but you
don't need it, so you don't.

--print-uris prints URIs; nowhere is explained what URI stands
for, it is just assumed that people who need it will know.

Hey, quick, what is a "build profile" and can you name a few?
Now go and ask that question another user and see how that goes.


>By default is it not set which means that the host
>architecture is the same as the build architecture (which is
>defined by APT::Architecture). Configuration Item:
>APT::Get::Host-Architecture.

> In the next sentence: "is it". Should this be
> "it is"? The comma is missing before "which".

Perhaps it should, "is it not" has the hint of a question. In German
I would write such a sentence without a comma as the added phrase isn't
[that] optional, but not sure if a German – or English – teacher would
actually agree on me claiming "definition phrase", which are not
separated by commas in both languages. Could easily be done without
a which if we were really trying.

Doesn't matter that much through as I would agree that the manpage(s)
need a revamp, but certainly not by me and not based on this. For this
specific option in particular, 99% of the user base are probably better
served if we were to remove its documentation entirely.

What about the 1%? Well, they deserve to write the patches to improve
the manpage and potentially fixup the translations (depending on how
much they reword here).

[Case in point, the option as documented doesn't work for years and
 nobody noticed – because 1% was an overstatement already; fixed in git]


Best regards

David Kalnischkies


signature.asc
Description: PGP signature


Bug#1061148: apt: option -a has several meanings and is unusable

2024-01-19 Thread Julian Andres Klode
On Fri, Jan 19, 2024 at 05:10:40PM +0100, Vincent Lefevre wrote:
> On 2024-01-19 16:43:24 +0100, Julian Andres Klode wrote:
> > On Fri, Jan 19, 2024 at 03:43:25PM +0100, Vincent Lefevre wrote:
> > > Package: apt
> > > Version: 2.7.9
> > > Severity: normal
> > > 
> > > In the apt-get(8) man page:
> > > 
> > >apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file]
> > >[-t=target_release] [-a=architecture] {update | upgrade |
> > >dselect-upgrade | dist-upgrade |
> > >install pkg [{=pkg_version_number | /target_release}]...  |
> > >remove pkg...  | purge pkg...  |
> > >source pkg [{=pkg_version_number | /target_release}]...  |
> > >build-dep pkg [{=pkg_version_number | /target_release}]... 
> > >  |
> > >download pkg [{=pkg_version_number | /target_release}]...  
> > > |
> > >check | clean | autoclean | autoremove | {-v | --version} |
> > >{-h | --help}}
> > > 
> > > So option -a appears both as a single option -a and as -a=architecture.
> > > 
> > > In the apt(8) man page, only the second form is listed, but for both
> > > commands, it is unusable:
> > > 
> > > # apt-get -a=i386 install libfontconfig-dev
> > > E: Command line option 'a' [from -a=i386] is not understood in 
> > > combination with the other options.
> > > 
> > > # apt -a=i386 install libfontconfig-dev
> > > E: Command line option 'a' [from -a=i386] is not understood in 
> > > combination with the other options.
> > 
> > -a in that sense is an argument to build-dep and family (source --build,
> > satisfy). It is short for host-architecture, and makes no sense in any
> > other command.
> 
> Perhaps this should be explicitly documented. And the error message
> should be clarified (note: "install" is a command, not an option).
> 
> > You seem to be trying to install libfontconfig-dev:i386
> 
> OK, but I was looking at an option to install several packages
> (package list to be copy-pasted) for a foreign architecture
> without much typing.
> 
> > We haven't explained that it works outside of source --compile and
> > build-dep (i.e. in satisfy) but I fail to see how you get to try
> > to pass this to install after reading the manual page.
> 
> The -a=... version is not documented in the manual, only -a alone,
> but even for that, I don't understand the manual; the grammar seems
> incorrect:
> 
>-a, --host-architecture
>This option controls the architecture packages are built for by
>apt-get source --compile and how cross-builddependencies are
>satisfied. By default is it not set which means that the host
>architecture is the same as the build architecture (which is
>defined by APT::Architecture). Configuration Item:
>APT::Get::Host-Architecture.
> 
> There are 2 verbs "controls" and "are built". And I don't see how
> to parse "for by". In the next sentence: "is it". Should this be
> "it is"? The comma is missing before "which". Still, I don't see
> what this option does.

apt-get source --compile compiles packages. For cross-compilation,
you need to set the host architecture. This option controls that.

And yes this is just runaway without punctuation, but uh wording
is hard and we really just want to rewrite all manual pages from
scratch.

Then you'll see -a, --host-architecture in the apt-build-dep
and apt-source and apt-satisfy manual pages (maybe they are all
the same, who knows).


-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer  i speak de, en



Bug#1061148: apt: option -a has several meanings and is unusable

2024-01-19 Thread Vincent Lefevre
On 2024-01-19 16:43:24 +0100, Julian Andres Klode wrote:
> On Fri, Jan 19, 2024 at 03:43:25PM +0100, Vincent Lefevre wrote:
> > Package: apt
> > Version: 2.7.9
> > Severity: normal
> > 
> > In the apt-get(8) man page:
> > 
> >apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file]
> >[-t=target_release] [-a=architecture] {update | upgrade |
> >dselect-upgrade | dist-upgrade |
> >install pkg [{=pkg_version_number | /target_release}]...  |
> >remove pkg...  | purge pkg...  |
> >source pkg [{=pkg_version_number | /target_release}]...  |
> >build-dep pkg [{=pkg_version_number | /target_release}]...  |
> >download pkg [{=pkg_version_number | /target_release}]...  |
> >check | clean | autoclean | autoremove | {-v | --version} |
> >{-h | --help}}
> > 
> > So option -a appears both as a single option -a and as -a=architecture.
> > 
> > In the apt(8) man page, only the second form is listed, but for both
> > commands, it is unusable:
> > 
> > # apt-get -a=i386 install libfontconfig-dev
> > E: Command line option 'a' [from -a=i386] is not understood in combination 
> > with the other options.
> > 
> > # apt -a=i386 install libfontconfig-dev
> > E: Command line option 'a' [from -a=i386] is not understood in combination 
> > with the other options.
> 
> -a in that sense is an argument to build-dep and family (source --build,
> satisfy). It is short for host-architecture, and makes no sense in any
> other command.

Perhaps this should be explicitly documented. And the error message
should be clarified (note: "install" is a command, not an option).

> You seem to be trying to install libfontconfig-dev:i386

OK, but I was looking at an option to install several packages
(package list to be copy-pasted) for a foreign architecture
without much typing.

> We haven't explained that it works outside of source --compile and
> build-dep (i.e. in satisfy) but I fail to see how you get to try
> to pass this to install after reading the manual page.

The -a=... version is not documented in the manual, only -a alone,
but even for that, I don't understand the manual; the grammar seems
incorrect:

   -a, --host-architecture
   This option controls the architecture packages are built for by
   apt-get source --compile and how cross-builddependencies are
   satisfied. By default is it not set which means that the host
   architecture is the same as the build architecture (which is
   defined by APT::Architecture). Configuration Item:
   APT::Get::Host-Architecture.

There are 2 verbs "controls" and "are built". And I don't see how
to parse "for by". In the next sentence: "is it". Should this be
"it is"? The comma is missing before "which". Still, I don't see
what this option does.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1061148: apt: option -a has several meanings and is unusable

2024-01-19 Thread Julian Andres Klode
On Fri, Jan 19, 2024 at 03:43:25PM +0100, Vincent Lefevre wrote:
> Package: apt
> Version: 2.7.9
> Severity: normal
> 
> In the apt-get(8) man page:
> 
>apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file]
>[-t=target_release] [-a=architecture] {update | upgrade |
>dselect-upgrade | dist-upgrade |
>install pkg [{=pkg_version_number | /target_release}]...  |
>remove pkg...  | purge pkg...  |
>source pkg [{=pkg_version_number | /target_release}]...  |
>build-dep pkg [{=pkg_version_number | /target_release}]...  |
>download pkg [{=pkg_version_number | /target_release}]...  |
>check | clean | autoclean | autoremove | {-v | --version} |
>{-h | --help}}
> 
> So option -a appears both as a single option -a and as -a=architecture.
> 
> In the apt(8) man page, only the second form is listed, but for both
> commands, it is unusable:
> 
> # apt-get -a=i386 install libfontconfig-dev
> E: Command line option 'a' [from -a=i386] is not understood in combination 
> with the other options.
> 
> # apt -a=i386 install libfontconfig-dev
> E: Command line option 'a' [from -a=i386] is not understood in combination 
> with the other options.

-a in that sense is an argument to build-dep and family (source --build,
satisfy). It is short for host-architecture, and makes no sense in any
other command.

You seem to be trying to install libfontconfig-dev:i386

We haven't explained that it works outside of source --compile and
build-dep (i.e. in satisfy) but I fail to see how you get to try
to pass this to install after reading the manual page.

The help output obviously can't tell you which commands support
which arguments.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer  i speak de, en



Bug#1061148: apt: option -a has several meanings and is unusable

2024-01-19 Thread Vincent Lefevre
Package: apt
Version: 2.7.9
Severity: normal

In the apt-get(8) man page:

   apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file]
   [-t=target_release] [-a=architecture] {update | upgrade |
   dselect-upgrade | dist-upgrade |
   install pkg [{=pkg_version_number | /target_release}]...  |
   remove pkg...  | purge pkg...  |
   source pkg [{=pkg_version_number | /target_release}]...  |
   build-dep pkg [{=pkg_version_number | /target_release}]...  |
   download pkg [{=pkg_version_number | /target_release}]...  |
   check | clean | autoclean | autoremove | {-v | --version} |
   {-h | --help}}

So option -a appears both as a single option -a and as -a=architecture.

In the apt(8) man page, only the second form is listed, but for both
commands, it is unusable:

# apt-get -a=i386 install libfontconfig-dev
E: Command line option 'a' [from -a=i386] is not understood in combination with 
the other options.

# apt -a=i386 install libfontconfig-dev
E: Command line option 'a' [from -a=i386] is not understood in combination with 
the other options.

-- Package-specific info:

-- (no /etc/apt/preferences present) --


-- (/etc/apt/preferences.d/no-adobe-flash-plugin present, but not submitted) --


-- (/etc/apt/preferences.d/no-pipewire present, but not submitted) --


-- (/etc/apt/sources.list present, but not submitted) --


-- (/etc/apt/sources.list.d/local-i386.list present, but not submitted) --


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'stable-security'), (500, 'stable-debug'), (500, 'proposed-updates-debug'), 
(500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.6.11-amd64 (SMP w/12 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages apt depends on:
ii  adduser 3.137
ii  base-passwd 3.6.3
ii  debian-archive-keyring  2023.4
ii  gpgv2.2.40-1.1+b1
ii  libapt-pkg6.0   2.7.9
ii  libc6   2.37-13
ii  libgcc-s1   13.2.0-9
ii  libgnutls30 3.8.3-1
ii  libseccomp2 2.5.5-1
ii  libstdc++6  13.2.0-9
ii  libsystemd0 255.2-4

Versions of packages apt recommends:
ii  ca-certificates  20230311

Versions of packages apt suggests:
ii  apt-doc 2.7.9
ii  aptitude0.8.13-5+b1
ii  dpkg-dev1.22.2
ii  gnupg   2.2.40-1.1
ii  powermgmt-base  1.37

-- no debconf information

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)