microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.72k stars 866 forks source link

[BUG]: Error using azure agent to run `bundle install` to install project gems #4304

Open bpeltonc opened 1 year ago

bpeltonc commented 1 year ago

What happened?

I have a React Native project that uses Fastlane to handle CI/CD. I have two Mac machines with arm64 chips that I use to run my pipelines using the azure-pipelines-agent. In order to install Fastlane and the required gems for the build process, I run bundle install. When I do this from my repos locally, the command succeeds and all required gems are installed, but when I run that command from within my .yaml file, I get the following error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
...
linking shared-object json/ext/generator.bundle
ld: warning: ignoring file
/Users/****/.rbenv/versions/3.1.2/lib/libruby.3.1.dylib, building for
macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64

Is there some reason the agent is trying to build for macOS-x86_64, when I downloaded and am using the arm64 agent on an arm64 machine?

Any help would be appreciated as this is completely preventing me from running my pipelines.

Versions

Occurring with both agent versions 2.170.1 and 3.220.2 macOS versions 13.4 and 13.1

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

No response

Operation system

No response

Version controll system

No response

Relevant log output

current directory:
/Users/bpelton-cox/myagent/_work/1/s/vendor/bundle/ruby/3.1.0/gems/json-2.6.3/ext/json/ext/generator
make DESTDIR\= sitearchdir\=./.gem.20230601-15727-1hqyc
sitelibdir\=./.gem.20230601-15727-1hqyc
compiling generator.c
linking shared-object json/ext/generator.bundle
ld: warning: ignoring file
/Users/bpelton-cox/.rbenv/versions/3.1.2/lib/libruby.3.1.dylib, building for
macOS-x86_64 but attempting to link with file built for macOS-arm64
Undefined symbols for architecture x86_64:
  "_rb_ary_entry", referenced from:
      _cState_to_h in generator.o
      _generate_json_array in generator.o
  "_rb_attr_get", referenced from:
      _cState_aref in generator.o
  "_rb_cArray", referenced from:
      _generate_json in generator.o
  "_rb_cFalseClass", referenced from:
      _generate_json in generator.o
      _json_object_i in generator.o
  "_rb_cFloat", referenced from:
      _generate_json in generator.o
      _json_object_i in generator.o
  "_rb_cHash", referenced from:
kirill-ivlev commented 1 year ago

Hi @bpeltonc thanks for the reporting! We're working on higher priority issues, but we'll get back to this one soon

danfred360 commented 1 year ago

I'm running into the same issue. I'm able to ssh into the agent and run bundle install in a bash shell no problem, but when I run bundle install in a bash task in the pipeline it gives me this "wrong architecture" error for a few packages.

@bpeltonc Have you found any workarounds for this?

@kirill-ivlev Would you happen to have a timeline for when y'all could start looking into this?

bpeltonc commented 1 year ago

I'm running into the same issue. I'm able to ssh into the agent and run bundle install in a bash shell no problem, but when I run bundle install in a bash task in the pipeline it gives me this "wrong architecture" error for a few packages.

@bpeltonc Have you found any workarounds for this?

@kirill-ivlev Would you happen to have a timeline for when y'all could start looking into this?

No workaround yet. I'm doing all my deployments locally instead of via Azure.

bpeltonc commented 1 year ago

@kirill-ivlev My team is looking at abandoning Azure Pipelines since it appears at this point to be completely incompatible with self-hosted arm64 build agents. Is there any roadmap to address this issue, or is it best for us to migrate to another CI/CD provider?

github-actions[bot] commented 8 months ago

This issue has had no activity in 180 days. Please comment if it is not actually stale

bpeltonc commented 8 months ago

This issue is still a problem for arm64 users running the Azure Build Pipelines client

On Feb 10, 2024, at 11:02 AM, github-actions[bot] @.***> wrote:

This issue has had no activity in 180 days. Please comment if it is not actually stale

— Reply to this email directly, view it on GitHub https://github.com/microsoft/azure-pipelines-agent/issues/4304#issuecomment-1937063552, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU3TODHT73ER6SMLNJWYAJDYS6R25AVCNFSM6AAAAAAYXHIKQOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZXGA3DGNJVGI. You are receiving this because you were mentioned.

github-actions[bot] commented 2 months ago

This issue has had no activity in 180 days. Please comment if it is not actually stale

bpeltonc commented 2 months ago

Please fix this problem

kirill-ivlev commented 2 months ago

@bpeltonc could you please specify (our provide sample block of YAML schema) - how you are building the project? is it some task or just bash script?

bpeltonc commented 2 months ago

@kirill-ivlev Here are the relevant steps that lead up to and produce the failure

    steps:
      - script: git reset --hard
        displayName: 'Git reset'

      - script: yarn install
        displayName: 'Install Dependencies'

      - script: gem install bundler
        displayName: 'Install bundler'

      - script: bundle install
        displayName: 'Install gems'