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

gst-launch-1.0 prints printf usage on run #63751

Closed
nh2 opened this issue Jun 25, 2019 · 6 comments · Fixed by #89503
Closed

gst-launch-1.0 prints printf usage on run #63751

nh2 opened this issue Jun 25, 2019 · 6 comments · Fixed by #89503
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@nh2
Copy link
Contributor

nh2 commented Jun 25, 2019

Issue description

On Ubuntu:

NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/426028047db79f1ec567a0f60dcebc0b8ef1ddab.tar.gz nix-shell -p gst_all_1.gstreamer --run 'gst-launch-1.0 --version'
printf: usage: printf [-v var] format [arguments]
gst-launch-1.0 version 1.16.0
GStreamer 1.16.0
Unknown package origin

Why printf: usage: printf [-v var] format [arguments]?

It seems the wrapper is wrong somehow.

Contents:

#! /nix/store/w9ngash2dw3pvl98ysd79qy2rkkmc8my-bash-4.4-p23/bin/bash -e
export GST_PLUGIN_SYSTEM_PATH=$GST_PLUGIN_SYSTEM_PATH${GST_PLUGIN_SYSTEM_PATH:+:}$(unset _tmp; for profile in $NIX_PROFILES; do _tmp=$profile/lib/gstreamer-1.0${_tmp:+:}$_tmp; done; printf $_tmp)
exec -a "$0" "/nix/store/l94mb3cy5scyxvrhn04039l2yn183zbb-gstreamer-1.16.0-dev/bin/.gst-launch-1.0-wrapped"  "${extraFlagsArray[@]}" "$@"

Perhaps in printf $_tmp, $_tmp doesn't exist?

$ bash -x /nix/store/l94mb3cy5scyxvrhn04039l2yn183zbb-gstreamer-1.16.0-dev/bin/gst-launch-1.0 
++ unset _tmp
++ printf
printf: usage: printf [-v var] format [arguments]
+ export GST_PLUGIN_SYSTEM_PATH=
+ GST_PLUGIN_SYSTEM_PATH=
+ exec -a /nix/store/l94mb3cy5scyxvrhn04039l2yn183zbb-gstreamer-1.16.0-dev/bin/gst-launch-1.0 /nix/store/l94mb3cy5scyxvrhn04039l2yn183zbb-gstreamer-1.16.0-dev/bin/.gst-launch-1.0-wrapped

CC @jtojnar

@nh2
Copy link
Contributor Author

nh2 commented Jun 25, 2019

I have no $NIX_PROFILES btw.

@jtojnar
Copy link
Contributor

jtojnar commented Jun 25, 2019

We have to use NIX_PROFILES for the same reason as here: #33277 (comment)

Not really sure what to do about non-NixOS. Perhaps make the setting of the path conditional on the presence of NIX_PROFILES variable and rely on user having to set the variable manually? How else would GStreamer find plugins when there is no global /usr? Unless we want to use the plugins installed with apt, but I am not sure our GStreamer will support that since it was compiled with --prefix=$out not --prefix=/usr.

@jtojnar
Copy link
Contributor

jtojnar commented Jun 25, 2019

printf "$_tmp" might be a suitable fix for now.

@bjornfor
Copy link
Contributor

bjornfor commented Jun 25, 2019

I always thought that nix shell setup code on non-NixOS should set NIX_PROFILES=$HOME/.nix-profile, but never got around to submitting a PR.

@lheckemann
Copy link
Member

Also, it should probably be printf %s "$_tmp" instead?

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
andersk added a commit to andersk/nixpkgs that referenced this issue Jun 4, 2020
The bug was that the inner double quotes in "\$("…")" are not actually
inner like they would be in "$("…")".  We could write "\$(\"…\")", but
using single quotes on the outside makes everything simpler.

Fixes NixOS#63751.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@FRidh FRidh closed this as completed in c8d064e Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants