Open lpil opened 1 month ago
Hi, Thanks for opening the ticket. My gleam version is:
❯ gleam --version
gleam 1.1.0
The steps I described worked for me twice to produce the issue. I feel a littel hesitant to try again, since the packages are not deleteable from hex.pm. But if there something else I should try, let me know!
Should gleam have outputed the gleam source file in the under "Source files" when I run gleam publish
? If so, that is easily reproducablea. I tried to run gleam publish
on https://github.com/massivefermion/radish
and it also did not list me the source file (I stopped the process after gleam listed the files).
Thank you.
since the packages are not deleteable from hex.pm.
Hex isn't immutable for the first 24 hours so you can use the nightly version of Gleam with the command gleam hex revert --package packagename --version 1.2.3
to remove a version.
Should gleam have outputed the gleam source file in the under "Source files" when I run gleam publish? If so, that is easily reproducablea. I tried to run gleam publish on https://github.com/massivefermion/radish and it also did not list me the source file (I stopped the process after gleam listed the files).
It should, yes. Are you finding this happens for all packages for you?
Yes, I did try it for different packages:
radish
> gleam publish
...
Generated files: - src/radish.app.src - src/radish.erl - src/radish@client.erl - src/radish@command.erl - src/radish@command@hash.erl - src/radish@command@list.erl - src/radish@command@set.erl - src/radish@command@sorted_set.erl - src/radish@decoder.erl - src/radish@encoder.erl - src/radish@error.erl - src/radish@hash.erl - src/radish@list.erl - src/radish@resp.erl - src/radish@set.erl - src/radish@sorted_set.erl - src/radish@tcp.erl - src/radish@utils.erl Source files: - LICENSE - README.md - gleam.toml Name: radish Version: 0.15.0
aw4_request:
Generated files:
- src/radish.app.src
- src/radish.erl
- src/radish@client.erl
- src/radish@command.erl
- src/radish@command@hash.erl
- src/radish@command@list.erl
- src/radish@command@set.erl
- src/radish@command@sorted_set.erl
- src/radish@decoder.erl
- src/radish@encoder.erl
- src/radish@error.erl
- src/radish@hash.erl
- src/radish@list.erl
- src/radish@resp.erl
- src/radish@set.erl
- src/radish@sorted_set.erl
- src/radish@tcp.erl
- src/radish@utils.erl
Source files:
- LICENSE
- README.md
- gleam.toml
Name: radish
Version: 0.15.0
httpc:
Generated files:
- include/gleam@httpc_Builder.hrl
- src/gleam@httpc.erl
- src/gleam_httpc.app.src
Source files:
- LICENSE
- README.md
- gleam.toml
Name: gleam_httpc
Version: 2.1.2
I also tried it with gleam 1.1.0, nightly and 1.0.0.
So I guess it must have to do something with my environment?
I am on WSL2, I don't know if that might be related ...
I discovered something.
I compiled gleam locally, trying to find the source of the behavior.
I I remove the require_git
here it works.
I don't get why, and will investigate further :)
Ok, I get it and it has to do with my specific setup.
I use a git project manger (gws) to mange my projects and as a result my directory structure look looks like this:
projects:
So in short, I have a git project above all my projects, which has a .gitignore
that basically ignores all files.
For every project I have a git project in the specific directory.
For most tools, that is no problem, as they only care about the first git project they find when going up.
But gleam (or the rust function require_git
) seems to not only look at the first git project it finds when walking up, but also my "project managing" git project. Removing the .gitignore
up there fixes the problem.
Now, in my opinion that is a bug, as gleam publish
should not care about any git repository above the projects git repository (and also because it breaks my workflow :) ). But I might not see something important ...
I'm not sure I agree that this is a bug, that is how gitignore works and I don't think I want to invent our own semantics for that.
That said I don't know why we respect gitignore here in any case. We don't when compiling, so we shouldn't for publishing.
I agree, that if that is the way .gitignore works, gleam should work that way with gitignore, but is it really?
If I run git command in the processgroups
directory (see my dir structure above), git completly ignores any .gitignore
that is above the repository root directory.
And if git behaves this way, should a tool like gleam not also behave that way?
I thought that was how it worked, but apparently not. In that case please open an issue with that particular dependency.
Ok, ripgrep says this behavior is intended. The options I see are:
require_git(false)
but require_git(true)
. In this case, .gitignores
are not used when there is no git repository.exotic
and do nothing :).I still think, gleam should treat .gitignore
files the same way as git, and that is way I am suggestion option 1.
But I understand, that there might be different opinions :).
Discussed in https://github.com/gleam-lang/gleam/discussions/3144
Hi @RudolfVonKrugstein! Opening an issue for the bug you found.
Do you know how to reproduce this problem? What version of Gleam are you using?