v icon indicating copy to clipboard operation
v copied to clipboard

builder error for mbedtls when using nix

Open despiegk opened this issue 2 years ago • 4 comments

Describe the bug

image
builder error: In file included from /Users/despiegk1/code/git.ourworld.tf/despiegk/crystaldev/code/v/thirdparty/mbedtls/library/aes.c:26:
/Users/despiegk1/code/git.ourworld.tf/despiegk/crystaldev/code/v/thirdparty/mbedtls/library/common.h:26:10: fatal error: 'mbedtls/build_info.h' file not found
#include "mbedtls/build_info.h"

Reproduction Steps

we have build a reproducible env base don nix see https://git.ourworld.tf/despiegk/crystaldev

this has ps some nice tricks how to get the same env with nothing but nix and vscode installed

Expected Behavior

cant compile, if in sandbox do

code/crystallib/cli/hero/compile_debug.sh

Current Behavior

gives compile error

Possible Solution

No response

Additional Information/Context

No response

V version

newest in nixos

Environment details (OS name and version, etc.)

arm, osx but nixos env (means is prob not using xcode...)

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

despiegk avatar Jan 13 '24 15:01 despiegk

see the shell.nix to add more dependencies in environment, if needed I can make a development environment for you to go into

despiegk avatar Jan 13 '24 15:01 despiegk

i just added

    glfw 
    freetype 
    openssl

to the shell.nix

and then I can't even compile v any more

./v1.exe -no-parallel -o v2.exe  cmd/v
==================
In file included from /tmp/v_502/v2.exe.14234125913187763928.tmp.c:1187:
/nix/store/znpzvyfzwjckpbjlaf07mp91nz50albf-gcc-12.3.0/lib/gcc/aarch64-apple-darwin/12.3.0/include/stdatomic.h:40:1: sorry, unimplemented: ‘_Atomic’ in Objective-C
   40 | typedef _Atomic _Bool atomic_bool;
      | ^~~~~~~
/nix/store/znpzvyfzwjckpbjlaf07mp91nz50albf-gcc-12.3.0/lib/gcc/aarch64-apple-darwin/12.3.0/include/stdatomic.h:41:1: sorry, unimplemented: ‘_Atomic’ in Objective-C
   41 | typedef _Atomic char atomic_char;
      | ^~~~~~~
/nix/store/znpzvyfzwjckpbjlaf07mp91nz50albf-gcc-12.3.0/lib/gcc/aarch64-apple-darwin/12.3.0/include/stdatomic.h:42:1: sorry, unimplemented: ‘_Atomic’ in Objective-C
   42 | typedef _Atomic signed char atomic_schar;
      | ^~~~~~~
/nix/store/znpzvyfzwjckpbjlaf07mp91nz50albf-gcc-12.3.0/lib/gcc/aarch64-apple-darwin/12.3.0/include/stdatomic.h:43:1: sorry, unimplemented: ‘_Atomic’ in Objective-C
   43 | typedef _Atomic unsigned char atomic_uchar;
...
==================
(Use `v -cg` to print the entire error message)

despiegk avatar Jan 13 '24 17:01 despiegk

ps to recompile you can always, leave the shells, do start.sh again to go back (after changing the shell.nix)

then do

herotools install_v  --reset=true

which will re-compile v

despiegk avatar Jan 13 '24 17:01 despiegk

let
  nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-23.11";
  pkgs = import nixpkgs { config = {}; overlays = []; };
in

pkgs.mkShell {
  packages = with pkgs; [
    git
    nushellFull
    mc
    jq
    # libtorrent-rasterbar
    # python311Packages.libtorrent-rasterbar
    python311Full
    python311Packages.ipython
    python311Packages.ipdb
    python311Packages.rq
    rsync
    rustc
    go
    duf
    gdu
    boehmgc
    libb2
    libgcc
    # gcc
    glfw 
    freetype 
    openssl
    # openssl_3_1

    # ustream-ssl-mbedtls //doesn't install
    # mbedtls 
    # mbedtls_2
    

  ];
  
  # BIN_MC = "${pkgs.mc}/bin";

  shellHook = ''
    cd $BASE
    git status
    echo $BASE
    $BASE/hero_shell.sh
  '';
}

this one works for compiling V, the same error for comiling hero, but at least now we know when we ask gcc V doesn't compile any more

despiegk avatar Jan 13 '24 17:01 despiegk