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

✨ languageSettings出力 #175

Merged
merged 11 commits into from
Dec 24, 2024
Merged

Conversation

Kentaro1043
Copy link
Contributor

issue

close #137

チェックリスト(nix)

  • ビルドが通る
  • license-check.shが通る

@Kentaro1043
Copy link
Contributor Author

現状の仕様
コマンド: nix build .#languageSettings --out-link result.json

[
	{
		"languages": [
			{
				"binName": "python3.11",
				"compile": "cp \"$SRC\" \"$DIST\"",
				"name": "Python3.11",
				"run": "exec /nix/store/n3qp3gs2jalcfaas2cgagnj4jms4jbza-python3-3.11.10-env/bin/python \"$DIST\""
			}
		]
	},
	{
		"languages": [
			{
				"binName": "python3.12",
				"compile": "cp \"$SRC\" \"$DIST\"",
				"name": "Python3.12",
				"run": "exec /nix/store/hsbs4k9znhf3sz35n1c8xmncf4k0jmp7-python3-3.12.6-env/bin/python \"$DIST\""
			}
		]
	},
	{
		"languages": [
			{
				"binName": "python3.12-quantum",
				"compile": "cp \"$SRC\" \"$DIST\"",
				"libraries": [
					{
						"name": "qiskit",
						"version": "1.2.4"
					},
					{
						"name": "numpy",
						"version": "2.1.3"
					},
					{
						"name": "scipy",
						"version": "1.14.1"
					},
					{
						"name": "networkx",
						"version": "3.4.2"
					},
					{
						"name": "sympy",
						"version": "1.13.3"
					},
					{
						"name": "sortedcontainers",
						"version": "2.4.0"
					},
					{
						"name": "more-itertools",
						"version": "10.5.0"
					},
					{
						"name": "shapely",
						"version": "2.0.6"
					},
					{
						"name": "bitarray",
						"version": "3.0.0"
					},
					{
						"name": "pulp",
						"version": "2.9.0"
					},
					{
						"name": "mpmath",
						"version": "1.3.0"
					},
					{
						"name": "pandas",
						"version": "2.2.3"
					},
					{
						"name": "z3-solver",
						"version": "4.13.3.0"
					},
					{
						"name": "scikit-learn",
						"version": "1.5.2"
					}
				],
				"name": "Python3.12-quantum",
				"run": "exec /nix/store/fdywml2llg5wl1l4d665j0amgmafqd0r-hello-world-env/bin/python \"$DIST\""
			}
		]
	}
]

@Kentaro1043 Kentaro1043 requested a review from comavius December 16, 2024 06:51
Copy link
Member

@comavius comavius left a comment

Choose a reason for hiding this comment

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

https://github.com/traP-jp/traO-Judge-docs/blob/develop/exec-container/schema.json
を参照してjson schemaのバリデーションをしたいです:pray:

@comavius
Copy link
Member

こうなってほしいはず

{
  "languages": [
    {
      "binName": "python3.11",
      "compile": "cp \"$SRC\" \"$DIST\"",
      "name": "Python3.11",
      "run": "exec /nix/store/n3qp3gs2jalcfaas2cgagnj4jms4jbza-python3-3.11.10-env/bin/python \"$DIST\""
    },
    {
      "binName": "python3.12",
      "compile": "cp \"$SRC\" \"$DIST\"",
      "name": "Python3.12",
      "run": "exec /nix/store/hsbs4k9znhf3sz35n1c8xmncf4k0jmp7-python3-3.12.6-env/bin/python \"$DIST\""
    },
    {
      "binName": "python3.12-quantum",
      "compile": "cp \"$SRC\" \"$DIST\"",
      "libraries": [
        {
          "name": "qiskit",
          "version": "1.2.4"
        },
        {
          "name": "numpy",
          "version": "2.1.3"
        },
        {
          "name": "scipy",
          "version": "1.14.1"
        },
        {
          "name": "networkx",
          "version": "3.4.2"
        },
        {
          "name": "sympy",
          "version": "1.13.3"
        },
        {
          "name": "sortedcontainers",
          "version": "2.4.0"
        },
        {
          "name": "more-itertools",
          "version": "10.5.0"
        },
        {
          "name": "shapely",
          "version": "2.0.6"
        },
        {
          "name": "bitarray",
          "version": "3.0.0"
        },
        {
          "name": "pulp",
          "version": "2.9.0"
        },
        {
          "name": "mpmath",
          "version": "1.3.0"
        },
        {
          "name": "pandas",
          "version": "2.2.3"
        },
        {
          "name": "z3-solver",
          "version": "4.13.3.0"
        },
        {
          "name": "scikit-learn",
          "version": "1.5.2"
        }
      ],
      "name": "Python3.12-quantum",
      "run": "exec /nix/store/fdywml2llg5wl1l4d665j0amgmafqd0r-hello-world-env/bin/python \"$DIST\""
    }
  ]
}

@Kentaro1043 Kentaro1043 requested a review from comavius December 21, 2024 10:54
@Kentaro1043
Copy link
Contributor Author

Kentaro1043 commented Dec 21, 2024

nix build .#languageSettingsをすれば、resultにjsonファイルが出てきます。
憂慮事項は、

  • 出力されるjsonが1行に全てまとまっているので、フォーマットが必要ならする

といった感じです。

Copy link
Member

@comavius comavius left a comment

Choose a reason for hiding this comment

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

よさそうです、ありがとう!

@comavius comavius self-requested a review December 21, 2024 14:43
Copy link
Member

@comavius comavius left a comment

Choose a reason for hiding this comment

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

ごめん、compilersも出力できるようにお願いします

@comavius
Copy link
Member

ごめん、compilersも出力できるようにお願いします

これでコードが大きくなりすぎたら関数として切り分けて、allpkgs.nixみたいにファイルを分けてほしいかも

@Kentaro1043 Kentaro1043 requested a review from comavius December 23, 2024 13:29
@Kentaro1043
Copy link
Contributor Author

レビューリクエスト後に申し訳無いですが、ファイル分割もやっておきました

Copy link
Member

@comavius comavius left a comment

Choose a reason for hiding this comment

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

よさそう、ありがとう!

@Kentaro1043 Kentaro1043 merged commit 11c36b1 into develop Dec 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compile-runのコマンドをnixに書く
2 participants