Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#30664 closed defect (fixed)

Fixup for "Add quiet mode for bootstrap"

Reported by: Matthias Köppe Owned by:
Priority: blocker Milestone: sage-9.2
Component: build Keywords:
Cc: Michael Orlitzky, Volker Braun Merged in:
Authors: Matthias Koeppe Reviewers: Michael Orlitzky
Report Upstream: N/A Work issues:
Branch: 28e584c (Commits, GitHub, GitLab) Commit:
Dependencies: #30533 Stopgaps:

Status badges

Change History (20)

comment:1 Changed 2 years ago by Matthias Köppe

Description: modified (diff)

comment:2 Changed 2 years ago by Matthias Köppe

Description: modified (diff)

comment:3 Changed 2 years ago by Matthias Köppe

I can just change it back to using #!/usr/bin/env bash...

comment:4 Changed 2 years ago by Matthias Köppe

Dependencies: #39533

comment:5 Changed 2 years ago by Matthias Köppe

Dependencies: #39533#30533

comment:6 Changed 2 years ago by Matthias Köppe

Branch: u/mkoeppe/fixup_for__add_quiet_mode_for_bootstrap_

comment:7 Changed 2 years ago by Matthias Köppe

Authors: Matthias Koeppe
Commit: 227845167fbe65ff1ac48348f63173f6070a98f2
Status: newneeds_review

New commits:

f537959Trac #30533: add new -q (quiet) flag for the bootstrap process.
6547b33Trac #30533: hide automake (stderr) output from ./bootstrap -q.
171b947Trac #30533: improve ./bootstrap usage() a bit.
7dcb5a8Trac #30533: whitespace cleanup in ./bootstrap.
ab83893Trac #30533: rename bootstrap-download() to bootstrap_download().
2b4272dTrac #30533: use /bin/sh to run the bootstrap script instead of bash.
b85f4a1Trac #30533: hide output from "./bootstrap -s" in quiet mode.
9c39bc8Trac #30533: hide info output from "./bootstrap -D" in quiet mode.
dd96aa3Merge branch 't/30533/ticket/30533' into t/30664/fixup_for__add_quiet_mode_for_bootstrap_
2278451boostrap: Repair ./bootstrap in unconfigured source trees.

comment:8 Changed 2 years ago by Michael Orlitzky

What error did you see with ./bootstrap? I tested it with every shell available to me, in a clean tree (after git clean -x -f -d).

Probably related: those two occurrences of source should be . instead. And we should be doing test -f <file> && . <file> instead of 2>/dev/null so that we don't hide other, unexpected errors.

comment:9 Changed 2 years ago by Matthias Köppe

It just stops silently when trying to source the non-existing src/bin/sage-env-config.

$ ./bootstrap  -d
rm -rf config configure build/make/Makefile-auto.in
rm -f src/doc/en/installation/*.txt
rm -rf src/doc/en/reference/spkg/*.rst
rm -f src/doc/en/reference/repl/*.txt

comment:10 Changed 2 years ago by Michael Orlitzky

I can't reproduce that with dash, bash, ksh, zsh, or posh. If you drop the 2>/dev/null, what goes wrong? (What shell are you using?)

The source is a bashism so I would think it fails there, but I don't know why it wouldn't proceed. In any case, changing those lines to -f <file> && . <file> will avoid the failure.

comment:11 Changed 2 years ago by Matthias Köppe

I observed it both locally on macOS, and in tox -e docker-conda-forge-ubuntu-standard.

comment:12 Changed 2 years ago by git

Commit: 227845167fbe65ff1ac48348f63173f6070a98f228e584c69509df900c0770bd5278d112820b5f4b

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

28e584cbootstrap: Check for src/bin/sage-env-config before sourcing

comment:13 Changed 2 years ago by Michael Orlitzky

I can't explain this, but when my /bin/sh points to /bin/zsh and I run the bootstrap script, it fails. If I run zsh ./bootstrap -d instead, it works fine -- so whatever I was doing to test was flawed. At first I thought zsh was looking at the shebang and re-executing the script with /bin/sh... but /bin/sh is still zsh!

Whatever is happening there, your branch fixes the problem. Look good on your end too?

comment:14 Changed 2 years ago by Matthias Köppe

Often $0=sh enables posixisms. bash does the same.

comment:15 Changed 2 years ago by Matthias Köppe

Yes, it works for me with this change, on both platforms

comment:16 Changed 2 years ago by Michael Orlitzky

Reviewers: Michael Orlitzky
Status: needs_reviewpositive_review

Ok, thanks. I'm still not sure why zsh handles that one set -e differently. I went back and re-tested the others, all as /bin/sh. More important things to worry about.

comment:17 Changed 2 years ago by Matthias Köppe

Thanks!

comment:18 Changed 2 years ago by Volker Braun

Branch: u/mkoeppe/fixup_for__add_quiet_mode_for_bootstrap_28e584c69509df900c0770bd5278d112820b5f4b
Resolution: fixed
Status: positive_reviewclosed

comment:19 Changed 2 years ago by Dima Pasechnik

Commit: 28e584c69509df900c0770bd5278d112820b5f4b

Is there are make target to remove src/bin/sage-env-config without running ./boostrap ? I could not find one, and this is a problem - ./bootstrap can fail on a stale sage-env-config.

comment:20 Changed 2 years ago by Dima Pasechnik

please see #30795 for a followup

Note: See TracTickets for help on using tickets.