Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Building 0.22 for centos-7 #15

Open
spjspjspj opened this issue Jan 22, 2020 · 1 comment
Open

Building 0.22 for centos-7 #15

spjspjspj opened this issue Jan 22, 2020 · 1 comment

Comments

@spjspjspj
Copy link

First I got into this error

Your system's preferred encoding is `ANSI_X3.4-1968`, but Pants requires `UTF-8`.
Specifically, Python's `locale.getpreferredencoding()` must resolve to `UTF-8`.

Then I added these two vars (and PANTS_PRINT_EXCEPTION_STACKTRACE for debugging pants error) to builder/rpm/centos-7/Dockerfile

 FROM centos:7

+ENV LC_ALL en_US.UTF-8
+ENV LANG en_US.UTF-8
+ENV PANTS_PRINT_EXCEPTION_STACKTRACE true
+
 RUN yum update -y
 RUN yum install -y \
     make \

I'm now getting error:

Exception caught: (exceptions.TypeError)
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/bin/pants", line 10, in <module>
    sys.exit(main())
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 87, in main
    PantsLoader.run()
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 83, in run
    cls.load_and_execute(entrypoint)
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/pants_loader.py", line 76, in load_and_execute
    entrypoint_main()
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 39, in main
    PantsRunner(exiter, start_time=start_time).run()
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 59, in run
    options_bootstrapper=options_bootstrapper
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 90, in create
    options_bootstrapper
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 39, in parse_options
    options = OptionsInitializer.create(options_bootstrapper, build_config)
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/init/options_initializer.py", line 127, in create
    options = cls._construct_options(options_bootstrapper, build_configuration)
  File "/root/.cache/pants/setup/bootstrap-Linux-x86_64/1.15.0/lib/python2.7/site-packages/pants/init/options_initializer.py", line 90, in _construct_options
    build_configuration.optionables() |

Exception message: unsupported operand type(s) for |: 'set' and 'OrderedSet'

Wondering if you guys have seen this and have a fix. Thanks!

@ridv
Copy link
Contributor

ridv commented Jan 22, 2020

I looked into this a bit today. It seems like this might be an error related to the python version being used.

I tried building under Ubuntu Xenial which has Python version 2.7.12 and didn't get any errors.

Centos7 uses python 2.7.5 which may be the culprit. To make matters worse, upgrading python in a Rhel/Centos doesn't look like it's very easy given the fact that most RHEL systems tools (i.e yum) rely on a specific python version to work.

This may get tricky.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants