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

[macOS / Linux] gWidgets2tcltk fails to install: Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name "font". #19

Open
barracuda156 opened this issue Oct 19, 2023 · 9 comments

Comments

@barracuda156
Copy link

  * installing *source* package ‘gWidgets2tcltk’ ...
  ** package ‘gWidgets2tcltk’ successfully unpacked and MD5 sums checked
  ** using staged installation
  ** R
  ** demo
  ** inst
  ** byte-compile and prepare package for lazy loading
  Warning message:
  In fun(libname, pkgname) :
    no display name and no $DISPLAY environment variable
  Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : 
    [tcl] invalid command name "font".
  
  Error: unable to load R code in package ‘gWidgets2tcltk’
  Execution halted
  ERROR: lazy loading failed for package ‘gWidgets2tcltk’
  * removing ‘/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-gWidgets2tcltk/R-gWidgets2tcltk/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library/gWidgets2tcltk’
  Command failed:  cd "/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-gWidgets2tcltk/R-gWidgets2tcltk/work/gWidgets2tcltk" && /opt/local/bin/R CMD INSTALL . --library=/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_R_R-gWidgets2tcltk/R-gWidgets2tcltk/work/destroot/opt/local/Library/Frameworks/R.framework/Versions/4.3/Resources/library 
  Error: Failed to destroot R-gWidgets2tcltk: command execution failed
@tdhock
Copy link

tdhock commented Jan 18, 2024

I have the same issue on linux/redhat, tdhock/data.table-revdeps#8
is there some way to install without having a working DISPLAY?

@tdhock
Copy link

tdhock commented Jan 18, 2024

similar to #15 and #14

@barracuda156 barracuda156 changed the title [macOS] gWidgets2tcltk fails to install on Ventura: Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name "font". [macOS / Linux] gWidgets2tcltk fails to install: Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") : [tcl] invalid command name "font". Jan 18, 2024
@barracuda156
Copy link
Author

I have the same issue on linux/redhat

I have modified the title to account for Linux failures.

@tdhock
Copy link

tdhock commented Jan 19, 2024

to simulate this issue on a linux system, you can unset DISPLAY, for example from the shell:

DISPLAY= ~/R/R-devel/bin/R -e 'install.packages("gWidgets2tcltk")'

@tdhock
Copy link

tdhock commented Jan 19, 2024

not sure if this is happening in .onLoad or before, maybe one of these lines https://github.com/search?q=repo%3Ajverzani%2FgWidgets2tcltk%20font&type=code

@jverzani
Copy link
Owner

I can't replicate, but would welcome a PR if there is some workaround found. The correct repository is https://github.com/gwidgets3/gWidgets2tcltk. When I set that up, I should have redirected to there.

@tdhock
Copy link

tdhock commented Jan 19, 2024

On https://cloud.r-project.org/web/packages/gWidgets2tcltk/ it says that the URL for the package is https://github.com/jverzani/gWidgets2tcltk (not github.com/gwidgets3), please update and turn off the issue tracker for this repo, if this repo is no longer used.

@tdhock
Copy link

tdhock commented Jan 19, 2024

I can't replicate, but would welcome a PR if there is some workaround found. The correct repository is https://github.com/gwidgets3/gWidgets2tcltk. When I set that up, I should have redirected to there.

can you please share what code you used when you were not able to replicate? and the results you got? is that on linux too?

a work-around for my use case would be to try to set a valid DISPLAY, but I am not sure if that is possible.

@tdhock
Copy link

tdhock commented Jan 30, 2024

For a work-around on linux, you can try prefixing the install with xvfb-run, which sets up a virtual x windows frame buffer, with a valid DISPLAY, see below. First command without xvfb-run does not work, second command does work.

th798@cn31:~$  ~/R/R-4.3.2/bin/R -e 'install.packages("gWidgets2tcltk")'

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("gWidgets2tcltk")
trying URL 'http://cloud.r-project.org/src/contrib/gWidgets2tcltk_1.0-8.tar.gz'
Content type 'application/x-gzip' length 511003 bytes (499 KB)
==================================================
downloaded 499 KB

* installing *source* package ‘gWidgets2tcltk’ ...
** package ‘gWidgets2tcltk’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
Warning message:
no DISPLAY variable so Tk is not available
Error in structure(.External(.C_dotTclObjv, objv), class = "tclObj") :
  [tcl] invalid command name "font".

Error: unable to load R code in package ‘gWidgets2tcltk’
Execution halted
ERROR: lazy loading failed for package ‘gWidgets2tcltk’
* removing ‘/projects/genomic-ml/R/R-4.3.2/library/gWidgets2tcltk’
* restoring previous ‘/projects/genomic-ml/R/R-4.3.2/library/gWidgets2tcltk’

The downloaded source packages are in
        ‘/tmp/th798/7431468/Rtmp5hAvTk/downloaded_packages’
Warning message:
In install.packages("gWidgets2tcltk") :
  installation of package ‘gWidgets2tcltk’ had non-zero exit status
>
>
th798@cn31:~$ xvfb-run ~/R/R-4.3.2/bin/R -e 'install.packages("gWidgets2tcltk")'

R version 4.3.2 (2023-10-31) -- "Eye Holes"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages("gWidgets2tcltk")
trying URL 'http://cloud.r-project.org/src/contrib/gWidgets2tcltk_1.0-8.tar.gz'
Content type 'application/x-gzip' length 511003 bytes (499 KB)
==================================================
downloaded 499 KB

* installing *source* package ‘gWidgets2tcltk’ ...
** package ‘gWidgets2tcltk’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (gWidgets2tcltk)

The downloaded source packages are in
        ‘/tmp/th798/7431468/RtmpOGCAVu/downloaded_packages’
>
>

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

No branches or pull requests

3 participants