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

rapidcheck: Build shared/static following defaults #269064

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Nov 21, 2023

Description of changes

CMake defaults to static which is not what we want. It is especially dangerous because this library has global variables --- embedding multiple copies in downstream shared objects used by the same final executable will cause problems.

Second commit fixes Nix by backporting NixOS/nix#9431

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

Priorities

Add a 👍 reaction to pull requests you find important.

CMake defaults to static which is not what we want. It is
especially dangerous because this library has global variables ---
embedding multiple copies in downstream shared objects used by the same
final executable will cause problems.
Ericson2314 added a commit to obsidiansystems/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).
github-actions bot pushed a commit to NixOS/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 4613156)
github-actions bot pushed a commit to NixOS/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 4613156)
github-actions bot pushed a commit to NixOS/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 4613156)
github-actions bot pushed a commit to NixOS/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 4613156)
github-actions bot pushed a commit to NixOS/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 4613156)
github-actions bot pushed a commit to NixOS/nix that referenced this pull request Nov 22, 2023
NixOS/nixpkgs#269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 4613156)
@Ericson2314
Copy link
Member Author

The Nix PR and backports are merged so this is good to go. (As new releases are cut, both from master and from the maintenance branches, these patches will no longer be needed.)

@Ericson2314 Ericson2314 merged commit d30dd73 into NixOS:master Nov 22, 2023
27 checks passed
@Ericson2314 Ericson2314 deleted the rapidcheck-shared branch November 22, 2023 14:52
Copy link
Contributor

Backport failed for release-23.05, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-23.05
git worktree add -d .worktree/backport-269064-to-release-23.05 origin/release-23.05
cd .worktree/backport-269064-to-release-23.05
git switch --create backport-269064-to-release-23.05
git cherry-pick -x b2b9257186c568bae937c09b36067cd6b3448f2a 98bdc2b3bb7ac42173cbe2033b91f849307a4737

Copy link
Contributor

Successfully created backport PR for release-23.11:

@@ -113,6 +113,13 @@ let
hash = "sha256-s1ybRFCjQaSGj7LKu0Z5g7UiHqdJGeD+iPoQL0vaiS0=";
};

patch-rapidcheck-shared = fetchpatch2 {
Copy link
Member

Choose a reason for hiding this comment

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

FYI fetchpatch2 is only really required when renaming files ATM

Copy link
Member Author

Choose a reason for hiding this comment

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

oh OK my bad. I just assumed it was just the "new and improved version" which should be used by default.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it really matters, just that the normalisation is just slightly different and has a few bug fixes so not all hashes are compatible.

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.

2 participants