astamm / nloptr

nloptr provides an R interface to NLopt, a free/open-source library for nonlinear optimization providing a common interface to a number of different optimization routines which can handle nonlinear constraints and lower and upper bounds for the controls.

Home Page:https://astamm.github.io/nloptr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update or cleanse included tar.gz

eddelbuettel opened this issue · comments

When I build (in a Ubuntu 20.04 Docker container) where the NLopt sources are used, I get a screenful of line noise from tar I have never seen:

[...]
using NLopt via local cmake build on x86_64                                                              
set CMAKE_BIN=/usr/bin/cmake                                                                             
/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'               
/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'               
/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.lastuseddate#PS'          
/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.TextEncoding'             
/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'               
/bin/tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'     

with that last line repeated many times. If you want me to, I can un-tar and re-tar. Something is not quite right here.

Also, in a regular shell on Linux:

edd@rob:~/git/nloptr(master)$ tar tvzf src/nlopt-src.tar.gz |head -20
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
-rwxr-xr-x stamm-a/staff   212 2022-01-15 03:49 ._nlopt-2.7.1
drwxr-xr-x stamm-a/staff     0 2022-01-15 03:49 nlopt-2.7.1/
-rw-r--r-- stamm-a/staff   285 2022-01-15 03:49 nlopt-2.7.1/._CMakeLists.txt
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.lastuseddate#PS'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.TextEncoding'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
-rw-r--r-- stamm-a/staff 14915 2022-01-15 03:49 nlopt-2.7.1/CMakeLists.txt
-rw-r--r-- stamm-a/staff   212 2021-12-03 12:38 nlopt-2.7.1/._nlopt_config.h.in
-rw-r--r-- stamm-a/staff  4244 2021-12-03 12:38 nlopt-2.7.1/nlopt_config.h.in
-rw-r--r-- stamm-a/staff   212 2021-12-03 12:38 nlopt-2.7.1/._mkdocs.yml
-rw-r--r-- stamm-a/staff  1413 2021-12-03 12:38 nlopt-2.7.1/mkdocs.yml
-rwxr-xr-x stamm-a/staff   212 2022-01-15 03:49 nlopt-2.7.1/._test
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
drwxr-xr-x stamm-a/staff     0 2022-01-15 03:49 nlopt-2.7.1/test/
-rwxr-xr-x stamm-a/staff   212 2022-01-15 03:49 nlopt-2.7.1/._cmake
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
drwxr-xr-x stamm-a/staff     0 2022-01-15 03:49 nlopt-2.7.1/cmake/
-rw-r--r-- stamm-a/staff   212 2021-12-03 12:38 nlopt-2.7.1/._nlopt.pc.in
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
-rw-r--r-- stamm-a/staff   263 2021-12-03 12:38 nlopt-2.7.1/nlopt.pc.in
-rw-r--r-- stamm-a/staff   212 2021-12-03 12:38 nlopt-2.7.1/._ChangeLog
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
-rw-r--r-- stamm-a/staff    70 2021-12-03 12:38 nlopt-2.7.1/ChangeLog
tar: -rw-r--r-- stamm-a/staff   212 2021-12-03 12:38 nlopt-2.7.1/._AUTHORS
Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
-rw-r--r-- stamm-a/staff   381 2021-12-03 12:38 nlopt-2.7.1/AUTHORS
-rw-r--r-- stamm-a/staff   212 2021-12-03 12:38 nlopt-2.7.1/._NEWS.md
tar: Ignoring unknown extended header keyword 'LIBARCHIVE.xattr.com.apple.quarantine'
-rw-r--r-- stamm-a/staff 16019 2021-12-03 12:38 nlopt-2.7.1/NEWS.md
edd@rob:~/git/nloptr(master)$ 

Any reason not to use the standard tarball? Did you do edits to appease CRAN?

edd@rob:~/git/nloptr(master)$ cd /tmp/
edd@rob:/tmp$ wget https://github.com/stevengj/nlopt/archive/refs/tags/v2.7.1.tar.gz
--2022-01-18 10:44:36--  https://github.com/stevengj/nlopt/archive/refs/tags/v2.7.1.tar.gz
Resolving github.com (github.com)... 140.82.112.4
Connecting to github.com (github.com)|140.82.112.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/stevengj/nlopt/tar.gz/refs/tags/v2.7.1 [following]
--2022-01-18 10:44:36--  https://codeload.github.com/stevengj/nlopt/tar.gz/refs/tags/v2.7.1
Resolving codeload.github.com (codeload.github.com)... 140.82.113.9
Connecting to codeload.github.com (codeload.github.com)|140.82.113.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘v2.7.1.tar.gz’

v2.7.1.tar.gz                                            [ <=>                                                                                                                  ]   1.95M  11.3MB/s    in 0.2s    

