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

ada-url: init at 2.7.7 #297294

Closed
wants to merge 2 commits into from
Closed

ada-url: init at 2.7.7 #297294

wants to merge 2 commits into from

Conversation

genevieve-me
Copy link

@genevieve-me genevieve-me commented Mar 19, 2024

Description of changes

Note: I saw the notes on making a separate commit to add oneself to maintainers. I can do that if necessary, but I wasn't sure if maintainers can be empty? I can update this commit to either add myself as a package maintainer or remove the commented line. Besides that line, this PR is ready for review.

Add Ada, "a fast and WHATWG spec compliant URL parser written in C++.

Based on #227030

The patch is included since I ran into a roadblock due to how ada implemented cpm (cmake package manager). There are other packages in nixpkgs which work around it (e.g., poac) but those package upstreams gate their downloads on a conditional:

if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
  file(DOWNLOAD
    ...

I patched ada to reproduce this behavior so it can build in the sandbox.

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/)
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Mar 19, 2024
@ofborg ofborg bot added 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 10.rebuild-linux: 1 labels Mar 20, 2024
@Sigmanificient
Copy link
Member

Result of nixpkgs-review pr 297294 run on x86_64-linux 1

1 package built:
  • ada-url

@Sigmanificient
Copy link
Member

Sigmanificient commented Mar 27, 2024

Note: I saw the notes on making a separate commit to add oneself to maintainers. I can do that if necessary, but I wasn't sure if maintainers can be empty? I can update this commit to either add myself as a package maintainer or remove the commented line. Besides that line, this PR is ready for review.

You should add yourself directly within this PR, to make it easier to merge!
Just make sure to keep the 2 commits properly separated (one to add yourself as a maintainer, one for the package)

Nixpkgs manual says (on maintainer section):

A list of the maintainers of this Nix expression. Maintainers are defined in nixpkgs/maintainers/maintainer-list.nix. There is no restriction to becoming a maintainer, just add yourself to that list in a separate commit titled “maintainers: add alice” in the same pull request, and reference maintainers with maintainers = with lib.maintainers; [ alice bob ].

@genevieve-me
Copy link
Author

Added myself as a maintainer and platforms, I believe this PR is ready!

@ofborg ofborg bot added the 11.by: package-maintainer This PR was created by the maintainer of the package it changes label Apr 2, 2024
maintainers/maintainer-list.nix Outdated Show resolved Hide resolved
@Sigmanificient
Copy link
Member

Result of nixpkgs-review pr 297294 run on x86_64-linux 1

1 package built:
  • ada-url

Based on NixOS#227030

The patch is included since I ran into a roadblock due to how ada
implemented cpm (cmake package manager). There are other packages in
nixpkgs which work around it (e.g., poac) but those package upstreams
gate their downloads on a conditional:

```
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
  file(DOWNLOAD
    ...
```

I patched ada to reproduce this behavior so it can build in the sandbox.
- https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
- ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM}
-)
+if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
Copy link

Choose a reason for hiding this comment

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

@lemire should we fix this on Ada?

Copy link

Choose a reason for hiding this comment

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

CPM has regular releases and CPM.cmake has a recent update. I don't know if the latest release would solve the problem that this patch solves. If not, the proper action would be to submit a patch to CPM.

Modifying CPM.cmake ourselves is not a good idea. We should rely on releases.

Copy link
Author

Choose a reason for hiding this comment

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

This is not the "main" CPM.cmake file, but a variation on their provided get_cpm.cmake script. However, I have still filed cpm-cmake/CPM.cmake#554 and if they approve such a change I can also send a patch to ada-url to update their cmake file.

Copy link

Choose a reason for hiding this comment

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

That would be fantastic!

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Apr 9, 2024
@anonrig
Copy link

anonrig commented Apr 23, 2024

Can we land this PR?

Copy link
Contributor

@eclairevoyant eclairevoyant left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Some comments below:

inherit pname version;
src = fetchFromGitHub {
owner = "ada-url";
repo = pname;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be explicitly set rather than using pname

rev = "v1.6.0";
hash = "sha256-EAJk3JhLdkuGKRMtspTLejck8doWPd7Z0Lv/Mvf3KFY=";
};
pname = "ada";
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason we're using ada here when the attrname is ada-url?

nativeBuildInputs = [ cmake ];

buildInputs = [ cxxopts ];
meta = with lib; {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
meta = with lib; {
meta = {

tracking issue: #292468

pname = "ada";
version = "2.7.7";
in
stdenv.mkDerivation rec {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
stdenv.mkDerivation rec {
stdenv.mkDerivation {

@eclairevoyant
Copy link
Contributor

@ofborg eval

@clansty
Copy link

clansty commented Aug 4, 2024

The latest telegram-desktop seems wont build without this package

@PedroHLC
Copy link
Member

PedroHLC commented Aug 5, 2024

The latest telegram-desktop seems wont build without this package

@eclairevoyant since the author had no activity in GitHub for the last 4 months, can you commit your suggestions and merge?

@anonrig
Copy link

anonrig commented Aug 5, 2024

Hi @PedroHLC I'm the author of Ada (not this PR), I'm more than happy to help if there's anything I can do.

@genevieve-me
Copy link
Author

Yes, go ahead. At the time I wasn't sure what to do based on the upstream response (see above comments), and I've since stopped using Nix.

@anonrig anonrig mentioned this pull request Aug 6, 2024
13 tasks
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 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes 12.approvals: 1 This PR was reviewed and approved by one reputable person 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants