Skip to content

Comments

construct: init at 0.1.0#289114

Merged
kirillrdy merged 1 commit intoNixOS:masterfrom
Rucadi:construct
Feb 19, 2024
Merged

construct: init at 0.1.0#289114
kirillrdy merged 1 commit intoNixOS:masterfrom
Rucadi:construct

Conversation

@Rucadi
Copy link
Contributor

@Rucadi Rucadi commented Feb 15, 2024

Description of changes

Construct is a new NASM-like source to source compiler which adds features such as while loops, if statements, scoped macros, simpler function-call syntax and more. It currently supports 64, 32, 16 and 8 bit modes.

It currently only resides on: https://github.com/Thomas-de-Bock/construct but it provides nice abstractions.

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.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Feb 15, 2024
Copy link
Member

@afh afh left a comment

Choose a reason for hiding this comment

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

Thank you for your time and effort to add a new package to nixpkgs, @Rucadi, much appreciated.

I've left a few comments below that hopefully help to make the package adhere to nixpkgs' current best practices (or rather my limited understanding of it :)

Copy link
Member

Choose a reason for hiding this comment

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

From what I've picked up finalAttrs is preferred over rec, maybe someone more familiar with the details could chime in and provide some background information in this?

Suggested change
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {

Copy link
Member

Choose a reason for hiding this comment

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

Use of the hash keyword is preferred over sha256:

Suggested change
sha256 = "sha256-pOoqjtFkvMtof+YjV47JPu5tw/U6CU/MpL+C1Z1pgrE=";
hash = "sha256-pOoqjtFkvMtof+YjV47JPu5tw/U6CU/MpL+C1Z1pgrE=";

Copy link
Member

Choose a reason for hiding this comment

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

llvmPackages is not referenced anywhere in this package, what am I missing that this is necessary?

Comment on lines 21 to 20
Copy link
Member

Choose a reason for hiding this comment

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

Using makeTarget might be more appropriate here:

Suggested change
buildPhase = ''
make main
'';
makeTarget = "main";

@Rucadi
Copy link
Contributor Author

Rucadi commented Feb 16, 2024

`Thank you for your kind corrections, I'll try to fix everything you mentioned!

I checked a video from Tweak that explains finalAttrs https://www.youtube.com/watch?v=jb36PfG28W8 and decided to switch to it :)

@afh
Copy link
Member

afh commented Feb 16, 2024

Thank you for posting a link to the "Nix Hour #42" video that talks about the benefits of finalAttrs, very useful!

If you've find my suggestions on this PR helpful I'd appreciated if the commit message would include:

Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>

Hopefully that's not too much to ask :)

@Rucadi
Copy link
Contributor Author

Rucadi commented Feb 17, 2024

I squashed the commits and included you as a coauthor for the corrections :)

Copy link
Member

@afh afh left a comment

Choose a reason for hiding this comment

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

Thank you for accepting my suggestions and crediting me as an co-author, very much appreciated!

Through an unrelated PR of mine (#288767) I became aware of the "superfluous use of pname" just yesterday, hence I'd like to suggest the change to src.repo below.

@afh
Copy link
Member

afh commented Feb 17, 2024

Thanks for chiming in with very helpful advice and providing links to documentation, @kirillrdy, very much appreciated! 🙏

@Rucadi
Copy link
Contributor Author

Rucadi commented Feb 17, 2024

Thank you all for the suggestions and also the version program naming!

I'll for sure remember everything next time 👍

@afh
Copy link
Member

afh commented Feb 17, 2024

Result of nixpkgs-review pr 289114 run on aarch64-darwin 1

1 package built:
  • construct

Copy link
Member

@afh afh left a comment

Choose a reason for hiding this comment

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

Thank you for addressing all the comments, suggestions, and questions, @Rucadi. 🙂 Please have a bit more patience, until someone with the "commit-bit enabled" comes along.

@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/1453

@Rucadi Rucadi changed the title construct: init at master construct: init at 0-unstable-2024-01-16 Feb 17, 2024
@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 17, 2024
@kirillrdy
Copy link
Member

@Rucadi greetings ! and thank you for your contribution

please read https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#quick-start-to-adding-a-package

specifically Before adding a new package, please consider the following questions:

main reason of concern right now is missing license

@Rucadi
Copy link
Contributor Author

Rucadi commented Feb 17, 2024

@Rucadi greetings ! and thank you for your contribution

please read https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#quick-start-to-adding-a-package

specifically Before adding a new package, please consider the following questions:

main reason of concern right now is missing license

I asked @Thomas-de-Bock but he has not given an answer yet, I'll try again to see if that can be clarified.

Comment on lines 29 to 27
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mkdir -p $out/
cp -r bin $out/
install -Dm755 bin/construct -t $out/bin

@sikmir
Copy link
Member

sikmir commented Feb 17, 2024

Result of nixpkgs-review pr 289114 run on x86_64-darwin 1

1 package built:
  • construct

@Thomas-995
Copy link

Hello, sorry for not responding here earlier, I've added a license file along with some additional changes to the codebase.

@afh
Copy link
Member

afh commented Feb 19, 2024

Thank you very much, @Thomas-de-Bock, that's very helpful 🙏 If you feel like also creating a first release¹, that would be helpful from a package maintainer perspective. If not that's alright too as nixpkgs has a package naming/versioning convention for software not providing a version (yet).

————————————
¹ semver suggests an initial development release at 0.1.0 and increasing the patch number until the project is ready for its prime-time 1.0.0 release.

@Thomas-995
Copy link

I've added a release for the linux x86 build.

@afh
Copy link
Member

afh commented Feb 19, 2024

Thank you, @Thomas-de-Bock, that's truly helpful and very much appreciated!
@Rucadi, mind updating this PR accordingly? 🙂

@Rucadi
Copy link
Contributor Author

Rucadi commented Feb 19, 2024

I'll do it later today when I'm free :)

Nice that we have a first version and a license!

@Rucadi Rucadi changed the title construct: init at 0-unstable-2024-01-16 construct: init at 0.1.0 Feb 19, 2024
@delroth delroth removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 19, 2024
Co-authored-by: Alexis Hildebrandt <afh@surryhill.net>
@afh
Copy link
Member

afh commented Feb 19, 2024

Result of nixpkgs-review pr 289114 run on aarch64-darwin 1

1 package built:
  • construct

Copy link
Member

@kirillrdy kirillrdy left a comment

Choose a reason for hiding this comment

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

than you all for great work and @Rucadi welcome onboard

@kirillrdy kirillrdy merged commit 183b710 into NixOS:master Feb 19, 2024
@Rucadi Rucadi deleted the construct branch February 19, 2024 22:38
@afh
Copy link
Member

afh commented Feb 20, 2024

Thank you for the kind words, the helpful review comments, and merging this PR, @kirillrdy, very much appreciated! 🙏

@Rucadi
Copy link
Contributor Author

Rucadi commented Feb 20, 2024

Thank you for your words and helping reach the final result, much appreciated :)

@Thomas-995
Copy link

Thank you so much to everyone who helped merged, this is super cool!

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: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants