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

tabnine: fix build #99312

Closed
wants to merge 1 commit into from
Closed

tabnine: fix build #99312

wants to merge 1 commit into from

Conversation

onsails
Copy link
Contributor

@onsails onsails commented Oct 1, 2020

Motivation for this change

#99264 is broken on linux

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.

@onsails onsails mentioned this pull request Oct 1, 2020
10 tasks
Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

can't modify another derivation, they are read-only

error: build of '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' on 'ssh://build' failed: builder for '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' failed with exit code 1
builder for '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' failed with exit code 1; last 6 log lines:
  patching sources
  configuring
  no configure script, doing nothing
  installing
  chmod: changing permissions of '/nix/store/0l29blcimkb75b87r1xqlri6sqba198p-TabNine': Operation not permitted
  builder for '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' failed with exit code 1

please build the package

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

can't modify another derivation, they are read-only

error: build of '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' on 'ssh://build' failed: builder for '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' failed with exit code 1
builder for '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' failed with exit code 1; last 6 log lines:
  patching sources
  configuring
  no configure script, doing nothing
  installing
  chmod: changing permissions of '/nix/store/0l29blcimkb75b87r1xqlri6sqba198p-TabNine': Operation not permitted
  builder for '/nix/store/d3n235cb5shqdj3p5k937mb84fn7pd8k-tabnine-3.1.1.drv' failed with exit code 1

please build the package

weird it works for me in both darwin and linux.
and nixpkgs-review also reports succesful build.

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

Result of nixpkgs-review pr 99312 1

2 packages built:
  • tabnine
  • vimPlugins.completion-tabnine

@onsails onsails requested a review from jonringer October 1, 2020 18:52
@onsails onsails changed the title tabnine: fix sha256 tabnine: fix build Oct 1, 2020
@jonringer
Copy link
Contributor

@GrahamcOfBorg build tabnine

@jonringer
Copy link
Contributor

also, this doesn't work for darwin. It's just "succeeding" due to how fixed-output-derivations work

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

Maybe it's something with my local nix setup, but it not just builds but correctly works on my machine (TabNine binary works as well as tabnine completion inside vim).

@jonringer
Copy link
Contributor

do you use a mac or linux?

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

do you use a mac or linux?

I use mac with nix and also checked on debian with nix.

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

it worked on both machines even before replacing chmod+ln with cp+chmod

@jonringer
Copy link
Contributor

$ ls -l $(realpath ./result/bin/TabNine)
.r--r--r-- 15M root 31 Dec  1969 /nix/store/0l29blcimkb75b87r1xqlri6sqba198p-TabNine

@jonringer
Copy link
Contributor

your nix-store should be read-only. chmod'ing another store path should fail

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

That's for package version which does chmod $src and then ln -s on macos:

❯ nix-build ~/dev/os/nixpkgs -A tabnine
/nix/store/d7mc493ywdfq7acz5wd8papf5wsacnxl-tabnine-3.1.1
❯ ls -l $(readlink ./result/bin/TabNine)
-r-xr-xr-x  1 wb  admin  12051528 Jan  1  1970 /nix/store/mkmysfrisxwz4dvl5cgyh4yrlcg05cm8-TabNine

onsails@7e9dc15
https://github.com/onsails/nixpkgs/blob/fix-tabnine-chmod/pkgs/development/tools/tabnine/default.nix

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

That's the same on debian with nix:

❯ nix-build ~/dev/os/nixpkgs -A tabnine
/nix/store/zv71q7nx41x7l83lc8vll4ga844vaa22-tabnine-3.1.1
❯ ls -l $(realpath ./result/bin/TabNine)
-r-xr-xr-x 1 wb wb 15837160 Jan  1  1970 /nix/store/0l29blcimkb75b87r1xqlri6sqba198p-TabNine

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

Perhaps nix store is read-only on NixOS only.

@onsails
Copy link
Contributor Author

onsails commented Oct 1, 2020

@GrahamcOfBorg build tabnine

@jonringer
Copy link
Contributor

Perhaps nix store is read-only on NixOS only.

This likely means that you're not using a sandbox, and nixos by default will use a sandbox.

Either way, going to close in favor of #99310

I brought over the fixes for darwin

@jonringer jonringer closed this Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants