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

gspeech: init at 0.9.2 #86641

Merged
merged 1 commit into from May 13, 2020
Merged

Conversation

@mothsART
Copy link
Contributor

mothsART commented May 3, 2020

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@nixos-discourse
Copy link

nixos-discourse commented May 5, 2020

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/creation-dun-paquet-nix-pour-gspeech/7039/1

@jpotier
Copy link
Contributor

jpotier commented May 5, 2020

chore: You may want to redo your --amend, as your second commit is actually named --amend :)

@mothsART mothsART force-pushed the mothsART:feature/new-package-gspeech branch from 29441d4 to 6a91f5a May 5, 2020
@mothsART
Copy link
Contributor Author

mothsART commented May 5, 2020

chore: You may want to redo your --amend, as your second commit is actually named --amend :)

correct, done.

@jpotier
Copy link
Contributor

jpotier commented May 5, 2020

Trying to build locally (with sandboxing, on NixOS) fails with the following error:

$ git clone https://github.com/mothsART/nixpkgs
$ git checkout feature/new-package-gspeech
$ nix build -I nixpkgs=./ nixpkgs.gspeech
builder for '/nix/store/z90zqbzd3b7g5hapbc5956rv4bh5rrdg-gSpeech-0.9.0.drv' failed with exit code 1; last 10 log lines:
  writing entry points to gspeech.egg-info/entry_points.txt
  writing top-level names to gspeech.egg-info/top_level.txt
  package init file 'speech/workers/__init__.py' not found (or not a regular file)
  package init file 'speech/workers/fr_FR/__init__.py' not found (or not a regular file)
  reading manifest file 'gspeech.egg-info/SOURCES.txt'
  writing manifest file 'gspeech.egg-info/SOURCES.txt'
  running build_ext
  /build/source/speech/widgets/save.py:5: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
    from gi.repository import Gtk
  error: [Errno 13] Permission denied: '/homeless-shelter'
[1 built (1 failed), 174 copied (803.4 MiB), 178.9 MiB DL]
error: build of '/nix/store/z90zqbzd3b7g5hapbc5956rv4bh5rrdg-gSpeech-0.9.0.drv' failed

I see ofborg has the exact same problem trying to build gspeech. Unfortunately, I'm not too familiar with building python packages in nix, so my helping is limited.

This error: error: [Errno 13] Permission denied: '/homeless-shelter' usually happens when a program tries to write to the $HOME directory during the build ($HOME is set to /homeless-shelter which does not exist, on purpose), which is forbidden.

@mothsART mothsART changed the title gspeech: init at 0.9.0 gspeech: init at 0.9.1 May 5, 2020
@mothsART mothsART force-pushed the mothsART:feature/new-package-gspeech branch from 6a91f5a to 10e9996 May 5, 2020
@mothsART
Copy link
Contributor Author

mothsART commented May 5, 2020

Found : I edited my project, pass to version 0.9.1 and updated my sha256 hash.

@jpotier
Copy link
Contributor

jpotier commented May 5, 2020

Confirmed, I can now build the project on NixOS with sandboxing enabled. Still I cannot run it, Binary runs, but fails. Is there some runtime dependencies I should have to test this?

