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

telepresence: fix build #92743

Merged
merged 4 commits into from Jul 8, 2020
Merged

telepresence: fix build #92743

merged 4 commits into from Jul 8, 2020

Conversation

MasseGuillaume
Copy link
Contributor

setuptools-scm needs a full git repo in it's source to fetch the
version from the git tag

Motivation for this change
nix-env -f . -iA telepresence    
installing 'python3.8-telepresence-0.105'
these derivations will be built:
  /nix/store/hw8zqlgg65h2qcwa3i1wd568g395w2k3-sshuttle-0.78.5.drv
  /nix/store/l63g1kar8dp8xrqdkf0rw4lrf54w0q1c-python3.8-telepresence-0.105.drv
building '/nix/store/hw8zqlgg65h2qcwa3i1wd568g395w2k3-sshuttle-0.78.5.drv'...
Sourcing python-recompile-bytecode-hook.sh
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing setuptools-build-hook
Using setuptoolsBuildPhase
Using setuptoolsShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing setuptools-check-hook
Using setuptoolsCheckPhase
unpacking sources
unpacking source archive /nix/store/nb7kh6cl09hcvpsijlb2dlaymwslkfa7-source
source root is source
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/tox.ini
patching sources
applying patch /nix/store/zhv3gyxd78kyfh6iyr2v408wbafp7d36-sudo.patch
patching file sshuttle/client.py
Hunk #1 succeeded at 185 with fuzz 1 (offset -7 lines).
configuring
no configure script, doing nothing
building
Executing setuptoolsBuildPhase
Traceback (most recent call last):
  File "nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "setup.py", line 29, in <module>
    setup(
  File "/nix/store/ld0khsbfx69hrvp4qfv3ijw0iczrkiyv-python3.8-setuptools-46.1.3/lib/python3.8/site-packages/setuptools/__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "/nix/store/f87w21b91cws0wbsvyfn5vnlyv491czi-python3-3.8.3/lib/python3.8/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/nix/store/ld0khsbfx69hrvp4qfv3ijw0iczrkiyv-python3.8-setuptools-46.1.3/lib/python3.8/site-packages/setuptools/dist.py", line 425, in __init__
    _Distribution.__init__(self, {
  File "/nix/store/f87w21b91cws0wbsvyfn5vnlyv491czi-python3-3.8.3/lib/python3.8/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/nix/store/ld0khsbfx69hrvp4qfv3ijw0iczrkiyv-python3.8-setuptools-46.1.3/lib/python3.8/site-packages/setuptools/dist.py", line 717, in finalize_options
    ep(self)
  File "/nix/store/ld0khsbfx69hrvp4qfv3ijw0iczrkiyv-python3.8-setuptools-46.1.3/lib/python3.8/site-packages/setuptools/dist.py", line 724, in _finalize_setup_keywords
    ep.load()(self, ep.name, value)
  File "/nix/store/0p46jr9krabb9znd3zdwz3ia7639z22x-python3.8-setuptools_scm-4.1.2/lib/python3.8/site-packages/setuptools_scm/integration.py", line 17, in version_keyword
    dist.metadata.version = _get_version(config)
  File "/nix/store/0p46jr9krabb9znd3zdwz3ia7639z22x-python3.8-setuptools_scm-4.1.2/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 148, in _get_version
    parsed_version = _do_parse(config)
  File "/nix/store/0p46jr9krabb9znd3zdwz3ia7639z22x-python3.8-setuptools_scm-4.1.2/lib/python3.8/site-packages/setuptools_scm/__init__.py", line 110, in _do_parse
    raise LookupError(
LookupError: setuptools-scm was unable to detect version for '/build/source'.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
builder for '/nix/store/hw8zqlgg65h2qcwa3i1wd568g395w2k3-sshuttle-0.78.5.drv' failed with exit code 1
cannot build derivation '/nix/store/l63g1kar8dp8xrqdkf0rw4lrf54w0q1c-python3.8-telepresence-0.105.drv': 1 dependencies couldn't be built
error: build of '/nix/store/l63g1kar8dp8xrqdkf0rw4lrf54w0q1c-python3.8-telepresence-0.105.drv' failed
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.

Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

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

Also, please make 2 commits, one fixing the build, and one to bump the version.

@@ -8,6 +8,7 @@ let
url = "https://github.com/datawire/sshuttle.git";
rev = "32226ff14d98d58ccad2a699e10cdfa5d86d6269";
sha256 = "1q20lnljndwcpgqv2qrf1k0lbvxppxf98a4g5r9zd566znhcdhx3";
deepClone = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

You should be able to just add a

preBuild = ''
  export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
'';

@MasseGuillaume MasseGuillaume changed the title telepresence: add deepClone = true to make setuptools-scm happy telepresence: fix build Jul 8, 2020
@Mic92
Copy link
Member

Mic92 commented Jul 8, 2020

Result of nixpkgs-review pr 92743 1

1 package built:
- telepresence

@Mic92 Mic92 merged commit a468c3a into NixOS:master Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants