Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Issues
  • #2188
Closed
Open
Issue created Feb 06, 2019 by Administrator@rootContributor

Buck fails when used within PyRun

Created by: mikeb01

Given a simple Buck configuration:

java_library(
    name = 'main',
    srcs = [ 'src/Main.java' ]
)

java_binary(
    name = 'main-jar',
    deps = [ ':main' ],
    main_class = 'Main'
)

If I create a minimal python installation using PyRun

$ wget https://downloads.egenix.com/python/install-pyrun
$ ./install-pyrun -m pyrun
$ pushd pyrun/bin
$ ln -s python2.7 python2
$ popd
$ export PATH=pyrun/bin:$PATH

Then run the main jar

$ ./buck.pex run main-jar

I get the following error

Building: finished in 0.0 sec (100%) 1/1 jobs, 0 updated
  Total time: 0.0 sec
unknown encoding: utf8
Traceback (most recent call last):
  File "programs/buck.py", line 241, in <module>
  File "programs/buck.py", line 227, in main
  File "programs/buck_tool.py", line 543, in launch_buck
    run_fn, env, argv, java11_test_mode
  File "programs/buck_tool.py", line 452, in _execute_command_and_maybe_run_target
    path = cmd["path"].encode("utf8")
LookupError: unknown encoding: utf8

This appears to be some sort of interaction between pyrun and buck's sandboxing as encode works fine outside of buck. E.g. pyrun/bin/python2 -c 'print("123".encode("utf8"))' works without issue.

Assignee
Assign to
Time tracking