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

Static builds are broken #626

Open
srid opened this issue May 24, 2021 · 17 comments
Open

Static builds are broken #626

srid opened this issue May 24, 2021 · 17 comments
Assignees
Labels
non-nix Problems in a non-nix based install wontfix This will not be worked on

Comments

@srid
Copy link
Owner

srid commented May 24, 2021

To reproduce, run nix-build static.nix (will take hours to compile).

Looks to be NixOS/nixpkgs#118731

image

Originally posted by @srid in #622 (reply in thread)

@srid srid added the help wanted Extra attention is needed label May 24, 2021
@ghost
Copy link

ghost commented Jun 4, 2021

@srid Is this issue related to the 404 error on https://github.com/srid/neuron/releases/tag/nightly ?

@srid
Copy link
Owner Author

srid commented Jul 5, 2021

@oponkork Nope, not related.

This is because static build of GHC is broken on nixpkgs, and the fix for this is here: NixOS/nixpkgs#129289

@ghost
Copy link

ghost commented Jul 7, 2021

Oh, I thought you have taken down the nightly temporarily because of it.

@srid
Copy link
Owner Author

srid commented Jul 17, 2021

Apparently fixed in NixOS/nixpkgs@da1cf8c ... once that gets to the nix channel, we can re-try static builds.

srid added a commit that referenced this issue Jul 22, 2021
This may (positively) impact #626
@srid
Copy link
Owner Author

srid commented Jul 22, 2021

After the nixpkgs update, I get failed to access 'libpython3.9.so.1.0': No such file or directory:

In function ‘assemble_lnotab’,
    inlined from ‘assemble_emit’ at Python/compile.c:5717:0,
    inlined from ‘assemble’ at Python/compile.c:6056:0:
Python/compile.c:5671: warning: writing 1 byte into a region of size 0 [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstringop-overflow=-Wstringop-overflow=8;;]
 5671 |         *lnotab++ = k;
      |
/nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: libpython3.9.so.1.0.lto.o: warning: relocation against `PyDictValues_Type' in read-only section `.text'
/nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: libpython3.9.so.1.0.lto.o: relocation R_X86_64_PC32 against symbol `PyBool_Type' can not be used when making a shared object; recompile with -fPIC
/nix/store/vf20zcyqr3qzcjhdidzk377qankcqsqa-binutils-2.35.1/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
ln: failed to access 'libpython3.9.so.1.0': No such file or directory
make: *** [Makefile:659: libpython3.9.so] Error 1
error: builder for '/nix/store/81jzmjv1bxn3kclr06nll4r2sqkjc7f4-python3-3.9.5.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/fv29z8xqlgnka5zsw81lh6hshahyj0yd-ghc-8.10.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jyg99rxjk0i6qw5xai33w9fiwnijxpz2-cabal2nix-2.17.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/gcfc3k512lscy8maggdfz043lfc0d7hv-cabal2nix-neuron.drv' failed to build
(use '--show-trace' to show detailed location information)

EDIT: This appears to be NixOS/nixpkgs#131557

@srid srid pinned this issue Jul 28, 2021
srid added a commit that referenced this issue Jul 28, 2021
Also re-enable hslua tests (got fixed upstream early this year).

One step ahead in #626
@srid
Copy link
Owner Author

srid commented Jul 28, 2021

Now failing at time-compat tests

    resolution
      getCurrentTime:                                                             FAIL (0.15s)
        test/main/Test/Clock/Resolution.hs:57:
        resolution
        expected: 0.000000001s
         but got: 0.0000001s
      taiClock:                                                                   FAIL (0.15s)
        test/main/Test/Clock/Resolution.hs:57:
        resolution
        expected: 0.000000001s
         but got: 0.0000001s

Not the same as haskellari/time-compat#23 but ...

Using dontCheck in project.nix has no effect however ...

srid added a commit that referenced this issue Jul 28, 2021
Also move all static build overrides to static.nix, out of project.nix.
@srid
Copy link
Owner Author

srid commented Jul 29, 2021

Using dontCheck in project.nix has no effect however ...

Yes, no idea how to fix it.

To reproduce run nix-build static.nix on 9bdcdf6

1 of 2 test suites (1 of 2 test cases) passed.
error: builder for '/nix/store/jgll2h7s5r3yqgy51x490m56l6jn7cqy-time-compat-1.9.5.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/h8wr1mcqi12jv85is5bpsmcw3d80x93s-aeson-1.5.6.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/d7hq9a3hdwddlswdqagypynvl187z8fm-quickcheck-instances-0.3.25.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ffz65rph57i4137q3qpagwv0nm9rsz7w-cabal2nix-2.17.0.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2yir3appck4x9y0p5h7prh1927dw5w3d-cabal2nix-neuron.drv' failed to build
(use '--show-trace' to show detailed location information)

srid added a commit that referenced this issue Aug 11, 2021
@srid srid added the wontfix This will not be worked on label Aug 11, 2021
@srid
Copy link
Owner Author

srid commented Aug 11, 2021

Wontfix (unless someone volunteers to fix), but an alternative is uploaded here: https://github.com/srid/neuron/releases/tag/1.9.35.0

@srid srid closed this as completed Aug 11, 2021
@srid srid added the non-nix Problems in a non-nix based install label Aug 11, 2021
@srid srid unpinned this issue Aug 11, 2021
@ouuan
Copy link

ouuan commented Aug 12, 2021

Wontfix, but an alternative is uploaded here: 1.9.35.0 (release)

This doesn't work on my Arch Linux 🤔 It gives many permission errors. Does it work on your machine, or did others test it?

@srid
Copy link
Owner Author

srid commented Aug 12, 2021

It works for me in WSL (Ubuntu). Same for Emanote.

What error do you see? You might have better luck reporting, and seeking help, in the Nix forum (as it was the experimental nix bundle -- which appears to use arx) that produced it).

@ouuan
Copy link

ouuan commented Aug 12, 2021

I tested again, and it seems that the only thing that doesn't work correctly is the PWD. It doesn't work without -d, nor with -d <relative path>, but works with -d <absolute path>.

It seems that the PWD is /, the root directory.

srid added a commit that referenced this issue Aug 12, 2021
@ouuan
Copy link

ouuan commented Aug 12, 2021

Same for Emanote.

I noticed this just now:

Footnotes

  1. If the relative path passed in command-line does not work, try passing absolute paths instead.

srid added a commit to srid/emanote that referenced this issue Aug 12, 2021
@srid
Copy link
Owner Author

srid commented Aug 12, 2021

Yup, I had just added it after your comment above. I'm guessing the executable changes directory internally before launching app (neuron or emanote), thus necessitating absolute paths.

I just also realized that a bare neuron gen -wS or emanote won't work; so we always have to pass an absolute path.

srid added a commit that referenced this issue Aug 12, 2021
@ouuan
Copy link

ouuan commented Aug 12, 2021

This wrapper script seems to work:

#!/bin/bash

neuron_dir="$PWD"
args=()

while [[ $# -gt 0 ]]; do
  key="$1"

  case $key in
    -d)
      neuron_dir="$(realpath "$2")"
      shift
      shift
      ;;
    *)
      args+=("$1")
      shift
      ;;
  esac
done

/opt/neuron-zettelkasten-bin/neuron -d "$neuron_dir" "${args[@]}"

@srid
Copy link
Owner Author

srid commented Sep 3, 2021

Re-opening because I did a new build out of curiosity using new nixpkgs and it built this time.

Anybody wanna give it a try? https://ipfs.infura.io/ipfs/QmcZ8amU7z16x2vV2CEuEGe836GMq3h5FWip9DLnzCHi6F?filename=neuron

@srid srid reopened this Sep 3, 2021
@ouuan
Copy link

ouuan commented Sep 3, 2021

Re-opening because I did a new build out of curiosity using new nixpkgs and it built this time.

Anybody wanna give it a try? ipfs.infura.io/ipfs/QmcZ8amU7z16x2vV2CEuEGe836GMq3h5FWip9DLnzCHi6F?filename=neuron

neuron search gives this error:

neuron: /nix/store/1120fbipilhpsqpnbqff50cibfr6qkq2-neuron-1.9.35.3/bin/neuron-search: executeFile: does not exist (No such file or directory)

Other commands work fine.

@srid
Copy link
Owner Author

srid commented Sep 3, 2021

Yes, for neuron search we need to resolve #432

@srid srid removed the help wanted Extra attention is needed label Sep 3, 2021
@srid srid self-assigned this Sep 3, 2021
@srid srid pinned this issue Sep 3, 2021
shivaraj-bh pushed a commit to shivaraj-bh/emanote that referenced this issue Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-nix Problems in a non-nix based install wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants