Skip to content
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

carburetor: init at 5.0.0 #309642

Merged
merged 2 commits into from
Feb 2, 2025
Merged

carburetor: init at 5.0.0 #309642

merged 2 commits into from
Feb 2, 2025

Conversation

mksafavi
Copy link
Contributor

@mksafavi mksafavi commented May 6, 2024

Description of changes

This PR adds carburetor and it's dependency tractor
Closes #308739

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@mksafavi mksafavi changed the title Pkg/carburetor carburetor: init at 4.5.1 May 6, 2024
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels May 6, 2024
@Aleksanaa
Copy link
Member

I get this error while running it:

Try adding these:

nativeBuildInputs = [
  gobject-introspection # Idk needed or not, try with and without it
  wrapGAppsHook4
];

buildInputs = [
  libadwaita
];

dependencies = [
  # ...
  pygobject3
];

pkgs/by-name/ca/carburetor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ca/carburetor/package.nix Outdated Show resolved Hide resolved
@mksafavi
Copy link
Contributor Author

mksafavi commented Jun 7, 2024

Thanks for reviewing this.
I made the changes. now both of the apps get built. 👍
running tractor I get this error:

❯ ./result/bin/tractor start

        Please compile the "tractor.gschema.xml" file.
        In GNU/Linux you can copy it from
        "/nix/store/y4fqc4wbn5ycma7pj6qk835dyg7gkzsb-tractor-4.5.1/lib/python3.11/site-packages/tractor"
        to "/nix/store/a2xf8sr12rcps2175198hhy5n2z3ifl1-gsettings-desktop-schemas-46.0/share/gsettings-schemas/gsettings-desktop-schemas-46.0/glib-2.0/schemas" and run:
        "sudo glib-compile-schemas /nix/store/a2xf8sr12rcps2175198hhy5n2z3ifl1-gsettings-desktop-schemas-46.0/share/gsettings-schemas/gsettings-desktop-schemas-46.0/glib-2.0/schemas"

running carburetor I get this:

❯ ./result-2/bin/carburetor
(process:334322): GLib-GIO-ERROR **: 21:10:44.934: Settings schema 'org.tractor' is not installed
fish: Job 1, './result-2/bin/carburetor' terminated by signal SIGTRAP (Trace or breakpoint trap)

@mksafavi mksafavi marked this pull request as ready for review June 7, 2024 17:42
@Aleksanaa
Copy link
Member

It already tells you what should be done ☺️

@Aleksanaa Aleksanaa marked this pull request as draft June 22, 2024 14:16
pyproject = true;

src = fetchzip {
url = "https://framagit.org/tractor/carburetor/-/archive/${version}/carburetor-${version}.zip";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instance looks like gitlab. Try fetchFromGitLab,

@PerchunPak
Copy link
Member

PerchunPak commented Dec 22, 2024

I've got this working!

https://gist.github.com/PerchunPak/ffc206405e219209f1cddde26373de09

Though firefox and chrome don't detect system proxy, but I can reach it with

~ ❯ curl -x "http://localhost:9080" example.com
<html>
<head>
<title>This is an HTTP CONNECT tunnel, not a full HTTP Proxy</title>
</head>
<body>
<h1>This is an HTTP CONNECT tunnel, not an HTTP proxy.</h1>
<p>
It appears you have configured your web browser to use this Tor port as
an HTTP proxy.
</p><p>
This is not correct: This port is configured as a CONNECT tunnel, not
an HTTP proxy. Please configure your client accordingly.  You can also
use HTTPS; then the client should automatically use HTTP CONNECT.</p>
<p>
See <a href="https://www.torproject.org/documentation.html">https://www.torproject.org/documentation.html</a> for more information.
</p>
</body>
</html>

@mksafavi mksafavi force-pushed the pkg/carburetor branch 2 times, most recently from 342da2c to 6a8d8b0 Compare December 22, 2024 15:17
@mksafavi
Copy link
Contributor Author

I've got this working!

https://gist.github.com/PerchunPak/ffc206405e219209f1cddde26373de09

Though firefox and chrome don't detect system proxy, but I can reach it with

~ ❯ curl -x "http://localhost:9080" example.com
<html>
<head>
<title>This is an HTTP CONNECT tunnel, not a full HTTP Proxy</title>
</head>
<body>
<h1>This is an HTTP CONNECT tunnel, not an HTTP proxy.</h1>
<p>
It appears you have configured your web browser to use this Tor port as
an HTTP proxy.
</p><p>
This is not correct: This port is configured as a CONNECT tunnel, not
an HTTP proxy. Please configure your client accordingly.  You can also
use HTTPS; then the client should automatically use HTTP CONNECT.</p>
<p>
See <a href="https://www.torproject.org/documentation.html">https://www.torproject.org/documentation.html</a> for more information.
</p>
</body>
</html>

Thanks for getting it running 👍
I'll apply your patch.

@mksafavi mksafavi changed the title carburetor: init at 4.5.1 carburetor: init at 5.0.0 Dec 22, 2024
@mksafavi mksafavi marked this pull request as ready for review December 22, 2024 15:35
@PerchunPak
Copy link
Member

Don't know what changed, but onion links started working in firefox

@mksafavi
Copy link
Contributor Author

mksafavi commented Dec 22, 2024

Don't know what changed, but onion links started working in firefox

If you're talking about the latest push, I added the missing tractor patch.

The default bridges couldn't connect on my network. It works on obs4.
In the preferences>Bridges menu there's an option to change the transport type. But you need to manually set the executable file. It might be worth it to patch this as well. snowflake and obfuscated are packaged on nix. but I couldn't find the conjure one.

@PerchunPak
Copy link
Member

PerchunPak commented Dec 22, 2024

We should avoid patching as much as possible, much better would be

{
  lib,
  ...,
  withObfuscated ? true,
  withSnowflake ? true,
}:
{
  ...
  propagatedBuildInputs =
    [ ]
    ++ lib.optional withObfuscated obfuscated
    ++ lib.optional withSnowflake snowflake;
  ...
}

Oh, this doesn't work, never mind
https://framagit.org/tractor/carburetor/-/blob/main/src/actions.py?ref_type=heads#L304

@mksafavi
Copy link
Contributor Author

We should avoid patching as much as possible, much better would be

{
  lib,
  ...,
  withObfuscated ? true,
  withSnowflake ? true,
}:
{
  ...
  propagatedBuildInputs =
    [ ]
    ++ lib.optional withObfuscated obfuscated
    ++ lib.optional withSnowflake snowflake;
  ...
}

Oh, this doesn't work, never mind https://framagit.org/tractor/carburetor/-/blob/main/src/actions.py?ref_type=heads#L304

I tried adding the packages. but it didn't work.
I checked the tractor dconf options:

('', '', '/nix/store/81ma3inbh5m1qb9kgdbs1hhnaim5r4n2-obfs4-0.4.0/bin/lyrebird', '/usr/bin/snowflake-client', '/usr/bin/conjure-client')

lyrebird is the obs4 exec that I manually added. by default it's looking for the files in /usr/bin

@PerchunPak
Copy link
Member

Which option is it? Perhaps, we should create a home-manager module for this.

@mksafavi
Copy link
Contributor Author

mksafavi commented Dec 22, 2024

Which option is it? Perhaps, we should create a home-manager module for this.

It's in org/tractor/pluggable-transport
here's the default value:
https://framagit.org/tractor/tractor/-/blob/main/src/tractor/tractor.gschema.xml?ref_type=heads#L61

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Dec 26, 2024
@mksafavi mksafavi requested a review from getchoo January 8, 2025 11:12
@mksafavi mksafavi force-pushed the pkg/carburetor branch 3 times, most recently from 777dafb to f881e46 Compare January 30, 2025 09:31
@PerchunPak
Copy link
Member

Why did you remove with* options?

@mksafavi
Copy link
Contributor Author

Why did you remove with* options?

Hi.
I don't know how to use the with options in the postInstall script.

@PerchunPak
Copy link
Member

Hi. I don't know how to use the with options in the postInstall script.

Just ask

postInstall = ''
  echo 123
''
++ lib.optionalString withSomething ''
  echo I exist only when "something" is enabled!
'';

@mksafavi
Copy link
Contributor Author

Hi. I don't know how to use the with options in the postInstall script.

Just ask

postInstall = ''
  echo 123
''
++ lib.optionalString withSomething ''
  echo I exist only when "something" is enabled!
'';

👍
I did try this first but didn't work. I think the string concat uses a single + sign.
I added the options again.

@PerchunPak
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 309642


x86_64-linux

✅ 3 packages built:
  • carburetor
  • tractor
  • tractor.dist

aarch64-linux

✅ 3 packages built:
  • carburetor
  • tractor
  • tractor.dist

@PerchunPak PerchunPak added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 30, 2025
pkgs/by-name/ca/carburetor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/tr/tractor/package.nix Outdated Show resolved Hide resolved
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Feb 1, 2025
Copy link
Member

@Tert0 Tert0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested both packages on x86_64-linux.

@PerchunPak PerchunPak added the 12.approvals: 2 This PR was reviewed and approved by two reputable people label Feb 2, 2025
@PerchunPak
Copy link
Member

@wegank please stop removing approve labels here, they are real

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/2228

@wegank
Copy link
Member

wegank commented Feb 2, 2025

The bot invalidates previous approvals after each push (which is what is happening here), unless the new changes are re-approved by at least one reviewer.

@wegank wegank merged commit 9704be1 into NixOS:master Feb 2, 2025
26 of 28 checks passed
@mksafavi mksafavi deleted the pkg/carburetor branch February 2, 2025 09:45
@Thatoo
Copy link

Thatoo commented Feb 2, 2025

Could it be backported to 24.11?

@wegank wegank added the backport release-24.11 Backport PR automatically label Feb 2, 2025
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Feb 2, 2025

Successfully created backport PR for release-24.11:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 2 This PR was reviewed and approved by two reputable people backport release-24.11 Backport PR automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: carburetor
7 participants