On Tue, 12 Sep 2023, Eli Schwartz wrote:
+ mkdir -p "${BUILD_DIR}" || die
+ local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg"
+ cat > "${DIST_EXTRA_CONFIG}" <<-EOF
+ [build]
+ build_base = ${BUILD_DIR}/build
+
+ [build_ext]
+ parallel = ${jobs}
+ EOF
On Tue, 12 Sep 2023, Eli Schwartz wrote:
+ mkdir -p "${BUILD_DIR}" || die
+ local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg"
+ cat > "${DIST_EXTRA_CONFIG}" <<-EOF
+ [build]
+ build_base = ${BUILD_DIR}/build
+
+ [build_ext]
+ parallel = ${jobs}
+ EOF
"|| die" should also be added for the cat command.
On 9/12/23 3:56 PM, Ulrich Mueller wrote:
On Tue, 12 Sep 2023, Eli Schwartz wrote:
+ mkdir -p "${BUILD_DIR}" || die
+ local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg"
+ cat > "${DIST_EXTRA_CONFIG}" <<-EOF
+ [build]
+ build_base = ${BUILD_DIR}/build
+
+ [build_ext]
+ parallel = ${jobs}
+ EOF
"|| die" should also be added for the cat command.
Redirecting output to a file in a directory you have just guaranteed to
exist cannot fail.
EOFcat: write error: No space left on device
On Tue, 2023-09-12 at 22:07 -0400, Eli Schwartz wrote:
On 9/12/23 3:56 PM, Ulrich Mueller wrote:
On Tue, 12 Sep 2023, Eli Schwartz wrote:
+ mkdir -p "${BUILD_DIR}" || die
+ local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg"
+ cat > "${DIST_EXTRA_CONFIG}" <<-EOF
+ [build]
+ build_base = ${BUILD_DIR}/build
+
+ [build_ext]
+ parallel = ${jobs}
+ EOF
"|| die" should also be added for the cat command.
Redirecting output to a file in a directory you have just guaranteed to
exist cannot fail.
Eh, you make me prove you wrong:
# cat > dupa <<-EOF
blahblah
EOFcat: write error: No space left on device
On 9/12/23 10:26 PM, Michał Górny wrote:
On Tue, 2023-09-12 at 22:07 -0400, Eli Schwartz wrote:
On 9/12/23 3:56 PM, Ulrich Mueller wrote:
On Tue, 12 Sep 2023, Eli Schwartz wrote:
+ mkdir -p "${BUILD_DIR}" || die
+ local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg"
+ cat > "${DIST_EXTRA_CONFIG}" <<-EOF
+ [build]
+ build_base = ${BUILD_DIR}/build
+
+ [build_ext]
+ parallel = ${jobs}
+ EOF
"|| die" should also be added for the cat command.
Redirecting output to a file in a directory you have just guaranteed to
exist cannot fail.
Eh, you make me prove you wrong:
# cat > dupa <<-EOF
blahblah
EOFcat: write error: No space left on device
ಠ_ಠ
Is portage generally expected to successfully complete (including
internal metadata write stages) when its workdir drive runs out of space partway through?
On 9/12/23 10:26 PM, Michał Górny wrote:
On Tue, 2023-09-12 at 22:07 -0400, Eli Schwartz wrote:
On 9/12/23 3:56 PM, Ulrich Mueller wrote:
On Tue, 12 Sep 2023, Eli Schwartz wrote:
+ mkdir -p "${BUILD_DIR}" || die
+ local -x DIST_EXTRA_CONFIG="${BUILD_DIR}/extra-setup.cfg"
+ cat > "${DIST_EXTRA_CONFIG}" <<-EOF
+ [build]
+ build_base = ${BUILD_DIR}/build
+
+ [build_ext]
+ parallel = ${jobs}
+ EOF
"|| die" should also be added for the cat command.
Redirecting output to a file in a directory you have just guaranteed to
exist cannot fail.
Eh, you make me prove you wrong:
# cat > dupa <<-EOF
blahblah
EOFcat: write error: No space left on device
ಠ_ಠ
Is portage generally expected to successfully complete (including
internal metadata write stages) when its workdir drive runs out of space partway through?
On Wed, 13 Sep 2023, Eli Schwartz wrote:
"|| die" should also be added for the cat command.
Redirecting output to a file in a directory you have just guaranteed
to exist cannot fail.
Is portage generally expected to successfully complete (including
internal metadata write stages) when its workdir drive runs out of space partway through?
On Tue, 2023-09-12 at 22:52 -0400, Eli Schwartz wrote:
Is portage generally expected to successfully complete (including
internal metadata write stages) when its workdir drive runs out of space
partway through?
No, but I think what everyone else is forgetting to mention is that if
it's going to fail, we want it to fail as soon as possible, i.e. as
close to the thing that actually went wrong. If we proceed past ENOSPC
or whatever, we could get five or six lines further in the ebuild, and
then some other command will fail but possibly with a crazy unrelated
error message.
On Wed, 13 Sep 2023, Eli Schwartz wrote:
"|| die" should also be added for the cat command.
Redirecting output to a file in a directory you have just guaranteed
to exist cannot fail.
That's a rather bold statement. I can imagine a number of possible
failures, e.g. no space left on device, quota exceeded, or a low-level
I/O error of the filesystem. Also fork or exec of the cat command could
fail (e.g. out of memory).
While either of these may be unlikely here, best practice is to check
for errors of _all_ external commands.
On Wed, 13 Sep 2023, Eli Schwartz wrote:
That's a rather bold statement. I can imagine a number of possible
failures, e.g. no space left on device, quota exceeded, or a low-level
I/O error of the filesystem. Also fork or exec of the cat command could
fail (e.g. out of memory).
While either of these may be unlikely here, best practice is to check
for errors of _all_ external commands.
The implementation of `die` performs a fork+exec of the sed command,
invokes eerror (many times!) which forks to pipe, invokes $() which
forks, and could behave abnormally due to out of memory. It is not safe
to treat `|| die` as error recovery for an out of memory condition.
The implementation of `die` performs multiple writes to files inside of ${PORTAGE_BUILDDIR}, and could behave abnormally due to write failures.
It is not safe to treat `|| die` as error recovery for a write failure
of the ${PORTAGE_BUILDDIR} drive (whatever the reason for that write failure).
(And the `|| die` is added to the next revision of this patch either way.)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 475 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:38:28 |
Calls: | 9,487 |
Calls today: | 6 |
Files: | 13,617 |
Messages: | 6,121,092 |