Skip to content

nerd-dictation: init at unstable-2022-07-12#185148

Draft
jtojnar wants to merge 7 commits intoNixOS:masterfrom
jtojnar:nerd-dictation
Draft

nerd-dictation: init at unstable-2022-07-12#185148
jtojnar wants to merge 7 commits intoNixOS:masterfrom
jtojnar:nerd-dictation

Conversation

@jtojnar
Copy link
Member

@jtojnar jtojnar commented Aug 4, 2022

Description of changes

Depends on #236313

Fixes: #176121

cc @guy-who-googles

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@jtojnar jtojnar requested review from FRidh and jonringer as code owners August 4, 2022 18:36
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Aug 4, 2022
@jtojnar

This comment was marked as resolved.

@jtojnar jtojnar marked this pull request as draft August 4, 2022 18:36
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Aug 4, 2022
@ofborg ofborg bot requested a review from Mic92 August 4, 2022 21:12
@jtojnar jtojnar force-pushed the nerd-dictation branch 2 times, most recently from 3b40915 to 3127fbd Compare August 5, 2022 10:20
@jtojnar jtojnar marked this pull request as ready for review August 5, 2022 10:20
@jtojnar
Copy link
Member Author

jtojnar commented Aug 5, 2022

Appears to work now.

@jtojnar
Copy link
Member Author

jtojnar commented Aug 5, 2022

I do not like how it is rewriting the existing text, trying #185255 as an alternative.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you paste the log?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pythonCatchConflictsPhase
Found duplicated packages in closure for dependency 'nerd-dictation': 
  nerd-dictation 0.0.0 (/nix/store/3dc8q0l76p27nnyv8b8aijfhs6ssifk7-nerd-dictation-unstable-2022-07-12/lib/python3.10/site-packages)
  nerd-dictation 0.0.0 (/nix/store/3dc8q0l76p27nnyv8b8aijfhs6ssifk7-nerd-dictation-unstable-2022-07-12/lib/python3.10/site-packages)

Package duplicates found in closure, see above. Usually this happens if two packages depend on different version of the same dependency.

Copy link
Member

@SuperSandro2000 SuperSandro2000 Aug 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nerd_dictation-0.0.0.dist-info

The version number is not set correct.

https://github.com/ideasman42/nerd-dictation/blob/master/package/python/setup.py#L43

The version number is hardcoded to 0.0.0 which is the default value and should be treated as an error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layout in site-packages is really strange and very custom.
Anything installed under site-packages should be importable and it is frowned upon to files directly under site-packages.

I expect this to cause more trouble in the future.

Compared to a standard python package:

 ➜ tree result
 result ⇒ /nix/store/3qfd3gwpar83k89wdnw8pab7xr3bfv52-nerd-dictation-unstable-2022-07-12
├──  bin
│   └──  nerd-dictation
├──  lib
│   └──  python3.10
│       └──  site-packages
│           ├──  __pycache__
│           │   └──  setup.cpython-310.pyc
│           ├──  doc
│           │   └──  readme.rst
│           ├──  nerd-dictation
│           ├──  nerd_dictation-0.0.0.dist-info
│           │   ├──  direct_url.json
│           │   ├──  INSTALLER
│           │   ├──  METADATA
│           │   ├──  RECORD
│           │   ├──  REQUESTED
│           │   ├──  top_level.txt
│           │   └──  WHEEL
│           ├──  nerd_dictation.egg-info
│           │   ├──  dependency_links.txt
│           │   ├──  PKG-INFO
│           │   ├──  requires.txt
│           │   ├──  SOURCES.txt
│           │   └──  top_level.txt
│           ├──  nix_run_setup
│           └──  setup.py
├──  nerd-dictation
│   ├──  nerd-dictation
│   └──  readme.rst
└──  nix-support
    └──  propagated-build-inputs
 ➜ tree result
 result ⇒ /nix/store/k38smakhffi54jgpj21d4l51w5va85ly-python3.10-jsonschema-4.7.2