2022-01-18 10:44:37 (11.3 MB/s) - ‘v2.7.1.tar.gz’ saved [2044180]

edd@rob:/tmp$ tar tvzf v2.7.1.tar.gz |head -20
drwxrwxr-x root/root         0 2021-12-03 12:38 nlopt-2.7.1/
drwxrwxr-x root/root         0 2021-12-03 12:38 nlopt-2.7.1/.github/
drwxrwxr-x root/root         0 2021-12-03 12:38 nlopt-2.7.1/.github/workflows/
-rw-rw-r-- root/root      1842 2021-12-03 12:38 nlopt-2.7.1/.github/workflows/build.yml
-rw-rw-r-- root/root       381 2021-12-03 12:38 nlopt-2.7.1/AUTHORS
-rw-rw-r-- root/root     14772 2021-12-03 12:38 nlopt-2.7.1/CMakeLists.txt
-rw-rw-r-- root/root      1979 2021-12-03 12:38 nlopt-2.7.1/COPYING
-rw-rw-r-- root/root      1201 2021-12-03 12:38 nlopt-2.7.1/COPYRIGHT
-rw-rw-r-- root/root        70 2021-12-03 12:38 nlopt-2.7.1/ChangeLog
-rw-rw-r-- root/root     16019 2021-12-03 12:38 nlopt-2.7.1/NEWS.md
-rw-rw-r-- root/root      2232 2021-12-03 12:38 nlopt-2.7.1/README.md
-rw-rw-r-- root/root       470 2021-12-03 12:38 nlopt-2.7.1/TODO
drwxrwxr-x root/root         0 2021-12-03 12:38 nlopt-2.7.1/cmake/
-rw-rw-r-- root/root      3340 2021-12-03 12:38 nlopt-2.7.1/cmake/FindGuile.cmake
-rw-rw-r-- root/root      3892 2021-12-03 12:38 nlopt-2.7.1/cmake/FindNumPy.cmake
-rw-rw-r-- root/root      7837 2021-12-03 12:38 nlopt-2.7.1/cmake/FindOctave.cmake
-rw-rw-r-- root/root       718 2021-12-03 12:38 nlopt-2.7.1/cmake/NLoptConfig.cmake.in
-rw-rw-r-- root/root       393 2021-12-03 12:38 nlopt-2.7.1/cmake/NLoptConfigVersion.cmake.in
-rw-rw-r-- root/root      3030 2021-12-03 12:38 nlopt-2.7.1/cmake/TargetLinkLibrariesWithDynamicLookup.cmake
-rw-rw-r-- root/root      2111 2021-12-03 12:38 nlopt-2.7.1/cmake/generate-cpp.cmake
edd@rob:/tmp$ 

I did tweak the main CMakeLists.txt in there related to the warning issue noted by Ben in #85, for silencing out-of-bounds warnings. You can however try to untar and re-tar and see if that cleans a bit the tarball.

Are you aware how much crap macOS leaves behind? There must be some tutorials out there telling you how to invoke tar to not include them. Maybe you need a local GNU tar ...

edd@rob:~/git/nloptr/src(master)$ tar xaf nlopt-src.tar.gz 2&>1 >/dev/null
edd@rob:~/git/nloptr/src(master)$ find nlopt-2.7.1/ -name \.\*_\* | head
nlopt-2.7.1/.github/._workflows
nlopt-2.7.1/.github/workflows/._build.yml
nlopt-2.7.1/._README.md
nlopt-2.7.1/._.github
nlopt-2.7.1/cmake/._FindOctave.cmake
nlopt-2.7.1/cmake/._generate-fortran.cmake
nlopt-2.7.1/cmake/._TargetLinkLibrariesWithDynamicLookup.cmake
nlopt-2.7.1/cmake/._NLoptConfigVersion.cmake.in
nlopt-2.7.1/cmake/._FindNumPy.cmake
nlopt-2.7.1/cmake/._toolchain-i686-w64-mingw32.cmake
edd@rob:~/git/nloptr/src(master)$ find nlopt-2.7.1/ -name \.\*_\* | wc -l
294
edd@rob:~/git/nloptr/src(master)$ 

I did this:

edd@rob:~/git/nloptr/src(master)$ tar xaf nlopt-src.tar.gz  >/dev/null 2>&1
edd@rob:~/git/nloptr/src(master)$ find nlopt-2.7.1/ -name \.\*_\* -delete
edd@rob:~/git/nloptr/src(master)$ mv nlopt-src.tar.gz nlopt-src.tar.gz.ori
edd@rob:~/git/nloptr/src(master)$ tar cpf nlopt-src.tar.gz nlopt-2.7.1/
edd@rob:~/git/nloptr/src(master)$ 

PR coming in ...