$ ./result/bin/gspeech
Traceback (most recent call last):
  File "/nix/store/2521np3363z8vzk8358lb3mcpsb1pxka-gSpeech-0.9.1/bin/..gspeech-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/2521np3363z8vzk8358lb3mcpsb1pxka-gSpeech-0.9.1/lib/python3.7/site-packages/speech/main.py", line 249, in main
    pid.kill_if_already_exist(conf.app_name, conf.pid)
  File "/nix/store/2521np3363z8vzk8358lb3mcpsb1pxka-gSpeech-0.9.1/lib/python3.7/site-packages/speech/pid.py", line 23, in kill_if_already_exist
    with open(pid_path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/eeva/.cache/gSpeech/gspeech.pid'
@jpotier
Copy link
Contributor

jpotier commented May 5, 2020

The other binary seems to run fine though:

$ ./result/bin/gspeech-cli
gSpeech version 0.9.0
Usage : gSpeech-cli -i "[text to read]" ( or -f [txt file] ) -o [.wav filename] ... -l [optional lang]

Common flags:
-h   --help                   show usage information
-v   --version                show version information
-i   --input-text             text to read
-f   --input-file             file to read (supported only plain txt
-o   --output-file            name of the audio output file (wav type)
-l   --lang                   language

possible languages:
de-DE
en-GB
en-US
es-ES
fr-FR
it-IT
@jpotier
jpotier approved these changes May 5, 2020
Copy link
Contributor

jpotier left a comment

LGTM, builds in sandbox, produces valid binaries

@mothsART mothsART force-pushed the mothsART:feature/new-package-gspeech branch from 10e9996 to 56d8f73 May 5, 2020
@mothsART mothsART changed the title gspeech: init at 0.9.1 gspeech: init at 0.9.2 May 5, 2020
@mothsART mothsART closed this May 5, 2020
@mothsART mothsART reopened this May 5, 2020
@mothsART
Copy link
Contributor Author

mothsART commented May 5, 2020

Confirmed, I can now build the project on NixOS with sandboxing enabled. Still I cannot run it, Binary runs, but fails. Is there some runtime dependencies I should have to test this?

$ ./result/bin/gspeech
Traceback (most recent call last):
  File "/nix/store/2521np3363z8vzk8358lb3mcpsb1pxka-gSpeech-0.9.1/bin/..gspeech-wrapped-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/2521np3363z8vzk8358lb3mcpsb1pxka-gSpeech-0.9.1/lib/python3.7/site-packages/speech/main.py", line 249, in main
    pid.kill_if_already_exist(conf.app_name, conf.pid)
  File "/nix/store/2521np3363z8vzk8358lb3mcpsb1pxka-gSpeech-0.9.1/lib/python3.7/site-packages/speech/pid.py", line 23, in kill_if_already_exist
    with open(pid_path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/eeva/.cache/gSpeech/gspeech.pid'

No problems with runtime dependencies. An other application bug (on first launch) ; correction on 0.9.2 version.
Seems fine now.

@Lassulus
Copy link
Contributor

Lassulus commented May 5, 2020

running gspeech-cli -i "hello world" gives me:

sh: pico2wave: command not found
@jpotier
Copy link
Contributor

jpotier commented May 6, 2020

This works fine: nix run nixpkgs.picotts -c ./result/bin/gspeech-cli -i "hello world". @mothsART you know better how this package should be used: do you think it should be a self contained unit, or just the frontend?

@NinjaTrappeur
Copy link
Contributor

NinjaTrappeur commented May 6, 2020

You can use wrapProgram to create a wrapper in charge of appending the runtime dependencies in the binary $PATH.

For instance:

wrapProgram $out/bin/aerc --prefix PATH ":" \


This package is a fork of a fork of a fork. Is there a particular reason not to upstream your changes? Did you try to at least to open a PR upstream?

@mothsART mothsART force-pushed the mothsART:feature/new-package-gspeech branch from 56d8f73 to f36cbdc May 7, 2020
@mothsART
Copy link
Contributor Author

mothsART commented May 7, 2020

thanks to all: i use "wrapProgram" now and gspeech is working like a charm.

@NinjaTrappeur : this package is a fork of a fork, i'm aware of it.
Firstable, i've evolved gSpeech because I participate to a french Linux distribution (educative), who's naming Primtux : https://primtux.fr/

Last at least one year, the creator of Gspeech redirect to the fork : tuxmouraille/gSpeech#4 (comment)

I've pushed 2 PR to lusum repo, merged by him after a long time but reworked behind without PEP8, an ugly monolitic code...

My goal was to refactor for bring unit and fonctionnal test with CI, flake8 compatibility, add some algorithms and dictionnary to perform tts quality (french tts first), upgrade to python3 and gtk3, adapt for better debian and nix packaging etc.

Doing all of this in upstream would have taken me a lot longer and a lot of uncertainty.
If the project would have been more dynamic, I would probably have acted differently.

@Lassulus
Copy link
Contributor

Lassulus commented May 13, 2020

hmm, running gspeech does nothing for me. I need to kill it with ctrl+c. What is it supposed to do?

@mothsART
Copy link
Contributor Author

mothsART commented May 13, 2020

@Lassulus : gspeech launch an application indicator like this https://wiki.primtux.fr/lib/exe/detail.php/wiki:gspeech.png?id=gspeech

@Lassulus
Copy link
Contributor

Lassulus commented May 13, 2020

ah, I didn't have a tray, tested it now with stalonetray, everything works fine

@Lassulus Lassulus merged commit a7a7911 into NixOS:master May 13, 2020
16 checks passed
16 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="f36cbdc"; rev="f36cbdcbdc4d153a3efec1d0cd3a25f34484e514"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
gspeech, gspeech.passthru.tests on aarch64-linux Success
Details
gspeech, gspeech.passthru.tests on x86_64-linux Success
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.