├──  bin
│   └──  jsonschema
├──  lib
│   └──  python3.10
│       └──  site-packages
│           ├──  jsonschema
│           │   ├──  __init__.py
│           │   ├──  __main__.py
│           │   ├──  __pycache__
│           │   │   ├──  __init__.cpython-310.pyc
│           │   │   ├──  __main__.cpython-310.pyc
│           │   │   ├──  _format.cpython-310.pyc
│           │   │   ├──  _legacy_validators.cpython-310.pyc
│           │   │   ├──  _reflect.cpython-310.pyc
│           │   │   ├──  _types.cpython-310.pyc
│           │   │   ├──  _utils.cpython-310.pyc
│           │   │   ├──  _validators.cpython-310.pyc
│           │   │   ├──  cli.cpython-310.pyc
│           │   │   ├──  exceptions.cpython-310.pyc
│           │   │   ├──  protocols.cpython-310.pyc
│           │   │   └──  validators.cpython-310.pyc
│           │   ├──  _format.py
│           │   ├──  _legacy_validators.py
│           │   ├──  _reflect.py
│           │   ├──  _types.py
│           │   ├──  _utils.py
│           │   ├──  _validators.py
│           │   ├──  benchmarks
│           │   │   ├──  __init__.py
│           │   │   ├──  __pycache__
│           │   │   │   ├──  __init__.cpython-310.pyc
│           │   │   │   ├──  issue232.cpython-310.pyc
│           │   │   │   └──  json_schema_test_suite.cpython-310.pyc
│           │   │   ├──  issue232
│           │   │   │   └──  issue.json
│           │   │   ├──  issue232.py
│           │   │   └──  json_schema_test_suite.py
│           │   ├──  cli.py
│           │   ├──  exceptions.py
│           │   ├──  protocols.py
│           │   ├──  schemas
│           │   │   ├──  draft2019-09.json
│           │   │   ├──  draft2020-12.json
│           │   │   ├──  draft3.json
│           │   │   ├──  draft4.json
│           │   │   ├──  draft6.json
│           │   │   ├──  draft7.json
│           │   │   └──  vocabularies.json
│           │   ├──  tests
│           │   │   ├──  __init__.py
│           │   │   ├──  __pycache__
│           │   │   │   ├──  __init__.cpython-310.pyc
│           │   │   │   ├──  _helpers.cpython-310.pyc
│           │   │   │   ├──  _suite.cpython-310.pyc
│           │   │   │   ├──  fuzz_validate.cpython-310.pyc
│           │   │   │   ├──  test_cli.cpython-310.pyc
│           │   │   │   ├──  test_deprecations.cpython-310.pyc
│           │   │   │   ├──  test_exceptions.cpython-310.pyc
│           │   │   │   ├──  test_format.cpython-310.pyc
│           │   │   │   ├──  test_jsonschema_test_suite.cpython-310.pyc
│           │   │   │   ├──  test_types.cpython-310.pyc
│           │   │   │   ├──  test_utils.cpython-310.pyc
│           │   │   │   └──  test_validators.cpython-310.pyc
│           │   │   ├──  _helpers.py
│           │   │   ├──  _suite.py
│           │   │   ├──  fuzz_validate.py
│           │   │   ├──  test_cli.py
│           │   │   ├──  test_deprecations.py
│           │   │   ├──  test_exceptions.py
│           │   │   ├──  test_format.py
│           │   │   ├──  test_jsonschema_test_suite.py
│           │   │   ├──  test_types.py
│           │   │   ├──  test_utils.py
│           │   │   └──  test_validators.py
│           │   └──  validators.py
│           └──  jsonschema-4.7.2.dist-info
│               ├──  direct_url.json
│               ├──  entry_points.txt
│               ├──  INSTALLER
│               ├──  licenses
│               │   └──  COPYING
│               ├──  METADATA
│               ├──  RECORD
│               ├──  REQUESTED
│               └──  WHEEL
└──  nix-support
    └──  propagated-build-inputs

Copy link
Member Author

@jtojnar jtojnar Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there is something for that here: ideasman42/nerd-dictation#79

@jtojnar jtojnar marked this pull request as draft August 6, 2022 14:32
@reivilibre
Copy link
Contributor

reivilibre commented Sep 28, 2022

@jtojnar I'd be interested in having vosk-api packaged in NixOS if nothing else; assuming you're too busy to continue with this PR at the moment(?), would it be acceptable to you if I took your work packaging vosk-api and opened a PR with just that?
EDIT: Just noticed that this may be being done in #186917

@jtojnar
Copy link
Member Author

jtojnar commented Sep 28, 2022 via email

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/speech-to-text-virtual-keyboard-in-nixos/22684/2

@jtojnar jtojnar force-pushed the nerd-dictation branch 3 times, most recently from cc3ccca to 614ace9 Compare June 6, 2023 17:20
jtojnar and others added 5 commits June 6, 2023 22:02
It looks like after a bump, CMake started passing `--git-dir=.git` as the first argument of `git rev-parse`.
But we do not really need to spoof `git` program now that Kaldi uses CMake’s `FetchContent` module.
We can just pass the path using configure flag directly:

https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_SOURCE_DIR_%3CuppercaseName%3E

Git was also inadvertently used for generating `KALDI_PATCH_NUMBER`
in `VersionHelper`, to be potentially appended to `KALDI_VERSION`
but it was not actually being done by default.
We can set the variable directly to skip `VersionHelper`.

Also remove redundant `enableParallelBuild` since CMake enables it.

And drop separate `dev` output since Kaldi currently hardcodes
the `include/` directory so consumers would not be able to find them.
Splitting it out only removes 7 out of 303 MB.
It is shadowed by fetchgit source and can only be used vendored.
Also switch to finalAttrs so that the values can be easily overridden.
Co-Authored-By: Reuben Steenekamp <reuben.steenekamp@gmail.com>
@jtojnar jtojnar force-pushed the nerd-dictation branch 2 times, most recently from b230bb8 to afa4cda Compare June 6, 2023 20:25
jtojnar and others added 2 commits June 6, 2023 22:33
Co-Authored-By: Reuben Steenekamp <reuben.steenekamp@gmail.com>
Co-Authored-By: Reuben Steenekamp <reuben.steenekamp@gmail.com>
@jtojnar jtojnar mentioned this pull request Jun 6, 2023
13 tasks
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/assistance-needed-in-packaging-python-program/33420/3

@jtara1 jtara1 mentioned this pull request Feb 6, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: python Python is a high-level, general-purpose programming language. 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nerd Dictation

5 participants