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

Cargo build error: .git//refs: Value too large for defined data type; class=Os (2) #9

Closed
snshn opened this issue Apr 8, 2020 · 8 comments

Comments

@snshn
Copy link

snshn commented Apr 8, 2020

Since this action is using qemu, that seems to be causing a known issue associated with 32-bit qemu machines (in my case it's armv6).

To configure your current shell run source $HOME/.cargo/env
  Installing monolith v2.2.2 (/github/workspace/monolith)
    Updating crates.io index
warning: spurious network error (2 tries remaining): could not read directory '/home/runner/.cargo/registry/index/github.com-1ecc6299db9ec823/.git//refs': Value too large for defined data type; class=Os (2)
warning: spurious network error (1 tries remaining): could not read directory '/home/runner/.cargo/registry/index/github.com-1ecc6299db9ec823/.git//refs': Value too large for defined data type; class=Os (2)
error: failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  could not read directory '/home/runner/.cargo/registry/index/github.com-1ecc6299db9ec823/.git//refs': Value too large for defined data type; class=Os (2)

More info:
rust-lang/cargo#7451 -> https://lkml.org/lkml/2018/12/28/461

This is a very useful action, thank you for creating and maintaining it

@snshn
Copy link
Author

snshn commented Apr 8, 2020

Was able to go around the issue by adding this before installing cargo via rustup:

mkdir ~/.cargo
mount -t tmpfs -o size=2048m tmpfs ~/.cargo

@uraimo uraimo changed the title Cargo build error Cargo build error: .git//refs: Value too large for defined data type; class=Os (2) Apr 8, 2020
@uraimo
Copy link
Owner

uraimo commented Apr 8, 2020

Thanks for reporting this! I'm changing the title to make this workaround easier to find.
Hard to tell why changing the FS is enough to get around this, too many layers...

@snshn
Copy link
Author

snshn commented Apr 8, 2020

Apparently there's a bug in ext4 when running a 32bit build within a 64bit host using qemu. tmpfs appears to have that bug fixed

@uraimo
Copy link
Owner

uraimo commented Apr 13, 2020

Hi @snshn can you provide more info on the job that is failing? I tried to replicate it with this job(armv7/ubuntu18.04) but it doesn't fail it seems. What am I doing wrong?

@snshn
Copy link
Author

snshn commented Apr 15, 2020

I sadly used --amend while working on my action, but the one that you've posted looks extremely similar! I believe mine had ubuntu-latest in it, I'll try to reproduce that error in my private repo, will report here.

@snshn
Copy link
Author

snshn commented Apr 17, 2020

Here it is, I found the job that produces the error:

  gnu_linux_armv6:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout the repository
      uses: actions/checkout@v2
    - name: Build and install the executable
      uses: uraimo/run-on-arch-action@v1.0.7
      id: runcmd
      with:
        architecture: armv6
        distribution: buster
        run: |
          sudo apt-get update && apt-get install git
          mkdir -p ~
          git config --global http.sslverify false
          git clone https://github.com/Y2Z/monolith.git
          cd monolith
          echo "--insecure" > ~/.curlrc
          curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
          echo W25ldF0KZ2l0LWZldGNoLXdpdGgtY2xpID0gdHJ1ZQoKW2h0dHBdCmNoZWNrLXJldm9rZSA9IGZhbHNlCg== | base64 -d > ~/cargo/_config
          PATH=$PATH:~/.cargo/bin cargo install --force --locked --path . --root .
          gzip --best bin/monolith
          echo ::set-output name=data::$(base64 bin/monolith.gz)
    - name: Get the output
      run: |
          mkdir bin
          echo ${{ steps.runcmd.outputs.data }} | zcat | base64 -d > bin/monolith-armv6
    - uses: Shopify/upload-to-release@1.0.0
      with:
        name: monolith-armv6
        path: bin/monolith-armv6
        repo-token: ${{ secrets.GITHUB_TOKEN }}

putting

mkdir ~/.cargo
mount -t tmpfs -o size=2048m tmpfs ~/.cargo

before the curl line solved the problem for that ne, but I believe there were some other issues associated with it

@uraimo
Copy link
Owner

uraimo commented Apr 17, 2020

Thanks for taking the time to recover it!
I'll play around a bit to see if there is another filesystem that be used in similar fashion as a workaround.

@snshn
Copy link
Author

snshn commented Apr 18, 2020

Glad I could be of help! I think it's quite an edge case, and not directly related to this project. Perhaps it's enough that we've documented it here for people to find it in the future and understand the root cause of that error message. Please feel free to close this issue at any point from now.

uraimo added a commit that referenced this issue Apr 18, 2020
droid42 added a commit to droid42/boringtun-docker that referenced this issue Jun 8, 2020
droid42 added a commit to droid42/boringtun-docker that referenced this issue Jun 8, 2020
droid42 added a commit to droid42/boringtun-docker that referenced this issue Jun 8, 2020
droid42 added a commit to droid42/boringtun-docker that referenced this issue Jun 8, 2020
@uraimo uraimo closed this as completed Sep 2, 2020
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