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

sourcetrail: fix hash for SourceTrailPythonIndexer #107533

Merged
merged 2 commits into from Jan 4, 2021

Conversation

sternenseemann
Copy link
Member

Motivation for this change

Fix build of sourcetrail

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.

cc @midchildan

Copy link
Member

@midchildan midchildan left a comment

Choose a reason for hiding this comment

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

Could you add a bit of context about where the original hash came from in the commit message?

Something along the lines of:

The sha256 for the python indexer wasn't updated along with the git
revision. The current hash is for commit 0d1246b.

    ❯ nix run nixpkgs.nix-prefetch-github -c nix-prefetch-github \
        --rev 0d1246be53b37639427fe9959f748dd0fc429c8f \
        CoatiSoftware SourcetrailPythonIndexer
    {
        "owner": "CoatiSoftware",
        "repo": "SourcetrailPythonIndexer",
        "rev": "0d1246be53b37639427fe9959f748dd0fc429c8f",
        "sha256": "05hlpd3am029pv1wi6mys3q0ggp64axmg8bdf1fabl9cl9jffscq",
        "fetchSubmodules": true

@sternenseemann
Copy link
Member Author

I built it locally and used the hash it told me it got instead of the expected one. I'm not sure if the hash changed upstream or was broken all along (maybe nix-prefetch-github without the --fetch-submodules?).

@midchildan
Copy link
Member

midchildan commented Dec 24, 2020

I should've mentioned this, but the example description I've put in the above comment is an accurate one. I've updated the version while creating the previous PR and forgot to update the hash. This slipped through the CI because Nix presumably locates the source by its hash, and the previous download was still remaining in the Nix store.

@sternenseemann
Copy link
Member Author

Ah, all right, you want it mentioned in the source file or commit?

@midchildan
Copy link
Member

The commit, so it's clear from the logs that the hash wasn't changed arbitrarily.

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107533 run on x86_64-darwin 1

1 package failed to build:
  • sourcetrail
/private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source/SourcetrailDB /private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source
/private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source
running tests
Traceback (most recent call last):
  File "/private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source/SourcetrailDB/build/bindings_python/sourcetraildb.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/nix/store/v3qi2n1cb9bj8h3076p3rz5fg0kpzz53-python3-3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '_sourcetraildb'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test_shallow.py", line 1, in <module>
    import shallow_indexer
  File "/private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source/shallow_indexer.py", line 7, in <module>
    import sourcetraildb as srctrl
  File "/private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source/SourcetrailDB/build/bindings_python/sourcetraildb.py", line 17, in <module>
    _sourcetraildb = swig_import_helper()
  File "/private/tmp/nix-build-SourcetrailPythonIndexer-v1_db25_p5.drv-0/source/SourcetrailDB/build/bindings_python/sourcetraildb.py", line 16, in swig_import_helper
    return importlib.import_module('_sourcetraildb')
  File "/nix/store/v3qi2n1cb9bj8h3076p3rz5fg0kpzz53-python3-3.8.6/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_sourcetraildb'
builder for '/nix/store/jy59qs9qiwylkra31kx1xvrspxbhwm1i-SourcetrailPythonIndexer-v1_db25_p5.drv' failed with exit code 1
cannot build derivation '/nix/store/90cz10njry8m7gf13vcf9032r237bjg8-sourcetrail-2020.2.43.drv': 1 dependencies couldn't be built
error: build of '/nix/store/90cz10njry8m7gf13vcf9032r237bjg8-sourcetrail-2020.2.43.drv' failed

@sternenseemann
Copy link
Member Author

@SuperSandro2000 no idea what's causing this failure and I have no way of debugging this currently. I can add another commit marking it as broken for darwin though.

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107533 run on x86_64-linux 1

1 package built:
  • sourcetrail

@SuperSandro2000
Copy link
Member

@SuperSandro2000 no idea what's causing this failure and I have no way of debugging this currently. I can add another commit marking it as broken for darwin though.

Fine by me.

@midchildan
Copy link
Member

The new hash is the correct hash for commit 0d1246be53b37639427fe9959f748dd0fc429c8f.

It's the old hash.

Otherwise looks good. I'll try fixing the macOS issue after this is merged.

@sternenseemann
Copy link
Member Author

Fixed.

The sha256 for the python indexer wasn't updated along with the git
revision. The old hash is of commit 0d1246be53b37639427fe9959f748dd0fc429c8f,
the new hash the correct one for tag v1_db25_p5
(3afb24195c5f3dc98e4cb60751f908f09f1bc046).
Copy link
Member

@midchildan midchildan left a comment

Choose a reason for hiding this comment

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

LGTM.

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/prs-already-reviewed/2617/323

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 107533 run on x86_64-linux 1

1 package built:
  • sourcetrail

@SuperSandro2000 SuperSandro2000 merged commit 63750b4 into NixOS:master Jan 4, 2021
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

4 participants