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

--vm-type=docker not compatible with build_root with common prj names containing ':' #358

Closed
nickbroon opened this issue Nov 27, 2017 · 6 comments

Comments

@nickbroon
Copy link
Contributor

nickbroon commented Nov 27, 2017

If for example doing something like:

export OSC_BUILD_ROOT="var/tmp/build-root/%(project)s-%(repo)s-%(arch)s"

when used with common project, that contain the project seperator ':' will cause docker to complain as it uses ':' as in its mount specifications, and paths used cannot contain this character:

docker: Error response from daemon: invalid bind mount spec "/var/tmp/build-root/home:user:foo-Debian_9_Update_standard-x86_64/.mount:/mnt": invalid volume specification: '/var/tmp/build-root/home:user:foo-Debian_9_Update_standard-x86_64/.mount:/mnt'.

Perhaps the build.py code that does the substitution should replace ':' with something else like '_'?
Or at the very least a check/warning should be issues that using build_root with this character is not supported by docker.

            build_root = build_root % {'repo': repo, 'arch': arch,
                         'project': prj, 'package': pacname, 'apihost': apihost}
@mmohring
Copy link
Contributor

mmohring commented Nov 27, 2017

I can confirm this problem exists also for osc building with KVM. E.g. there is then another problem but also with ":" and the build cannot be run because a ":" is in the constructed path name. My Workaround is not to put the project name into the path. The disadvantage is that you have to clean the buildroot if you change the project. The solution might be to use some kind of "hash-name" or rewritten name instead of the OBS project name.

@mmohring
Copy link
Contributor

mmohring commented Nov 27, 2017

Sorry, it works with KVM (fixed in KVM, not osc, KVM did not allow ":" in path names). Anyway you can generate a pathname with working characters by replacing ':' with a working character like '_' as a workaround for docker.

@nickbroon
Copy link
Contributor Author

I agree, it can be worked around by explicitly setting build_root to path without ':' in it.
I'd suggest the osc checks and warns when the paths contains this, instead of just allowing docker to error out.
Better yet, when it substitutes 'project' into build_root path in the above code snippet from build.py it should probably default to replacing the ':' with '_' as it's very common for projects to contain this, as OBS uses it as hierarchy separator.

@marcus-h
Copy link
Member

marcus-h commented Nov 27, 2017 via email

@nickbroon
Copy link
Contributor Author

Would substituting '' with '__' and then substituting ':' with '' should avoid clashes, as I don't believe it's possible to have a project with '::' in it's name?

marcus-h added a commit to marcus-h/obs-build that referenced this issue Nov 28, 2017
This is needed to support colons in the volume name.

Fixes: openSUSE/osc#358 ("--vm-type=docker
not compatible with build_root with common prj names containing ':'")
@marcus-h
Copy link
Member

marcus-h commented Nov 28, 2017 via email

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