Skip to content

error obtaining VCS status: exit status 128 #3273

Closed

Description

While trying to build toolkit with 2.0-stable branch I ran into the following error:

[644/1838]Makefile:13: CONFIG_FILE is empty, defaulting to toolkit's core-efi.json unless CONFIG_FILE="" was set explicitly.
fatal: unsafe repository ('/home/XXXXXX/CBL-Mariner' is owned by someone else)
To add an exception for this directory, call:

        git config --global --add safe.directory /home/XXXXXX/CBL-Mariner
cd /home/XXXXXX/CBL-Mariner/toolkit/tools/ && \
        go test -covermode=atomic -coverprofile=/home/XXXXXX/CBL-Mariner/build/tools/internal.test_coverage ./...
?       microsoft.com/pkggen/boilerplate        [no test files]
ok      microsoft.com/pkggen/boilerplate/hello  0.007s  coverage: 100.0% of statements
?       microsoft.com/pkggen/depsearch  [no test files]
?       microsoft.com/pkggen/graphPreprocessor  [no test files]
?       microsoft.com/pkggen/graphanalytics     [no test files]
?       microsoft.com/pkggen/grapher    [no test files]
?       microsoft.com/pkggen/graphpkgfetcher    [no test files]
ok      microsoft.com/pkggen/imageconfigvalidator       0.021s  coverage: 64.8% of statements
?       microsoft.com/pkggen/imagegen/attendedinstaller [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/primitives/customshortcutlist   [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/primitives/enumfield    [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/primitives/navigationbar        [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/primitives/progressbar  [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/speakuputils    [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/uitext  [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/uiutils [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views   [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/confirmview       [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/diskview  [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/diskview/autopartitionwidget      [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/diskview/manualpartitionwidget    [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/encryptview       [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/eulaview  [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/finishview        [no test files]
ok      microsoft.com/pkggen/imagegen/attendedinstaller/views/hostnameview      0.008s  coverage: 43.8% of statements
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/installationview  [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/installerview     [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/progressview      [no test files]
?       microsoft.com/pkggen/imagegen/attendedinstaller/views/userview  [no test files]
ok      microsoft.com/pkggen/imagegen/configuration     0.030s  coverage: 87.6% of statements                                                                    [607/1838]ok      microsoft.com/pkggen/imagegen/diskutils 0.009s  coverage: 0.0% of statements
ok      microsoft.com/pkggen/imagegen/installutils      0.012s  coverage: 0.3% of statements
?       microsoft.com/pkggen/imagepkgfetcher    [no test files]
?       microsoft.com/pkggen/imager     [no test files]
?       microsoft.com/pkggen/internal/buildpipeline     [no test files]
?       microsoft.com/pkggen/internal/debugutils        [no test files]
?       microsoft.com/pkggen/internal/directory [no test files]
?       microsoft.com/pkggen/internal/exe       [no test files]
?       microsoft.com/pkggen/internal/file      [no test files]
?       microsoft.com/pkggen/internal/jsonutils [no test files]
?       microsoft.com/pkggen/internal/logger    [no test files]
?       microsoft.com/pkggen/internal/logger/hooks/writerhook   [no test files]
?       microsoft.com/pkggen/internal/network   [no test files]
?       microsoft.com/pkggen/internal/packagerepo/repocloner    [no test files]
?       microsoft.com/pkggen/internal/packagerepo/repocloner/rpmrepocloner      [no test files]
?       microsoft.com/pkggen/internal/packagerepo/repomanager   [no test files]
?       microsoft.com/pkggen/internal/packagerepo/repomanager/rpmrepomanager    [no test files]
?       microsoft.com/pkggen/internal/packagerepo/repoutils     [no test files]
ok      microsoft.com/pkggen/internal/pkggraph  0.054s  coverage: 64.0% of statements
ok      microsoft.com/pkggen/internal/pkgjson   0.015s  coverage: 92.9% of statements
ok      microsoft.com/pkggen/internal/randomization     0.511s  coverage: 93.3% of statements
?       microsoft.com/pkggen/internal/retry     [no test files]
ok      microsoft.com/pkggen/internal/rpm       0.115s  coverage: 40.2% of statements
ok      microsoft.com/pkggen/internal/safechroot        0.046s  coverage: 65.2% of statements
?       microsoft.com/pkggen/internal/shell     [no test files]
?       microsoft.com/pkggen/internal/sliceutils        [no test files]
ok      microsoft.com/pkggen/internal/storage   0.006s  coverage: 87.5% of statements
?       microsoft.com/pkggen/internal/systemdependency  [no test files]
ok      microsoft.com/pkggen/internal/versioncompare    0.009s  coverage: 98.3% of statements
?       microsoft.com/pkggen/isomaker   [no test files]
?       microsoft.com/pkggen/liveinstaller      [no test files]
?       microsoft.com/pkggen/pkgworker  [no test files]
?       microsoft.com/pkggen/roast      [no test files]
?       microsoft.com/pkggen/roast/formats      [no test files]
?       microsoft.com/pkggen/scheduler  [no test files]
?       microsoft.com/pkggen/scheduler/buildagents      [no test files]
?       microsoft.com/pkggen/scheduler/schedulerutils   [no test files]
?       microsoft.com/pkggen/specreader [no test files]
?       microsoft.com/pkggen/srpmpacker [no test files]
?       microsoft.com/pkggen/validatechroot     [no test files]
cd /home/XXXXXX/CBL-Mariner/toolkit/tools/boilerplate && \
        go test -covermode=atomic -coverprofile=/home/XXXXXX/CBL-Mariner/build/tools/boilerplate.test_coverage ./... && \
        go build \
                -ldflags="-X microsoft.com/pkggen/internal/exe.ToolkitVersion=2.0.20220630.1604" \
                -o /home/XXXXXX/CBL-Mariner/toolkit/out/tools
?       microsoft.com/pkggen/boilerplate        [no test files]
ok      microsoft.com/pkggen/boilerplate/hello  0.006s  coverage: 100.0% of statements
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
make: *** [/home/XXXXXX/CBL-Mariner/toolkit/scripts/tools.mk:83: /home/XXXXXX/CBL-Mariner/toolkit/out/tools/boilerplate] Error 1
$ go version
go version go1.18.3 linux/arm64

I had to run the following to fix this issue

sudo git config --global --add safe.directory /home/XXXXXX/CBL-Mariner

Seems like I need to checkout CBL-Mariner repo as root, to get the builds to works seamlessly. Is there is a better way to handle this error?

Activity

  1. PawelWMS commented on Jul 1, 2022

    @PawelWMS
    Contributor

    Hey Praveen K Paladugu (@praveen-pk), thanks for mentioning git issue - I've opened #3284 to fix this.

    From the output you've provided, however, it might be possible that there is also an issue with your Go version. Right now, Mariner is expected to build with the 1.17 version and not 1.18. Please let know, if you see the tooling crashing with the 1.17 version - I was unable to reproduce your crash with Go 1.17.3.

  2. praveen-pk commented on Jul 1, 2022

    @praveen-pk
    Author

    I retried to build with go-1.17.8 and couldn't reproduce the issue.

    I am able to reproduce this issue with go-1.18.3 only.

  3. elsaco commented on Jul 3, 2022

    @elsaco

    go version in 1.18 embeds version control information in binaries, that's why the error didn't show in go-1.17. Like the error message says, if you don't need to embed version control in your binaries use the -buildvcs=false option.

    Looks like you're using the ARM version. I did a CBL-Mariner 2.0-stable core build on x64 with go-1.18.1 and WSL/Ubuntu and the vhdx was generated w/out errors.

    From go help build:

            -buildvcs
                    Whether to stamp binaries with version control information. By default,
                    version control information is stamped into a binary if the main package
                    and the main module containing it are in the repository containing the
                    current directory (if there is a repository). Use -buildvcs=false to
                    omit version control information.
    
    
  4. mfrw commented on Jul 3, 2022

    @mfrw
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions