Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 730610 - devmanual: new "User environment" section
Summary: devmanual: new "User environment" section
Status: RESOLVED FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Devmanual (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Devmanual Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2020-07-03 12:44 UTC by Michael Orlitzky
Modified: 2021-03-26 19:05 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-ebuild-writing-variables-add-a-User-environment-sect.patch (0001-ebuild-writing-variables-add-a-User-environment-sect.patch,7.63 KB, patch)
2020-07-03 12:44 UTC, Michael Orlitzky
Details | Diff
0001-ebuild-writing-variables-add-a-User-environment-sect.patch (0001-ebuild-writing-variables-add-a-User-environment-sect.patch,7.63 KB, patch)
2020-07-16 13:18 UTC, Michael Orlitzky
Details | Diff
0001-ebuild-writing-variables-add-a-User-environment-sect.patch (0001-ebuild-writing-variables-add-a-User-environment-sect.patch,6.53 KB, patch)
2020-07-16 13:58 UTC, Michael Orlitzky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Orlitzky gentoo-dev 2020-07-03 12:44:03 UTC
Created attachment 647486 [details, diff]
0001-ebuild-writing-variables-add-a-User-environment-sect.patch

Per https://archives.gentoo.org/gentoo-dev/message/7550d3e2c372da5f861bb04d9a751f2d

I've CC'ed toolchain/sci for some advice on FFLAGS/FCFLAGS. Autoconf seems to use FCFLAGS as a replacement for FFLAGS with modern implementations, but I've left it out of the list for now because I'm not sure how to document it.

Here's the autoconf documentation:

https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Fortran-Compiler.html

But note that POSIX pairs up "FC" for the fortran compiler with "FFLAGS".
Comment 1 Ulrich Müller gentoo-dev 2020-07-04 13:47:26 UTC
Some remarks:

- Most of the external links are repeated multiple times. Would it be an option to mention them only on their first occurence?

- Certainly there must be a better reference for as than some third-party http url (which looks like a copyright violation)?

- Use the Gentoo ${FOO} convention for variable references. Currently there are references like $FOO or $(FOO).

- Use <c> where appropriate in examples (i.e., almost everywhere).

- Whitespace issues, look at https://devmanual.gentoo.org/appendices/devbook-guide/index.html#coding-style
Comment 2 Michael Orlitzky gentoo-dev 2020-07-16 13:18:53 UTC
Created attachment 649480 [details, diff]
0001-ebuild-writing-variables-add-a-User-environment-sect.patch

Here's a new version.

I think I've fixed the whitespace coding style issues. The links now only appear once, in a list above the table. And I've used <c> and ${FOO} everywhere.

That leaves the reference for "as", which really is the best I could find. I'm open to suggestions.

I've also removed the fortran stuff for now. A decision needs to be made here, but it should be made by people who use fortran. POSIX/GNU make mention only FC and FFLAGS, whereas autoconf and automake have adopted their own conventions (F77 vs FC, FFLAGS vs FCFLAGS) to separate the handling of modern and legacy fortran code. Not all upstreams support the new names, so we need to decide if ebuilds should take e.g. a user's FCFLAGS and shoehorn them into FFLAGS if FFLAGS are what some package uses for modern fortran code.
Comment 3 Michael Orlitzky gentoo-dev 2020-07-16 13:58:30 UTC
Created attachment 649494 [details, diff]
0001-ebuild-writing-variables-add-a-User-environment-sect.patch

Just kidding, here's the updated patch. GTK's file picker loves to show me the last thing I uploaded two weeks ago instead of the directory I'm in.
Comment 4 Michael Orlitzky gentoo-dev 2021-03-26 01:18:00 UTC
Any chance of getting this merged? sci-mathematics/maxima is using LDFLAGS incorrectly and it would be nice to have a place to send them.
Comment 5 Ulrich Müller gentoo-dev 2021-03-26 15:29:53 UTC
Yeah, the "as" reference shouldn't be a blocker. OK if I omit that link altogether?
Comment 6 Michael Orlitzky gentoo-dev 2021-03-26 15:44:56 UTC
(In reply to Ulrich Müller from comment #5)
> OK if I omit that link altogether?

Yeah, sure.
Comment 7 Larry the Git Cow gentoo-dev 2021-03-26 19:05:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=d9793d70892f5107f4a140e14dfec15997ef65cc

commit d9793d70892f5107f4a140e14dfec15997ef65cc
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2020-07-02 19:48:52 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2021-03-26 19:05:36 +0000

    ebuild-writing/variables: add a "User environment" section.
    
    Gentoo has always tried to respect a user's CFLAGS environment
    variable, ensuring that it is passed to the underlying build
    system. Likewise, CC and LDFLAGS are well-respected these days.
    
    Recently, we have added some other variables to this list, like NM,
    RANLIB, LD, and AS. The meanings of most of these are enshrined in
    toolchain-funcs.eclass, but in order to properly support them, we must
    document their intended use so that user's can set them to the correct
    value and developers can inject them into the right spot in the
    upstream build system. One motivating example package is PARI, whose
    build system interprets the LD environment variable in a different way
    than GNU librool interprets it. If a user sets LD to something
    appropriate for libtool, the PARI build will fail, and conversely;
    that is, without help from the ebuild.
    
    This commit adds a new section to the ebuild-writing/variables page
    documenting the origin and intended use of these variables within
    Gentoo. This should ensure that users and Gentoo developers agree on
    their meanings, and will guide ebuild development when a problematic
    upstream build system is encountered.
    
    Closes: https://bugs.gentoo.org/730610
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
    [Remove URI for "as". Whitespace fixes.]
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 ebuild-writing/variables/text.xml | 163 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 163 insertions(+)