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

x86 Windows fails to build #31

Closed
aminya opened this issue Sep 2, 2020 · 6 comments · Fixed by #36
Closed

x86 Windows fails to build #31

aminya opened this issue Sep 2, 2020 · 6 comments · Fixed by #36

Comments

@aminya
Copy link
Contributor

aminya commented Sep 2, 2020

In one of the projects we use Parcel, but for some reason, Appveyor x86 fails to build the native modules with this error:

error LNK2001: unresolved external symbol "struct std::atomic<bool> Napi::details::needs_objectwrap_destructor_fix"

More details:

atom-community/zadeh#15
https://ci.appveyor.com/project/aminya/fuzzaldrin-plus-fast-se2je

> node-gyp-build
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  nothing.c
  win_delay_load_hook.cc
  nothing.vcxproj -> C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map\build\Release\\nothing.lib
  SourceMap.cpp
  MappingContainer.cpp
  MappingLine.cpp
  Mapping.cpp
  win_delay_load_hook.cc
     Creating library C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map\build\Release\sourcemap.lib and object C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map\build\Release\sourcemap.exp
SourceMap.obj : error LNK2001: unresolved external symbol "struct std::atomic<bool> Napi::details::needs_objectwrap_destructor_fix" (?needs_objectwrap_destructor_fix@details@Napi@@3U?$atomic@_N@std@@A) [C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map\build\sourcemap.vcxproj]
C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map\build\Release\sourcemap.node : fatal error LNK1120: 1 unresolved externals [C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map\build\sourcemap.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\projects\\fuzzaldrin-plus-fast-se2je\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\projects\fuzzaldrin-plus-fast-se2je\node_modules\@parcel\source-map
gyp ERR! node -v v14.6.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @parcel/source-map@2.0.0-alpha.4.13 install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @parcel/source-map@2.0.0-alpha.4.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\appveyor\AppData\Roaming\npm-cache\_logs\2020-09-02T05_31_48_721Z-debug.log
Command exited with code 1
@aminya aminya changed the title x86 Windows fail to build x86 Windows fails to build Sep 2, 2020
@aminya
Copy link
Contributor Author

aminya commented Sep 9, 2020

cc: @DeMoorJasper

@DeMoorJasper
Copy link
Member

@aminya strange that this happens, I don't really know why. Do you really need to run 32-bit CI pipelines? Seems a bit outdated

@aminya
Copy link
Contributor Author

aminya commented Sep 9, 2020

Well, yes. Nodejs supports x86, and we ship x86 binaries of Atom. We use the CI to prebuild the binaries.

@DeMoorJasper
Copy link
Member

That's unfortunate, actually tried to figure out how to get Azure to run 32-bit but couldn't figure it out, so can't really run our CI for testing...

I usually test windows things on a low-perf 64-bit win10 laptop, so would have to spin up a VM to even get anywhere close to testing this... Anyway once I figure out CI I can probably fix this

@aminya
Copy link
Contributor Author

aminya commented Sep 13, 2020

I can help you with that!

Use this script to run x86 scripts: https://github.com/atom-ide-community/atom/blob/master/script/vsts/windows-run.js

      - script: node script\windows-run.js somescript.cmd
        displayName: Run script

See here for a full example: https://github.com/atom-ide-community/atom/blob/8572d60edb815bae2837cad57ec22071da14c05d/script/vsts/platforms/templates/build.yml#L30-L36

I also have added x86 support to GitHub Actions if it helps: https://github.com/aminya/setup-node

If you want a true x86 machine you should use Appveyor.

@aminya
Copy link
Contributor Author

aminya commented Sep 17, 2020

Good news! x86 support is added to Azure's NodeTool natively!

microsoft/azure-pipelines-tasks#13399

Just pass force32bit

      - task: NodeTool@0
        inputs:
          versionSpec: $(node_version)
		  force32bit: true
        displayName: "Install Node.js"

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 a pull request may close this issue.

2 participants