Skip to content

Make fails to clone submodules un Ubuntu 20.04 #1663

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

Closed
jordancarlin opened this issue Feb 3, 2025 · 6 comments
Closed

Make fails to clone submodules un Ubuntu 20.04 #1663

jordancarlin opened this issue Feb 3, 2025 · 6 comments

Comments

@jordancarlin
Copy link
Contributor

On Ubuntu 20.04 I get the following error message when running make:

error: Server does not allow request for unadvertised object 26f7004bf73c421c3fd5e5a6ccf470d05337b435
Fetched in submodule path 'newlib', but it did not contain 26f7004bf73c421c3fd5e5a6ccf470d05337b435. Direct fetching of that commit failed.
make: *** [Makefile:348: /opt/riscv/riscv-gnu-toolchain/newlib/.git] Error 1
error: Server does not allow request for unadvertised object beb2cdbcda911764b2bed5e57921fe90493260bd
Fetched in submodule path 'binutils', but it did not contain beb2cdbcda911764b2bed5e57921fe90493260bd. Direct fetching of that commit failed.
make: *** [Makefile:348: /opt/riscv/riscv-gnu-toolchain/binutils/.git] Error 1
error: Server does not allow request for unadvertised object 04696df09633baf97cdbbdd6e9929b9d472161d3
Fetched in submodule path 'gcc', but it did not contain 04696df09633baf97cdbbdd6e9929b9d472161d3. Direct fetching of that commit failed.
make: *** [Makefile:348: /opt/riscv/riscv-gnu-toolchain/gcc/.git] Error 1

It seems to be related to the version of git. Ubuntu 20.04 comes with git 2.25.1. If I build and install the latest version of git then this problem goes away. Seeing as Ubuntu 20.04 is still supported, it would be ideal if this worked with the built in version of git.

The problem seems to have been introduced by #1608.

@TommyMurphyTM1234
Copy link
Collaborator

I think that it's the same issue as discussed/explained here?

Note that Ubuntu 20.04 is no longer one of the distros used by the CI builds:

However, addressing the shallow checkout problem mentioned in the first link will probably help with 20.04?

@myyerrol
Copy link

myyerrol commented Feb 5, 2025

You can solve it by typing git config --global protocol.version 2 in the terminal. For detailed reasons, please see: Error Fetching Submodule in RISC-V GNU Toolchain: Server Does Not Allow Request for Unadvertised Object.

@jordancarlin
Copy link
Contributor Author

jordancarlin commented Feb 5, 2025 via email

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Feb 15, 2025

You can solve it by typing git config --global protocol.version 2 in the terminal. For detailed reasons, please see: Error Fetching Submodule in RISC-V GNU Toolchain: Server Does Not Allow Request for Unadvertised Object.

That didn't make any difference for me:

git config --global protocol.version 2

git clone https://github.com/riscv-collab/riscv-gnu-toolchain issue-1663

cd issue-1663

./configure --prefix=`pwd`/installed-tools

make
cd /home/user/issue-1663 && \
flock `git rev-parse --git-dir`/config git submodule init /home/user/issue-1663/gcc/ && \
flock `git rev-parse --git-dir`/config git submodule update --progress --depth 1 /home/user/issue-1663/gcc/
Submodule 'gcc' (https://gcc.gnu.org/git/gcc.git) registered for path 'gcc'
Cloning into '/home/user/issue-1663/gcc'...
remote: Enumerating objects: 146196, done.
remote: Counting objects: 100% (146196/146196), done.
remote: Compressing objects: 100% (112468/112468), done.
remote: Total 146196 (delta 37715), reused 91057 (delta 31702), pack-reused 0
Receiving objects: 100% (146196/146196), 175.53 MiB | 9.56 MiB/s, done.
Resolving deltas: 100% (37715/37715), done.
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
error: Server does not allow request for unadvertised object 04696df09633baf97cdbbdd6e9929b9d472161d3
Fetched in submodule path 'gcc', but it did not contain 04696df09633baf97cdbbdd6e9929b9d472161d3. Direct fetching of that commit failed.
make: *** [Makefile:348: /home/user/issue-1663/gcc/.git] Error 1

@TommyMurphyTM1234
Copy link
Collaborator

Ubuntu 20.04 comes with git 2.25.1. If I build and install the latest version of git then this problem goes away.

How did you do this?
I tried this to no avail:

wget https://www.kernel.org/pub/software/scm/git/git-2.48.1.tar.xz
tar xvf git-2.48.1.tar.xz
cd git-2.48.1/
./configure --prefix=`pwd`/installed-tools
make
...
    GEN git-mergetool--lib
    GEN git-sh-i18n
    GEN git-sh-setup
    CC scalar.o
    LINK scalar
    SUBDIR git-gui
GITGUI_VERSION = 0.21.0.139.gae633
    * new locations or Tcl/Tk interpreter
    GEN git-gui
    INDEX lib/
    * tclsh failed; using unoptimized loading
    MSGFMT    po/bg.msg make[1]: *** [Makefile:239: po/bg.msg] Error 127
make: *** [Makefile:2421: all] Error 2

@TommyMurphyTM1234
Copy link
Collaborator

Closing due to lack of updates and given that it's effectively a duplicate of this:

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