Skip to content

Conversation

@katrinafyi
Copy link
Member

root-dir is the right argument to use to check a directory of local files.

@katrinafyi
Copy link
Member Author

katrinafyi commented Oct 30, 2025

The latest CI error is too much for me to fix. It appears to come from lychee, and it appears to happen whenever you have a very big lycheeignore.

$  wc -l .lycheeignore    
16816 .lycheeignore
$ cargo run -- ads.com   
Error: Compiled regex exceeds size limit of 10485760 bytes.

@jacobdalamb
Copy link
Collaborator

jacobdalamb commented Oct 31, 2025

I'm just gonna go on limb and say there's a reason why @mre decided to go with --base-url
ae3947b

@mre
Copy link
Member

mre commented Nov 1, 2025

Haha, thanks for thinking so highly of me. 😆 However, the truth is that --base and --base-url started to get really confusing. We now switched over to --root-dir, which is the "right way" for local paths such as --root-dir dist in our case.

@mre
Copy link
Member

mre commented Nov 1, 2025

@jacobdalamb, any idea on how to fix the CI issue? We just have too many links in the repo now, so the links-master.txt approach introduced in 2d0ed94 no longer works.

@jacobdalamb
Copy link
Collaborator

@mre we could replace the current workflow to check only for new/changed links.

@mre
Copy link
Member

mre commented Nov 3, 2025

Huh, I thought that's what the current workflow does. It stores all links in master inside the .lycheeignore and then runs lychee on the PR branch. This finds all new/changed links if I understand correctly.

The problem is that we have too many links in master and when we try construct the regular expression from all of those links we run out of space. (Basically, lychee tries to create a single regex from all links in .lycheeignore.) So we can't do that anymore or we have to find a smarter way to construct the regex.

I believe we could make lychee smarter, but that would take some effort. The alternative is to call --dump on both master and the new branch and calculate a diff file and only check the links in that diff file.

@katrinafyi
Copy link
Member Author

It might be a good idea to merge this first so the base-url flag gets changed. The yml files for this repository are used to generate the actions recipes on the documentation site, so the website is showing a wrong example atm. It would be good to update those as soon as possible.

The issues with new/changed links might take longer to fix.

@thomas-zahner thomas-zahner merged commit 4129314 into lycheeverse:master Nov 5, 2025
1 of 2 checks passed
@thomas-zahner
Copy link
Member

thomas-zahner commented Nov 5, 2025

I'm merging this as this is now the intended way of usage. It's really unfortunate that CI fails, but that's already the case even without this PR. For example see: #114

Creating a PR before merging this resulted in:

error: invalid value 'dist' for '--base-url <BASE_URL>': Error with base dir `dist` : Base must either be a URL (with scheme) or an absolute local path. See `--help` for more information. If you want to resolve root-relative links in local files, also see `--root-dir`.

For the regex error I've opened a new issue.

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

Successfully merging this pull request may close these issues.

4 participants