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

Path containing whilespaces #87

Open
abenbachir opened this issue Mar 11, 2019 · 3 comments
Open

Path containing whilespaces #87

abenbachir opened this issue Mar 11, 2019 · 3 comments

Comments

@abenbachir
Copy link

We are facing this bug in OMSAgent just when we added nokogiri library. Because nokogiri has a dependency on mini_portile2 gem that has 2 filepaths containing whitespaces:

mini_portile/test/assets/patch 1.diff
mini_portile/test/assets/test mini portile-1.0.0/

I can reproduce it by including a filename with whitespace in Build-OMS-Agent-for-Linux/omsagent/installer/datafiles/ruby.data :

${{RUBY_DEST}}/lib/ruby/gems/2.4.0/doc/my test.txt; ${{RUBY_DEST}}/lib/ruby/gems/2.4.0/doc/my test.txt;; 644; root; root

Error:

root@abder-pad:~/OMS/Build-OMS-Agent-for-Linux/omsagent/build# python /root/OMS/Build-OMS-Agent-for-Linux/pal/installer/InstallBuilder/installbuilder.py \
 --BASE_DIR=/root/OMS/Build-OMS-Agent-for-Linux/omsagent \
 --TARGET_DIR=/root/OMS/Build-OMS-Agent-for-Linux/omsagent/target/Linux_UBUNTU_18.04_x64_64_Debug \
 --INTERMEDIATE_DIR=/root/OMS/Build-OMS-Agent-for-Linux/omsagent/intermediate/Linux_UBUNTU_18.04_x64_64_Debug/installer_tmp \
 --STAGING_DIR=/root/OMS/Build-OMS-Agent-for-Linux/omsagent/intermediate/Linux_UBUNTU_18.04_x64_64_Debug/staging \
 --BUILD_TYPE=Debug \
 --BUILD_CONFIGURATION=Linux_UBUNTU_18.04_x64_64_Debug \
 --RUBY_INT=intermediate/Linux_UBUNTU_18.04_x64_64_Debug/ruby \
 --RUBY_ARCH=x86_64-linux \
 --RUBY_ARCM=x86_64-linux \
 --PFARCH=x64 \
 --PFDISTRO=UBUNTU \
 --PFMAJOR=18 \
 --PFMINOR=04 \
 --VERSION=1.8.1 \
 --RELEASE=370 \
 --VERSION_IDENT="20190206 Developer_Build" \
 --DATAFILE_PATH=/root/OMS/Build-OMS-Agent-for-Linux/omsagent/installer/datafiles \
 --OUTPUTFILE=omsagent-1.8.1-370.ubuntu.18.x64 \
 base_omsagent.data linux.data ruby.data linux_dpkg.data

chown: cannot access '/root/OMS/Build-OMS-Agent-for-Linux/omsagent/intermediate/Linux_UBUNTU_18.04_x64_64_Debug/staging/opt/microsoft/omsagent/ruby/lib/ruby/gems/2.4.0/gems/mini_portile2-2.4.0/test/assets/test': No such file or directory
chown: cannot access 'mini': No such file or directory
chown: cannot access 'portile-1.0.0/configure': No such file or directory
Unable to chown /root/OMS/Build-OMS-Agent-for-Linux/omsagent/intermediate/Linux_UBUNTU_18.04_x64_64_Debug/staging/opt/microsoft/omsagent/ruby/lib/ruby/gems/2.4.0/gems/mini_portile2-2.4.0/test/assets/test mini portile-1.0.0/configure.

As a workaround, I've removed these 2 paths since its only related to testing, but we need to fix this issue.

@johnkord
Copy link

Hey @abenbachir , I'm not a maintainer here but I wrote some of the original installbuilder code and thought this might be a relatively easy fix. I've got a rough draft of a patch that might fix the problem (at least for .deb package builds). I haven't tried running this test for other packaging tools, so be wary about merging it to master!

Here's the commit: https://github.com/johnkord/pal/commit/6ff2af856a4b9d665d00644ddb1e4ddbf7e9b892

@abenbachir
Copy link
Author

@johnkord thanks, I will try it today.
Someone else made similar changes and sent me this via email. Here is the branch https://github.com/Microsoft/pal/tree/jumping-fixwhitespaceinpath, but I think your commit covers more stuff so I will try yours first.

@abenbachir
Copy link
Author

@johnkord I can confirm your commit worked.

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

2 participants