Skip to content

emacs: replace cd with pushd/popd in buildPhase of melpaBuild#334692

Merged
jian-lin merged 3 commits intoNixOS:stagingfrom
linj-fork:pr/melpaBuild-cd-pushd-popd
Aug 15, 2024
Merged

emacs: replace cd with pushd/popd in buildPhase of melpaBuild#334692
jian-lin merged 3 commits intoNixOS:stagingfrom
linj-fork:pr/melpaBuild-cd-pushd-popd

Conversation

@jian-lin
Copy link
Contributor

@jian-lin jian-lin commented Aug 14, 2024

Description of changes

It is better to not change the working directory.

One example showing the benefit is the rewriting1 of lspce, where
the Rust build hook assumes the working directory is unchanged.

Due to the limitation of nix, this PR triggers rebuilds of all packages built with melpaBuild. However, it only affects a small number of package which changes their working directory. I use a heuristic way to find those packages: searching for cd, source, packages, recipes, working, .., pushd and popd.

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.11 Release Notes (or backporting 23.11 and 24.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.

Add a 👍 reaction to pull requests you find important.

It is better to not change the working directory.

One example showing the benefit is the rewriting[1] of lspce, where
the Rust build hook assumes the working directory is unchanged.

[1]: NixOS#334476
@jian-lin jian-lin requested a review from adisbladis as a code owner August 14, 2024 18:52
@github-actions github-actions bot added the 6.topic: emacs Text editor label Aug 14, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Aug 14, 2024
Copy link
Member

@AndersonTorres AndersonTorres left a comment

Choose a reason for hiding this comment

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

A nice improvement, and way easier to reason about.

@jian-lin jian-lin merged commit 5f5e4e1 into NixOS:staging Aug 15, 2024
@jian-lin jian-lin deleted the pr/melpaBuild-cd-pushd-popd branch August 15, 2024 01:00
@jian-lin jian-lin mentioned this pull request Aug 24, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: emacs Text editor 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants