martinthomson / i-d-template

A template for IETF internet draft git repositories
Other
209 stars 183 forks source link

lib/.venv/bin/pip and lib/.venv/bin/.initialized-with-Makefile.venv missing #436

Closed SpencerDawkins closed 2 weeks ago

SpencerDawkins commented 3 months ago

This MIGHT be a near-duplicate of #382, but I'm using a different version of Ubuntu (24.04, #382 used 22.04). If so, my apologies.

I'm starting with a new WSL installation of Ubuntu 24.04, and I've added these packages:

sudo apt -y install make python3 python3-pip python3-venv ruby gem bundler

When I clone https://github.com/SpencerDawkins/sdp-roq, cd to my local directory, and type "make", I get this:

spenc@Spencer-ROG:/mnt/c/Users/spenc/OneDrive/Documents/GitHub/rtp-over-quic-draft$ make Created cache directory at /home/spenc/.cache/xml2rfc /usr/bin/env: ‘python3\r’: No such file or directory (note: this complaint from env is likely unrelated, but I didn't want to omit it, in case you needed to know about it) /mnt/c/Users/spenc/OneDrive/Documents/GitHub/rtp-over-quic-draft/lib/.venv/bin/pip install -r lib/requirements.txt bash: line 1: /mnt/c/Users/spenc/OneDrive/Documents/GitHub/rtp-over-quic-draft/lib/.venv/bin/pip: No such file or directory make: * [lib/venv.mk:233: /mnt/c/Users/spenc/OneDrive/Documents/GitHub/rtp-over-quic-draft/lib/.venv/bin/.initialized-with-Makefile.venv] Error 127**

When I ls -al in lib/.venv/bin, I get this:

drwxrwxrwx 1 spenc spenc 4096 Jun 25 20:58 . drwxrwxrwx 1 spenc spenc 4096 Jun 25 20:58 .. lrwxrwxrwx 1 spenc spenc 7 Jun 25 20:58 python -> python3 lrwxrwxrwx 1 spenc spenc 16 Jun 25 20:58 python3 -> /usr/bin/python3 lrwxrwxrwx 1 spenc spenc 7 Jun 25 20:58 python3.10 -> python3

so pip and .initialized-with-Makefile.venv do seem to be missing.

Thank you in advance for your help, of course!

martinthomson commented 3 months ago

Edit: Removing lib/ might clean this up. But then, if you are on a fresh machine, maybe not.

That setup looks pretty good to me. I updated to 24.04 myself yesterday and while the upgrade did not exactly go smoothly, I can't report similar errors.

That message from /usr/bin/env is a bit of a telltale though. It suggests that some of the scripts are being checked out with Windows line endings. That's highly likely to cause some odd stuff to happen.

Now, as to why that is happening, that's where things get interesting.

The most likely thing is that git is configured to do some stuff it probably shouldn't. Run git config --list and check for the following:

You can set these with something like git config --global core.autocrlf false.

The first is likely the problem. There are files in this repository that use CRLF line endings, so git might have inferred something about line endings that it shouldn't have.

It's possible that having a .gitattributes file would avoid this sort of problem. But this is the first I've encountered this issue. It's always something new.

SpencerDawkins commented 3 months ago

@martinthomson -

Thank you for your kindness.

Tl;dr - You Got Me Where I Needed To Go.

Just FYI, I recorded what I saw, as I worked through your responses, just in case anyone else finds my experience applicable.

core.repositoryformatversion=0 core.filemode=false core.bare=false core.logallrefupdates=true core.symlinks=false core.ignorecase=true submodule.active=. remote.origin.url=https://github.com/mengelbart/rtp-over-quic-draft.git remote.origin.fetch=+refs/heads/:refs/remotes/origin/ branch.main.remote=origin branch.main.merge=refs/heads/main submodule.lib.url=https://github.com/martinthomson/i-d-template lfs.repositoryformatversion=0

So, none of the core.* attributes you listed seem to be set.

Given that none of them were set at all, I will likely experiment further, with global configuration, which you pointed out to me, but they weren't set at all, so I didn't chase that immediately.

This diff contains a change in line endings from 'LF' to 'CRLF'.

(whut? I was changing from 'CRLF' to 'LF'!)

but Notepad++ now thinks the line ends are LF, so, fine.

You were pointing me in the general direction of git attributes, about which I know little, so I googled that, and found https://docs.gitlab.com/ee/user/project/repository/files/git_attributes.html (yeah, I know, gitlab isn't github), which said this:

If applying this configuration to an existing repository, files may need to be touched and recommitted if the local copy has the correct encoding but the repository does not. This can be performed for the whole repository by running git add --renormalize ..

That seemed useful, so I tried "git add --renormalize ..", and got

fatal: ..: '..' is outside repository at '/mnt/c/Users/spenc/OneDrive/Documents/GitHub/rtp-over-quic-draft'

I have been using directories in the Windows file system for GitHub repos, and I couldn't tell you why, but I do, so I changed ".." to "*" and tried again.

THAT allowed me to "make" my draft in git.

But I'm up and working again. Thank you.