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

root-config fails if spaces are part of ROOTSYS path #10759

Closed
1 task done
olifre opened this issue Jun 14, 2022 · 22 comments
Closed
1 task done

root-config fails if spaces are part of ROOTSYS path #10759

olifre opened this issue Jun 14, 2022 · 22 comments

Comments

@olifre
Copy link
Contributor

olifre commented Jun 14, 2022

  • Checked for duplicates

Describe the bug

The root-config script fails in several ways when located in a PATH containing spaces.

Expected behavior

No errors when there are spaces in the path.

To Reproduce

mkdir foo\ bar
cd foo\ bar
wget https://root.cern/download/root_v6.26.04.Linux-ubuntu18-x86_64-gcc7.5.tar.gz
tar xf root_v6.26.04.Linux-ubuntu18-x86_64-gcc7.5.tar.gz
source root/bin/thisroot.sh                             
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 31: [: too many arguments

It also affects other output (as expected):

$ root-config --incdir                                                         
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 31: [: too many arguments
/home/me ./include

and:

$ root-config --version
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 26: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 31: [: too many arguments
/home/me/foo bar/root/bin/root-config: line 553: test: /home/me: binary operator expected
cannot read /home/me
./include/RVersion.h

Setup

  1. ROOT: versions: seen with 6.14, 6.26, likely others
  2. Operating system: any Linux-based system (seen with Ubuntu in WSL, Gentoo)

Additional context

While spaces in paths are always nasty, this case was reported by a student of mine (who extracted the tarball in a subdirectory with spaces).

@olifre olifre added the bug label Jun 14, 2022
@eguiraud
Copy link
Member

Duplicate of #7311 ?

@olifre
Copy link
Contributor Author

olifre commented Jun 15, 2022

@eguiraud That's a good question. As of now, the issue you linked only lists built-time problems (due to scripts running at build time), while this issue here is about issues with root-config after ROOT is built and locating it into a path with spaces (using binaries from release tarballs which were built in paths without spaces).

Of course, it might still be useful to merge both issues and extend the scope of the earlier one — but that's better decided by one of you ;-).

@eguiraud
Copy link
Member

Ah no, in my cursory read I missed that important difference. Let's leave this open then, thank you for the report

bellenot added a commit to bellenot/root that referenced this issue Jul 12, 2022
@andresailer
Copy link
Contributor

andresailer commented Jul 18, 2022

Hi @bellenot
Mostly a heads-up, but the quotes are causing issues in some autoconf macros for two packages in the LCG stack. E.g., http://cdash.cern.ch/viewFiles.php?buildid=177988
Cheers,
Andre

Fixed link: removed faulty 1

@bellenot
Copy link
Member

@andresailer thanks, but the link gives Build does not exist. Maybe it has been deleted.

@andresailer
Copy link
Contributor

@bellenot Sorry, I accidentally added a 1 to the link, fixed in above message

@bellenot
Copy link
Member

@andresailer thanks! So I guess I'll revert that commit...

@bellenot bellenot reopened this Jul 18, 2022
bellenot added a commit to bellenot/root that referenced this issue Jul 18, 2022
The quotes are causing issues in some autoconf macros for two packages in the LCG stack

This reverts commit ade40b1.
@bellenot
Copy link
Member

@andresailer I just commited a possible fix addressing this issue. Please let me know if it works, so I'll backport it into v6-26-00-patches. Thanks!

@andresailer
Copy link
Contributor

Thanks, but, this is not fixing the problem for the packages. They use the root-config options --cflags and --glibs.

@bellenot
Copy link
Member

@andresailer OK, so I don't understand how that fails. I'll check tomorrow.

@bellenot
Copy link
Member

bellenot commented Jul 19, 2022

@andresailer it looks like it might work (the errors look different), or did I miss something?

@andresailer
Copy link
Contributor

Dev3 is still failing the same as before, http://cdash.cern.ch/viewFiles.php?buildid=178184

@bellenot
Copy link
Member

OK, thanks. Then I'll revert it completely, and we'll then forbid spaces in ROOTSYS on Linux and Mac...

@bellenot
Copy link
Member

@andresailer BTW, how can I try quickly without having to wait the next LCG build?

@andresailer
Copy link
Contributor

Easiest I can think off is described here:
https://lcgdocs.web.cern.ch/lcgdocs/tasks/newstackpackages/#working-from-build-node
Before running cmake switch to the branch you want to test ROOT for in lcgcmake/cmake/toolchain/heptools-dev3.cmake switch to the ROOT branch you want to test.
then make mctester or make hepmcanalysis

@bellenot
Copy link
Member

OK, thanks, I'll try

@bellenot
Copy link
Member

OK, doesn't work. I'll find another solution

@bellenot
Copy link
Member

@andresailer this PR should fix the LCG builds and still fix this current issue. We'll see at next build...

@bellenot
Copy link
Member

@andresailer please let me know if it works now, so I can backport the fix in v6-26-00-patches. Thanks!

@andresailer
Copy link
Contributor

Yes, dev3 is working again! Thanks!

@bellenot
Copy link
Member

Cool, thanks!

@bellenot
Copy link
Member

Fixed in master and v6-26-00-patches

vepadulano pushed a commit to vepadulano/root that referenced this issue Jul 20, 2022
j-mathe pushed a commit to j-mathe/root that referenced this issue Jul 26, 2022
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

4 participants