Skip to content

Comments

happy: fix for justStaticExecutables#463608

Merged
sternenseemann merged 1 commit intoNixOS:stagingfrom
ryota2357:fix-happy
Nov 21, 2025
Merged

happy: fix for justStaticExecutables#463608
sternenseemann merged 1 commit intoNixOS:stagingfrom
ryota2357:fix-happy

Conversation

@ryota2357
Copy link
Contributor

Things done

Remove references to happy-lib path so that happy can build on aarch64-darwin.

See: #304352
ZHF: #457852

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@ryota2357
Copy link
Contributor Author

ryota2357 commented Nov 21, 2025

I tested basic functionality with:

Calc.y
{
module Main where
import Data.Char (isDigit, isSpace)
}

%name calc
%tokentype { Token }
%error { parseError }
%token
    int     { TokenInt $$ }
    '+'     { TokenPlus }

%%

Exp : Exp '+' int    { $1 + $3 }
    | int            { $1 }

{
data Token
      = TokenInt Int
      | TokenPlus
      deriving Show

lexer :: String -> [Token]
lexer [] = []
lexer (c:cs)
    | isSpace c = lexer cs
    | isDigit c = lexerNum (c:cs)
    | c == '+'  = TokenPlus : lexer cs
    | otherwise = error $ "Unknown character: " ++ [c]

lexerNum :: String -> [Token]
lexerNum cs = TokenInt (read num) : lexer rest
  where (num,rest) = span isDigit cs

parseError :: [Token] -> a
parseError _ = error "Parse error"

main :: IO ()
main = do
    let input = "10 + 20 + 30"
    print $ "Input: " ++ input
    print $ "Result: " ++ show (calc (lexer input))
}
$ ./result/bin/happy Calc.y
Warning: With happy 2.0, the --ghc flag has become non-optional. To suppress this warning, pass the --ghc flag.

$ nix run nixpkgs#ghc -- Calc.hs -o calc
[1 of 2] Compiling Main             ( Calc.hs, Calc.o )
[2 of 2] Linking calc

$ ./calc
"Input: 10 + 20 + 30"
"Result: 60"

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 6.topic: haskell General-purpose, statically typed, purely functional programming language labels Nov 21, 2025
@ryota2357 ryota2357 changed the base branch from master to staging November 21, 2025 02:00
@nixpkgs-ci nixpkgs-ci bot closed this Nov 21, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Nov 21, 2025
@ryota2357
Copy link
Contributor Author

I created #463650, which avoids the need for many package rebuilds.
Which is the better way to fix the happy build error?

Copy link
Member

@sternenseemann sternenseemann left a comment

Choose a reason for hiding this comment

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

I prefer this being fixed globally. There is time to get this into a staging cycle for 25.11, so no need to rush a worse version of this fix to master. We'll need to check whether the current staging branch will reach 25.11 or we'll need to backport.

Checked that happy(-lib) only use version and getDataDir.

@ryota2357
Copy link
Contributor Author

@sternenseemann
Thank you for the review and for answering my question!
I've fixed it.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Nov 21, 2025
@sternenseemann sternenseemann added this pull request to the merge queue Nov 21, 2025
Merged via the queue into NixOS:staging with commit a2a23e4 Nov 21, 2025
26 of 30 checks passed
@ryota2357 ryota2357 deleted the fix-happy branch November 21, 2025 10:25
@wolfgangwalther
Copy link
Contributor

There is time to get this into a staging cycle for 25.11, so no need to rush a worse version of this fix to master. We'll need to check whether the current staging branch will reach 25.11 or we'll need to backport.

We already had staging branch-off, so if this should go into 25.11, we need to backport it to staging-25.11.

@wolfgangwalther wolfgangwalther added the backport staging-25.11 Backport PR automatically label Nov 21, 2025
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Nov 21, 2025

Successfully created backport PR for staging-25.11:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: haskell General-purpose, statically typed, purely functional programming language 8.has: port to stable This PR already has a backport to the stable release. 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: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. backport staging-25.11 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants