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

manageiq build on Power Linux (ppc64le) platform #19520

Closed
seth-priya opened this issue Nov 15, 2019 · 9 comments
Closed

manageiq build on Power Linux (ppc64le) platform #19520

seth-priya opened this issue Nov 15, 2019 · 9 comments
Assignees

Comments

@seth-priya
Copy link

Creating this issue to seek some help.

The bundle install command
bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle}

is failing for me with the below error. I am able to successfully build sassc gem from source code after making changes in the source code from https://github.com/sass/sassc-ruby locally and the gem installs successfully. Is there a simple way to consume the locally built version in manageiq is what I am looking to understand here …

Installing sassc 2.2.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /tmp/manageiq/vendor/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext

/usr/local/rvm/rubies/ruby-2.6.3/bin/ruby -I /usr/local/rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r ./siteconf20191115-91511-13a35th.rb extconf.rb
creating Makefile

current directory: /tmp/manageiq/vendor/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext
make "DESTDIR=" clean

current directory: /tmp/manageiq/vendor/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext
make "DESTDIR="
compiling ./libsass/src/ast.cpp
g++: error: unrecognized command line option ‘-march=native’
make: *** [ast.o] Error 1

make failed, exit code 2

Gem files will remain installed in /tmp/manageiq/vendor/bundle/ruby/2.6.0/gems/sassc-2.2.1 for inspection.
Results logged to /tmp/manageiq/vendor/bundle/ruby/2.6.0/extensions/powerpc64le-linux/2.6.0/sassc-2.2.1/gem_make.out

An error occurred while installing sassc (2.2.1), and Bundler cannot continue.
Make sure that gem install sassc -v '2.2.1' --source 'https://rubygems.org/' succeeds before bundling.

In Gemfile:
manageiq-ui-classic was resolved to 0.1.0, which depends on
patternfly-sass was resolved to 3.59.4, which depends on
bootstrap-sass was resolved to 3.4.1, which depends on
sassc

If I completely bypass manageiq-ui-classic (just for understanding the scope of issues on ppc64le), the bundle install command succeeds. but bundle exec rake errors out...
https://travis-ci.org/seth-priya/manageiq

Any pointers here would be of great help, thank you!!

@simaishi
Copy link
Contributor

@seth-priya I think the only way to use .gem is to put it in vendor/cache. The alternative is to point sassc to your modified source (like your fork) using :git => in Gemfile.

cc @jrafanie since you might have other ideas

@jrafanie
Copy link
Member

jrafanie commented Nov 19, 2019

@seth-priya First of all, it's awesome you have a possible fix for the sassc gem for powerpc. I'm not familiar with the gem but we can probably offer suggestions on how we've had upstream changes accepted.

Regarding how to get manageiq to run with a custom gem that we depend on, we automatically pull in any gems you define in bundler.d/*. You might want to try something like the 4th example below. Just uncomment the line, change the gem name, version, path, etc. to match what you want and run bundle update on manageiq.

$ cat bundler.d/Gemfile.dev.rb
# 1. To add a rubygems based development gem to my bundle to be used with manageiq
# gem 'memory_profiler' if RUBY_VERSION > "2.1.0" 

# 2. To add a github based gem...
# gem 'memory_profiler', :github => 'SamSaffron/memory_profiler'  if RUBY_VERSION > "2.1.0"

# 3. To add a local path based gem to the bundle (for existing gems that manageiq already depends on)...
# override_gem 'manageiq-ui-classic',:path => "/Users/joerafaniello/Code/manageiq-ui-classic"

# 4. Or for local path based gems that aren't already a dependency
# gem 'memory_profiler', :path => "/Users/joerafaniello/Code/memory_profiler"

@Fryguy
Copy link
Member

Fryguy commented Nov 20, 2019

I think number 3, the bundler.d direction with override_gem or ensure_gem might be your best bet for now...

In bundler.d/Gemfile.dev.rb (the filename can be anything you want, this is just an example)

ensure_gem "sassc", :git => "<your_fork_url>"

Since sassc is a transient dependency (i.e. not in our Gemfile), for now you can't use override_gem due to this bug, but ensure_gem should work.

@seth-priya
Copy link
Author

Thanks @jrafanie @simaishi @Fryguy I tried the last suggestion and the build completed successfully :) I am trying out the test cases now

Thanks for the help!

@seth-priya
Copy link
Author

seth-priya commented Dec 3, 2019

I found this sass/sassc-ruby#146 and it essentially means that the gem can be installed (on ppc64le as well) by using the below command

gem install sassc -- --disable-march-tune-native

$gem install sassc -- --disable-march-tune-native
Building native extensions with: '--disable-march-tune-native'
This could take a while...
Successfully installed sassc-2.2.1
Parsing documentation for sassc-2.2.1
Done installing documentation for sassc after 3 seconds
1 gem installed

@seth-priya
Copy link
Author

and once I have the sassc gem installed / pre-installed on the system, manageiq bundle install completes successfully as well!

@jrafanie
Copy link
Member

jrafanie commented Dec 5, 2019

@seth-priya can you try setting this in your manageiq app's .bundle/config so you don't have to remember to do this whenever you install new versions?

11:27:57 ~/Code/manageiq (master) (2.6.5) + bundle config --local build.sassc --disable-march-tune-native
You are replacing the current local value of build.sassc, which is currently nil
11:28:06 ~/Code/manageiq (master) (2.6.5) + cat .bundle/config
---
BUNDLE_JOBS: "3"
BUNDLE_BUILD__SASSC: "--disable-march-tune-native"

Unfortunately, sassc isn't a direct dependency in manageiq so it feels weird to add that option here.

@seth-priya
Copy link
Author

@jrafanie this works, thank you, this works for me

@seth-priya
Copy link
Author

Thanks all for your support and patience in answering my queries, I am closing this issue and will be creating a new one to discuss about adding support for ppc64le to ManageIQ, I have the basic changes in place.

Thank you!!

svghadi added a commit to svghadi/manageiq that referenced this issue Apr 30, 2020
The build fails while installing (or building) sassc gem if the --disable-march-tune-native flag is not set for ppc64le.

More context : ManageIQ#19520
svghadi added a commit to svghadi/manageiq that referenced this issue Apr 30, 2020
The build fails while installing (or building) sassc gem if the --disable-march-tune-native flag is not set for ppc64le.

More context : ManageIQ#19520
svghadi added a commit to svghadi/manageiq that referenced this issue Apr 30, 2020
* Add travis build for ppc64le

xenial on travis supports ppc64le but has the older (9.x) version of PostgreSQL, where we need 10.x

* Add flag for sassc installation on ppc64le

The build fails while installing (or building) sassc gem if the --disable-march-tune-native flag is not set for ppc64le.

More context : ManageIQ#19520

* Add cxxflags for unf_ext gem installation on ppc64le

Installation of unf_ext gem < v0.0.7.4 fails on ppc64le

More context: ManageIQ/manageiq-pods#460 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants