jryans
2021-9-8 21:28:10

I have cloned Scribble locally so I can make some changes and send a PR… However, I am not quite sure how to install / link my checkout, especially since scribble is part of the main Racket installation, so it’s already pre-installed at installation scope… I’ve tried various approaches from https://docs.racket-lang.org/pkg/git-workflow.html, but I’m getting various errors because scribble is already installed. Is there a good way to link just scribble, or am I meant to be doing a full build of all of Racket since it’s a main distribution package?


shu--hung
2021-9-8 21:47:45

The command raco pkg update --clone ‹_dir_› ‹_pkg-name_› will clone racket/scribble.git, after which you can add any git remote repo in the clone. However, this is going to rebuild all packages that depend on scribble.


jryans
2021-9-8 21:50:57

Hmm, I tried this, but it seems to refuse because it’s already installed with installation scope:

$ raco pkg update --clone $(pwd) <git://github.com/racket/scribble.git> Inferred package scope: installation Querying Git references for scribble at <git://github.com/racket/scribble.git> Updating: scribble Querying Git references for scribble at <git://github.com/racket/scribble.git> Using clone directory directly for metadata raco pkg update: package conflicts with existing installed item package: <git://github.com/racket/scribble.git> item category: exe item name: "scribble"


shu--hung
2021-9-8 21:53:12

Ah, yes. And the catalog is also needed. Let me find the relevant blog post


jryans
2021-9-8 21:55:07

I noticed there’s some kind of approach that creates a local catalog in Scribble’s CI workflow (https://github.com/racket/scribble/blob/master/.github/workflows/ci.yml), but I wasn’t sure if that was sensible for a development machine as well.


shu--hung
2021-9-8 21:55:52

At step 1b, the first command for setting the catalog is necessary https://blog.racket-lang.org/2017/09/tutorial-contributing-to-racket.html Here <PKG> is scribble, without any reference to the git repository — that’s going to be resolved automatically through the catalog


shu--hung
2021-9-8 21:56:41

If the packages are installed globally, I think both of the commands also need the -i flag


badkins
2021-9-8 22:16:38

I have a documentation typo I’d like to create a pull request for, but as I do so, github says my branch is 8 commits ahead of racket:master. I’ve only made one prior contribution, and I’m pretty sure it was accepted, so I’m not exactly sure how I got in this state. When I attempt to create the current pull request, it only shows 1 file changed (the doc typo), but it also shows my prior commits. The 3 non-merge commits have checkmarks that seem to imply they were accepted into master, but I don’t want to create a pull request with confusing noise. Any suggestions?


badkins
2021-9-8 22:17:56

I was hoping I would just keep my branch active and create pull requests occasionally as I make contributions vs. creating a clean fork of racket. What is the typical contributor workflow?


badkins
2021-9-8 22:19:14

In case a screenshot adds clarity…


jryans
2021-9-8 22:27:45

Thanks, that seemed to work! :slightly_smiling_face: The catalog step was the main bit I was missing before.


jryans
2021-9-8 22:28:43

I was initially referring to https://docs.racket-lang.org/racket-build-guide/contribute.html#%28part._pkg-contribute%29, which doesn’t seem to mention any of this catalog stuff, so perhaps I should send a documentation update so that matches the blog post.


badkins
2021-9-8 22:37:12

I think I’ll create a fresh fork, and then use a topic branch for my contributions vs. making changes on master.


badkins
2021-9-8 23:08:37

Yes, that worked nicely. A separate topic branch per pull request seems to be the way to go.


jryans
2021-9-8 23:17:11

I’m trying to compile the main Racket repo for the first time. Following the docs, I’m attempting the in-place style, so I’ve just run make in the repo directory. For some reason the zlib within Chez Scheme fails to link properly.


jryans
2021-9-8 23:17:28

libtool -o libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o gcc -g -O2 -Wall -DOS_X -DHAVE_HIDDEN -o example example.o -L. libz.a gcc -g -O2 -Wall -DOS_X -DHAVE_HIDDEN -o minigzip minigzip.o -L. libz.a ld: warning: ignoring file libz.a, building for macOS-x86_64 but attempting to link with file built for macOS-x86_64 Undefined symbols for architecture x86_64: "_compress", referenced from: _test_compress in example.o (maybe you meant: _test_compress)


jryans
2021-9-8 23:18:48

I’m on macOS 11.5.2 with Xcode 12.5.1. It’s odd since the linker message is trying to say there’s an architecture mismatch, but both values stated are the same… :thinking_face:


jryans
2021-9-8 23:30:01

Ah, seems like some GNU version of ranlib is taking precedence over Apple’s. I’ll try moving that out of the way…


jryans
2021-9-8 23:34:11

Yes, much better now after brew unlink binutils. :slightly_smiling_face:


samth
2021-9-9 02:22:14

Yes, the build guide assumes that you’re starting by building from git


samth
2021-9-9 02:22:49

Adding discussion of how to do it from a snapshot would be great


shu--hung
2021-9-9 04:13:09

Glad that you sort it out. I think adding commits to master is the issue because the upstream diverges with different commits, so by default git pull (~= git fetch + git merge) creates new merge commits and it’s not no-op. Using git pull --ff-only would instead report errors.