sc4224

sc4224 OP

Tried it, it works! Merry Christmas. Big follow up to that, why do we need to copy over a mix.lock file? Shouldn’t the mix.lock file be generated after doing a mix deps.get at build time? It seems when I don’t copy it over, the build process returns with an error saying the mix.lock file does not exist and that I should run mix deps.get to generate one. But the problem is, mix deps.get is already set as a command in the dockerfile. So I don’t understand why the mix.lock doesn’t exist at runtime

0
Post #33
NobbZ

NobbZ

There shouldn’t be any need.

But copying it from the host (and also committing it into the repository) ensures using consistent versions of dependencies across machines.

I’m not sure if I can follow you with the remainder of you question. Can you perhaps open a new thread which includes a link to an example repository and an explanation about how to recreate your problem?

0
Post #34
Exadra37

Exadra37

No, you are doing it right. I am using this approach for years for all programming languages I use or anything else, because I run everything from Docker, included for example Android Studio, that’s an heavy editor with lot’s of cache and magic going on :wink:

Now here is where things are “wrong”. If you have two different systems building stuff and try to use them, then off-course things will go definitely side ways.

Also inotify-tools must be installed in both the host and in the container, and their limits increased so that both host and container can react to file changes in the mounted volumes.

0
Post #35
NobbZ

NobbZ

If, and only if, you know what you are doing, and if, and only if, you know that built artifacts from host and container won’t mix, then the volume approach can work. Though, very few people do really know.

0
Post #36
Exadra37

Exadra37

Well what it seems to me here is that people are mixing compiling from the host and compiling from the container interchangeable, and that will not work unless the operating systems are exactly the same.

So if people want to build artifacts in both host and container they must exclude that folders from being mapped in the volumes.

0
Post #37
Arnab

Arnab

bcrypt_elixir

Microsoft (R) Program Maintenance Utility Version 14.27.29112.0
Copyright (C) Microsoft Corporation. All rights reserved.

    del /Q /F priv
    erl -eval "io:format(\"~s~n\", [lists:concat([\"ERTS_INCLUDE_PATH=\", code:root_dir(), \"/erts-\", erlang:system_info(version), \"/include\"])])" -s init stop -noshell > Makefile.auto.win
    nmake /                   /F Makefile.win priv\bcrypt_nif.dll

Microsoft (R) Program Maintenance Utility Version 14.27.29112.0
Copyright (C) Microsoft Corporation. All rights reserved.

    if NOT EXIST "priv" mkdir "priv"
    cl /O2 /EHsc /I"c_src" /I"c:/Program Files/erl-23.0/erts-11.0/include" /LD /MD /Fepriv\bcrypt_nif.dll  c_src\bcrypt_nif.c c_src\blowfish.c

Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

bcrypt_nif.c
c_src\bcrypt_nif.c(52): fatal error C1083: Cannot open include file: ‘stdio.h’: No such file or directory
blowfish.c
e:\projects\phoenix-live-stream-master\deps\bcrypt_elixir\c_src\blf.h(37): fatal error C1083: Cannot open include file: ‘stdint.h’: No such file or directory
Generating Code…
NMAKE : fatal error U1077: ‘“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64\cl.EXE”’ : return code ‘0x2’
Stop.
NMAKE : fatal error U1077: ‘“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64\nmake.EXE”’ : return code ‘0x2’
Stop.
could not compile dependency :bcrypt_elixir, “mix compile” failed. You can recompile this dependency with “mix deps.compile bcrypt_elixir”, update it with “mix deps.update bcrypt_elixir” or clean it with “mix deps.clean bcrypt_elixir”
==> chat_app
** (Mix) Could not compile with “nmake” (exit status: 2).
One option is to install a recent version of
Visual C++ Build Tools
either manually or using Chocolatey -
choco install VisualCppBuildTools.

After installing Visual C++ Build Tools, look in the “Program Files (x86)”
directory and search for “Microsoft Visual Studio”. Note down the full path
of the folder with the highest version number. Open the “run” command and
type in the following command (make sure that the path and version number
are correct):

cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

This should open up a command prompt with the necessary environment variables
set, and from which you will be able to run the “mix compile”, “mix deps.compile”,
and “mix test” commands.

Ques: What may be the problem running this on Windows 10 cmd

0
Post #38
davidalencar

davidalencar

This worked for me:

mix deps.compile --force bcrypt_elixir

1
Post #39
samrose

samrose

Every time I come across this, if I blow away my _build and recompile, the problem is resolved.

0
Post #40
empitePasindu

empitePasindu

I was going in the wrong way by using vscode terminal to compile the packages which gave the above error . following is the easiest way

  • install latest visual studio with Desktop development with c++ option
  • open visual studio (not visual studio code)
  • open a developer command prompt terminal
  • mix deps.comile --all
  • done
0
Post #41
— All posts loaded —