Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 933136 - sci-libs/netcdf-4.9.1-r1 fails tests: (no error message)
Summary: sci-libs/netcdf-4.9.1-r1 fails tests: (no error message)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2024-05-29 22:30 UTC by matoro
Modified: 2024-05-29 23:46 UTC (History)
1 user (show)

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


Attachments
build.log and emerge --info (file_933136.txt,637.99 KB, text/plain)
2024-05-29 22:30 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2024-05-29 22:30:09 UTC
Created attachment 894631 [details]
build.log and emerge --info

This actually is a regression from 4.9.2

Test phase: sci-libs/netcdf-4.9.2-r1
 * ERROR: sci-libs/netcdf-4.9.2-r1::gentoo failed (test phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 136:  Called src_test
 *   environment, line 2252:  Called die
 * The specific snippet of code:
 *       [[ -f "${BUILD_DIR}/nc_test4/run_par_test.sh" ]] && sed -e 's/mpiexec/mpiexec --use-hwthread-cpus/g' -i "${BUILD_DIR}/nc_test4/run_par_test.sh" || die;
Comment 1 Larry the Git Cow gentoo-dev 2024-05-29 23:46:53 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7aa3a581c47230c4df31588134acd090b67cc984

commit 7aa3a581c47230c4df31588134acd090b67cc984
Author:     Eli Schwartz <eschwartz93@gmail.com>
AuthorDate: 2024-05-29 23:34:59 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-29 23:46:07 +0000

    sci-libs/netcdf: fix bad bash scripting leading to failed tests
    
    If USE=-mpi, a file in src_test is NOT sedded to fix a bug in the file,
    because the file does not exist. But this condition was incorrectly
    coded.
    
    In bash:
    
    ```
    cmd1 && cmd2 || cmd3
    ```
    
    is a code smell. If either of the first two commands fails, the third
    command is run -- in this case, die. In other words, the first two
    commands were *supposed* to be "only run cmd2 if it makes sense to".
    Instead, if it "doesn't make sense to" run cmd2, the die was triggered.
    
    A more general solution is to spec the build format to require all
    commands to pass without manually `die`ing (leading to the use of &&
    ceasing in general), but that is not how portage works. Either way, the
    solution is using `if` as intended.
    
    ref. https://mywiki.wooledge.org/BashGuide/TestsAndConditionals
    
    Closes: https://bugs.gentoo.org/933136
    Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 sci-libs/netcdf/netcdf-4.9.2-r1.ebuild | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)