fractal-code / meteor-azure

Automate Meteor deployments on Azure App Service
MIT License
67 stars 20 forks source link

Not compatible with tiny-secp256k1 #65

Closed ramijarrar closed 5 years ago

ramijarrar commented 5 years ago

Originally reported by @juliomac in https://github.com/fractal-code/meteor-azure/issues/64#issuecomment-478708581

Hi @ramijarrar ! Thanks for the update! It seems like it did fix the symlink issue. It has passed this phase without any problems. See here:

debug: create tarball info: ChatLibertas: Deploying bundle tarball info: ChatLibertas: Running server initialisation info: ChatLibertas: Polling server status... However it did not finish the build. Below see what I think it is the most important part of the Debug log regarding this new issue (please tell me if you need the rest):

debug: D:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [D:\local\Temp\8d6b6baf59591bc\bundle\programs\server\npm\node_modules\tiny-secp256k1\build\secp256k1.vcxproj] debug: addon.cpp debug: ..\native\addon.cpp(1): fatal error C1083: Cannot open include file: 'array': No such file or directory [D:\local\Temp\8d6b6baf59591bc\bundle\programs\server\npm\node_modules\tiny-secp256k1\build\secp256k1.vcxproj] debug: win_delay_load_hook.cc debug: gyp ERR! build error debug: gyp ERR! stack Error: msbuild failed with exit code: 1 The issue seems to be related to The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. .

Then it cannot find it Cannot open include file: 'array': No such file or directory [D:\local\Temp\8d6b6baf59591bc\bundle\programs\server\npm\node_modules\tiny-secp256k1\build\secp256k1.vcxproj]

ramijarrar commented 5 years ago

Packages with binary dependencies cannot always be compiled in place on App Service (see https://docs.microsoft.com/en-us/azure/nodejs-use-node-modules-azure-apps#native-modules)

The culprit in this case is the tiny-secp256k1 package, I get the following error with a clean repro:

2019-04-02T03:12:20.2665570Z,> tiny-secp256k1@1.0.1 install D:\local\Temp\8d6b7181aba6a4a\bundle\programs\server\npm\node_modules\tiny-secp256k1,,0
2019-04-02T03:12:20.3001659Z,> node-gyp rebuild,,0
2019-04-02T03:12:20.3001659Z,,,0
2019-04-02T03:12:20.7822032Z,,,0
2019-04-02T03:12:20.8134208Z,D:\local\Temp\8d6b7181aba6a4a\bundle\programs\server\npm\node_modules\tiny-secp256k1>if not defined npm_config_node_gyp (node "D:\home\meteor-azure\nvm\v8.15.1\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "D:\home\meteor-azure\nvm\v8.15.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) ,,0
2019-04-02T03:12:38.7460895Z,Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.,,0
2019-04-02T03:12:39.1991096Z,D:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.props(28&comma;3): error MSB4019: The imported project "D:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Redirect.props" was not found. Confirm that the path in the <Import> declaration is correct&comma; and that the file exists on disk. [D:\local\Temp\8d6b7181aba6a4a\bundle\programs\server\npm\node_modules\tiny-secp256k1\build\secp256k1.vcxproj],,0

Are you able to remove or switch out tiny-secp256k1 with something more popular/with precompiled binaries (e.g secp256k1-node)?

For reference, either of these 2 issues would address this: https://github.com/bitcoinjs/tiny-secp256k1/issues/26, https://github.com/bitcoinjs/tiny-secp256k1/issues/34

juliomac commented 5 years ago

Thanks! I started investigating this. I am doing my own local tests and also opened issue https://github.com/RocketChat/Rocket.Chat/issues/13972 with our friends at Rocket Chat.

ramijarrar commented 5 years ago

Great to hear - in general I would pick libraries with precompiled binaries (which is fairly commonplace nowadays) though we do have a basic toolchain since https://github.com/projectkudu/kudu/issues/1076.

ramijarrar commented 5 years ago

FYI you can fork the default server initialisation script if you want to experiment with modifying/configuring the build environment.

We haven't documented this yet, but as of v2.1.0 we accept a "customServerInitRepo" option in the settings file:

{
  "meteor-azure": {
    "customServerInitRepo": "https://github.com/example/repo.git",
    ...
  }
}
juliomac commented 5 years ago

Thanks! I will be following it up!

By the way... thanks for this great tool! It is simple to use and the documentation is awesome. Really a great work!