Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builtin and type don't exist in dash (util/make_version is invoked inconsistently) #702

Closed
JasonGross opened this issue Aug 22, 2023 · 0 comments · Fixed by #703
Closed

Comments

@JasonGross
Copy link
Contributor

util/make_version seems to be written for bash according to

#!/usr/bin/env bash

but the Makefile explicitly invokes it with

VST/Makefile

Line 858 in 2888663

sh util/make_version ${BITSIZE} ${COMPCERT_VERSION}

rather than ./util/make_version or util/make_version (without sh)

On systems (like default Ubuntu, I think) where sh is symlinked to dash, this results in

util/make_version: 4: builtin: not found
util/make_version: 21: gdate: not found

and then the script quits. This is mostly alright, though it results in the date definition being the empty string. According to stack exchange, command -v is the POSIX-compliant way of writing type -P. Alternatively, you could drop the sh invocation

JasonGross added a commit to JasonGross/VST that referenced this issue Aug 22, 2023
Fixes PrincetonUniversity#702

I've avoided `&>` as its not POSIX-complaint according to [stack
exchange](https://unix.stackexchange.com/a/590707/45323).

I've also taken the opportunity to simplify slightly the logic that
checks for `git`, relying on the return code of `command -v` rather than
testing that the resulting path exists.
JasonGross added a commit to JasonGross/VST that referenced this issue Aug 22, 2023
Fixes PrincetonUniversity#702

I've avoided `&>` as its not POSIX-complaint according to [stack
exchange](https://unix.stackexchange.com/a/590707/45323).

I've also taken the opportunity to simplify slightly the logic that
checks for `git`, relying on the return code of `command -v` rather than
testing that the resulting path exists.

Finally, I've removed the `2>/dev/null` redirect on `command -v`; when the
command does not exist, `command -v` is already silent, and I think we
want noise if `command` itself does not exist or is failing strangely
for some reason.
JasonGross added a commit to JasonGross/VST that referenced this issue Aug 22, 2023
Fixes PrincetonUniversity#702

I've avoided `&>` as its not POSIX-complaint according to [stack
exchange](https://unix.stackexchange.com/a/590707/45323).

I've also taken the opportunity to simplify slightly the logic that
checks for `git`, relying on the return code of `command -v` rather than
testing that the resulting path exists.

Note that there's no `2>/dev/null` redirect on `command -v`; when the
command does not exist, `command -v` is already silent, and I think we
want noise if `command` itself does not exist or is failing strangely
for some reason.
andrew-appel added a commit that referenced this issue Aug 29, 2023
andrew-appel added a commit that referenced this issue Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant