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

bruno: package from source #261139

Merged
merged 2 commits into from Jan 1, 2024
Merged

bruno: package from source #261139

merged 2 commits into from Jan 1, 2024

Conversation

lucasew
Copy link
Contributor

@lucasew lucasew commented Oct 15, 2023

Description of changes

Package bruno from source as now they ship package-lock.json together with the repo.

To fix the package-lock.json issue, that upstream doesn't seem to care, I also integrated the tool mentioned in #261137. Using the patch approach requires manual intervention at each bump and generating the package-lock.json is tricky because the tool that fetches src would actually fetch the patched package-lock.json to fix. It's much simpler to integrate the fix into a derivation and also easier bumps using r-ryantm.

I checked if npm-lockfile-fix creates a reproducible result by running the cold build of bruno.src twice and it gave the same hash.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.11 Release Notes (or backporting 23.05 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.

@lucasew
Copy link
Contributor Author

lucasew commented Oct 20, 2023

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

1 similar comment
@lucasew
Copy link
Contributor Author

lucasew commented Oct 20, 2023

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

@lucasew
Copy link
Contributor Author

lucasew commented Oct 20, 2023

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

@lucasew
Copy link
Contributor Author

lucasew commented Oct 21, 2023

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

1 package built:
  • bruno

@lucasew lucasew mentioned this pull request Oct 31, 2023
12 tasks
@lucasew lucasew force-pushed the bruno-src branch 2 times, most recently from d1201b8 to 39ce9b9 Compare October 31, 2023 23:59
@lucasew lucasew changed the title bruno: package from source (WIP) bruno: package from source Nov 1, 2023
@lucasew
Copy link
Contributor Author

lucasew commented Nov 1, 2023

Upstream seems to not care about the package-lock.json thing.

So I guess we have to regenerate a patch at each bump.

@lucasew lucasew marked this pull request as ready for review November 1, 2023 00:01
@lucasew
Copy link
Contributor Author

lucasew commented Nov 1, 2023

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

1 package built:
  • bruno

@lucasew
Copy link
Contributor Author

lucasew commented Nov 5, 2023

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

1 package built:
  • bruno

@thiagokokada
Copy link
Contributor

Is this PR ready to review? Because in the description it says it is waiting for some issue to be closed first.

@lucasew
Copy link
Contributor Author

lucasew commented Dec 29, 2023

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

3 packages built:
  • bruno
  • npm-lockfile-fix
  • npm-lockfile-fix.dist

@lucasew
Copy link
Contributor Author

lucasew commented Dec 29, 2023

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

3 packages built:
  • bruno
  • npm-lockfile-fix
  • npm-lockfile-fix.dist

Comment on lines 18 to 20
let
electron = electron-bin;
in
Copy link
Member

Choose a reason for hiding this comment

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

Whats the reason behind this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only convenience. I was testing with different electron versions at first and settled for the default one.

Comment on lines +32 to +30
postFetch = ''
${lib.getExe npm-lockfile-fix} $out/package-lock.json
'';
Copy link
Member

Choose a reason for hiding this comment

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

I think we should rather do this in postPatch to make the download easier to reproduce.

Also that this does network requests is not that great. We should probably just apply a patch to get the hashes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Build complains about inconsistencies in package-lock.json.

That way the bump script already fixes the lock and updates the hash. As the lock fix is reproducible it's fine.

fetchFromGitHub doesn't have a patchPhase tho

Copy link
Member

Choose a reason for hiding this comment

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

As the lock fix is reproducible it's fine.

but we now depend on npmjs.com working to be able to fetch the src, right? If someone has a copy of the archive but the service is no longer available or some download is yanked, then the FOD cannot be produced anymore. A patch file shouldn't have that problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will still depend on npm to generate the node_modules to build the package. BTW for end users this bundle will be cached.

pkgs/by-name/br/bruno/package.nix Outdated Show resolved Hide resolved
Signed-off-by: lucasew <lucas59356@gmail.com>
@lucasew lucasew force-pushed the bruno-src branch 2 times, most recently from a845fa1 to c2a91cf Compare December 31, 2023 15:43
@yu-re-ka
Copy link
Contributor

yu-re-ka commented Dec 31, 2023 via email

@lucasew
Copy link
Contributor Author

lucasew commented Dec 31, 2023

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

3 packages built:
  • bruno
  • npm-lockfile-fix
  • npm-lockfile-fix.dist

Signed-off-by: lucasew <lucas59356@gmail.com>
@thiagokokada thiagokokada merged commit d5fb68d into NixOS:master Jan 1, 2024
22 of 23 checks passed
@lucasew lucasew deleted the bruno-src branch January 1, 2024 13:19
@lucasew lucasew mentioned this pull request Feb 20, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants